From: Daniel Sanders Date: Mon, 15 Jun 2015 09:19:41 +0000 (+0000) Subject: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a67e8ae382ad02b1c3d49352d044e4bd532aef3c;p=clang Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC. Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar trivial patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239721 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseStmtAsm.cpp b/lib/Parse/ParseStmtAsm.cpp index 8ba9f15f0a..8cdae6a74b 100644 --- a/lib/Parse/ParseStmtAsm.cpp +++ b/lib/Parse/ParseStmtAsm.cpp @@ -512,8 +512,8 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) { llvm::SourceMgr TempSrcMgr; llvm::MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &TempSrcMgr); - MOFI->InitMCObjectFileInfo(TT, llvm::Reloc::Default, llvm::CodeModel::Default, - Ctx); + MOFI->InitMCObjectFileInfo(TheTriple, llvm::Reloc::Default, + llvm::CodeModel::Default, Ctx); std::unique_ptr Buffer = llvm::MemoryBuffer::getMemBuffer(AsmString, ""); diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp index f73d07bd0b..f7ac17f143 100644 --- a/tools/driver/cc1as_main.cpp +++ b/tools/driver/cc1as_main.cpp @@ -323,8 +323,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts, MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr); // FIXME: Assembler behavior can change with -static. - MOFI->InitMCObjectFileInfo(Opts.Triple, - Reloc::Default, CodeModel::Default, Ctx); + MOFI->InitMCObjectFileInfo(Triple(Opts.Triple), Reloc::Default, + CodeModel::Default, Ctx); if (Opts.SaveTemporaryLabels) Ctx.setAllowTemporaryLabels(false); if (Opts.GenDwarfForAssembly)