aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
diff options
context:
space:
mode:
authorAkshat Oke <Akshat.Oke@amd.com>2024-10-16 14:52:25 +0530
committerGitHub <noreply@github.com>2024-10-16 14:52:25 +0530
commitb5cc222d7429fe6f18c787f633d5262fac2e676f (patch)
tree049fc686f0f5fedb91baa35ff5f8d4eec6ac4abd /llvm/lib/CodeGen/MIRParser/MIRParser.cpp
parent1d40fefb08e9b11b72bf40274aa7839ae9f7fe07 (diff)
downloadllvm-b5cc222d7429fe6f18c787f633d5262fac2e676f.zip
llvm-b5cc222d7429fe6f18c787f633d5262fac2e676f.tar.gz
llvm-b5cc222d7429fe6f18c787f633d5262fac2e676f.tar.bz2
[MIR] Fix vreg flag vector memory leak (#112479)
A fix-it patch for dbfca24 #110228. No need for a container. This allows 8 flags for a register. The virtual register flags vector had a memory leak because the vector's memory is not freed. The `BumpPtrAllocator` handles the deallocation and missed calling the `std::vector<uint8_t> Flags` destructor.
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIRParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIRParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
index 10d3cdc..c0c61b3 100644
--- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
@@ -703,7 +703,7 @@ bool MIRParserImpl::parseRegisterInfo(PerFunctionMIParsingState &PFS,
return error(FlagStringValue.SourceRange.Start,
Twine("use of undefined register flag '") +
FlagStringValue.Value + "'");
- Info.Flags.push_back(FlagValue);
+ Info.Flags |= FlagValue;
}
RegInfo.noteNewVirtualRegister(Info.VReg);
}