Skip to content

Commit

Permalink
Replace Triple with a new TargetTuple in MCTargetDesc/* and related. …
Browse files Browse the repository at this point in the history
…NFC.

Summary:
This is the first patch in the series to migrate Triple's (which are ambiguous)
to TargetTuple's (which aren't).

For the moment, TargetTuple simply passes all requests to the Triple object it
holds. Once it has replaced Triple, it will start to implement the interface in
a more suitable way.

This change makes some changes to the public C++ API. In particular,
InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer()
now take TargetTuples instead of Triples. The other public C++ API's have
been left as-is for the moment to reduce patch size.

This commit also contains a trivial patch to clang to account for the C++ API
change.

Reviewers: rengolin

Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin

Differential Revision: http://reviews.llvm.org/D10969

llvm-svn: 247683
  • Loading branch information
dsandersllvm committed Sep 15, 2015
1 parent 1395253 commit 18d4b0d
Show file tree
Hide file tree
Showing 114 changed files with 1,297 additions and 506 deletions.
4 changes: 2 additions & 2 deletions clang/lib/Parse/ParseStmtAsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
std::unique_ptr<llvm::MCTargetAsmParser> TargetParser(
TheTarget->createMCAsmParser(*STI, *Parser, *MII, MCOptions));

std::unique_ptr<llvm::MCInstPrinter> IP(
TheTarget->createMCInstPrinter(llvm::Triple(TT), 1, *MAI, *MII, *MRI));
std::unique_ptr<llvm::MCInstPrinter> IP(TheTarget->createMCInstPrinter(
llvm::TargetTuple(llvm::Triple(TT)), 1, *MAI, *MII, *MRI));

// Change to the Intel dialect.
Parser->setAssemblerDialect(1);
Expand Down
11 changes: 6 additions & 5 deletions clang/tools/driver/cc1as_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
// FIXME: There is a bit of code duplication with addPassesToEmitFile.
if (Opts.OutputType == AssemblerInvocation::FT_Asm) {
MCInstPrinter *IP = TheTarget->createMCInstPrinter(
llvm::Triple(Opts.Triple), Opts.OutputAsmVariant, *MAI, *MCII, *MRI);
llvm::TargetTuple(llvm::Triple(Opts.Triple)), Opts.OutputAsmVariant,
*MAI, *MCII, *MRI);
MCCodeEmitter *CE = nullptr;
MCAsmBackend *MAB = nullptr;
if (Opts.ShowEncoding) {
Expand All @@ -382,10 +383,10 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, Ctx);
MCAsmBackend *MAB = TheTarget->createMCAsmBackend(*MRI, Opts.Triple,
Opts.CPU);
Triple T(Opts.Triple);
Str.reset(TheTarget->createMCObjectStreamer(T, Ctx, *MAB, *Out, CE, *STI,
Opts.RelaxAll,
/*DWARFMustBeAtTheEnd*/ true));
Triple TT(Opts.Triple);
Str.reset(TheTarget->createMCObjectStreamer(
llvm::TargetTuple(TT), Ctx, *MAB, *Out, CE, *STI, Opts.RelaxAll,
/*DWARFMustBeAtTheEnd*/ true));
Str.get()->InitSections(Opts.NoExecStack);
}

Expand Down
Loading

0 comments on commit 18d4b0d

Please sign in to comment.