r216226 - Update Clang for LLVM API change to use unique_ptr in SourceManager::AddNewSourceBuffer
David Blaikie
dblaikie at gmail.com
Thu Aug 21 14:01:00 PDT 2014
Author: dblaikie
Date: Thu Aug 21 16:01:00 2014
New Revision: 216226
URL: http://llvm.org/viewvc/llvm-project?rev=216226&view=rev
Log:
Update Clang for LLVM API change to use unique_ptr in SourceManager::AddNewSourceBuffer
Modified:
cfe/trunk/lib/Parse/ParseStmtAsm.cpp
cfe/trunk/tools/driver/cc1as_main.cpp
Modified: cfe/trunk/lib/Parse/ParseStmtAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmtAsm.cpp?rev=216226&r1=216225&r2=216226&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmtAsm.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmtAsm.cpp Thu Aug 21 16:01:00 2014
@@ -498,11 +498,11 @@ StmtResult Parser::ParseMicrosoftAsmStat
llvm::SourceMgr TempSrcMgr;
llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &TempSrcMgr);
- llvm::MemoryBuffer *Buffer =
- llvm::MemoryBuffer::getMemBuffer(AsmString, "<MS inline asm>");
+ std::unique_ptr<llvm::MemoryBuffer> Buffer(
+ llvm::MemoryBuffer::getMemBuffer(AsmString, "<MS inline asm>"));
// Tell SrcMgr about this buffer, which is what the parser will pick up.
- TempSrcMgr.AddNewSourceBuffer(Buffer, llvm::SMLoc());
+ TempSrcMgr.AddNewSourceBuffer(std::move(Buffer), llvm::SMLoc());
std::unique_ptr<llvm::MCStreamer> Str(createNullStreamer(Ctx));
std::unique_ptr<llvm::MCAsmParser> Parser(
Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=216226&r1=216225&r2=216226&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Thu Aug 21 16:01:00 2014
@@ -295,7 +295,7 @@ static bool ExecuteAssembler(AssemblerIn
SourceMgr SrcMgr;
// Tell SrcMgr about this buffer, which is what the parser will pick up.
- SrcMgr.AddNewSourceBuffer(Buffer->release(), SMLoc());
+ SrcMgr.AddNewSourceBuffer(std::move(*Buffer), SMLoc());
// Record the location of the include directories so that the lexer can find
// it later.
More information about the cfe-commits
mailing list