mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using std::unique_ptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216223 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2123,8 +2123,8 @@ bool AsmParser::handleMacroEntry(const MCAsmMacro *M, SMLoc NameLoc) {
|
||||
// instantiation.
|
||||
OS << ".endmacro\n";
|
||||
|
||||
MemoryBuffer *Instantiation =
|
||||
MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>");
|
||||
std::unique_ptr<MemoryBuffer> Instantiation(
|
||||
MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>"));
|
||||
|
||||
// Create the macro instantiation object and add to the current macro
|
||||
// instantiation stack.
|
||||
@ -2134,7 +2134,7 @@ bool AsmParser::handleMacroEntry(const MCAsmMacro *M, SMLoc NameLoc) {
|
||||
ActiveMacros.push_back(MI);
|
||||
|
||||
// Jump to the macro instantiation and prime the lexer.
|
||||
CurBuffer = SrcMgr.AddNewSourceBuffer(Instantiation, SMLoc());
|
||||
CurBuffer = SrcMgr.AddNewSourceBuffer(std::move(Instantiation), SMLoc());
|
||||
Lexer.setBuffer(SrcMgr.getMemoryBuffer(CurBuffer)->getBuffer());
|
||||
Lex();
|
||||
|
||||
@ -4310,8 +4310,8 @@ void AsmParser::instantiateMacroLikeBody(MCAsmMacro *M, SMLoc DirectiveLoc,
|
||||
raw_svector_ostream &OS) {
|
||||
OS << ".endr\n";
|
||||
|
||||
MemoryBuffer *Instantiation =
|
||||
MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>");
|
||||
std::unique_ptr<MemoryBuffer> Instantiation(
|
||||
MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>"));
|
||||
|
||||
// Create the macro instantiation object and add to the current macro
|
||||
// instantiation stack.
|
||||
@ -4321,7 +4321,7 @@ void AsmParser::instantiateMacroLikeBody(MCAsmMacro *M, SMLoc DirectiveLoc,
|
||||
ActiveMacros.push_back(MI);
|
||||
|
||||
// Jump to the macro instantiation and prime the lexer.
|
||||
CurBuffer = SrcMgr.AddNewSourceBuffer(Instantiation, SMLoc());
|
||||
CurBuffer = SrcMgr.AddNewSourceBuffer(std::move(Instantiation), SMLoc());
|
||||
Lexer.setBuffer(SrcMgr.getMemoryBuffer(CurBuffer)->getBuffer());
|
||||
Lex();
|
||||
}
|
||||
|
Reference in New Issue
Block a user