From a67e8ae382ad02b1c3d49352d044e4bd532aef3c Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Mon, 15 Jun 2015 09:19:41 +0000 Subject: [PATCH] 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 --- lib/Parse/ParseStmtAsm.cpp | 4 ++-- tools/driver/cc1as_main.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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) -- 2.50.1