Update Clang for LLVM API change to use unique_ptr in SourceManager::AddNewSourceBuffer

llvm-svn: 216226
This commit is contained in:
David Blaikie 2014-08-21 21:01:00 +00:00
parent addb75a4f3
commit 9e095d9b6b
2 changed files with 4 additions and 4 deletions

View File

@ -498,11 +498,11 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
llvm::SourceMgr TempSrcMgr; llvm::SourceMgr TempSrcMgr;
llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &TempSrcMgr); llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &TempSrcMgr);
llvm::MemoryBuffer *Buffer = std::unique_ptr<llvm::MemoryBuffer> Buffer(
llvm::MemoryBuffer::getMemBuffer(AsmString, "<MS inline asm>"); llvm::MemoryBuffer::getMemBuffer(AsmString, "<MS inline asm>"));
// Tell SrcMgr about this buffer, which is what the parser will pick up. // 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::MCStreamer> Str(createNullStreamer(Ctx));
std::unique_ptr<llvm::MCAsmParser> Parser( std::unique_ptr<llvm::MCAsmParser> Parser(

View File

@ -295,7 +295,7 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
SourceMgr SrcMgr; SourceMgr SrcMgr;
// Tell SrcMgr about this buffer, which is what the parser will pick up. // 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 // Record the location of the include directories so that the lexer can find
// it later. // it later.