]> granicus.if.org Git - clang/commitdiff
Recommit r239721: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInf...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 16 Jun 2015 12:18:07 +0000 (12:18 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 16 Jun 2015 12:18:07 +0000 (12:18 +0000)
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 patches.

This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

The first time this was committed it accidentally fixed an inconsistency in
triples in llvm-mc and this caused a failure. This inconsistency was fixed in
r239808.

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@239812 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmtAsm.cpp
tools/driver/cc1as_main.cpp

index 8ba9f15f0a40dde6aca0c1ba151db044a9b66f15..8cdae6a74b206dede8e19f63ba6d26fb4c3e7620 100644 (file)
@@ -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<llvm::MemoryBuffer> Buffer =
       llvm::MemoryBuffer::getMemBuffer(AsmString, "<MS inline asm>");
 
index f73d07bd0be929627862b8fdf276e6b4c298c027..f7ac17f14301e23f00a5db1939784ea93536c85e 100644 (file)
@@ -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)