[cfe-commits] r134885 - /cfe/trunk/tools/driver/cc1as_main.cpp
Evan Cheng
evan.cheng at apple.com
Sun Jul 10 21:24:19 PDT 2011
Author: evancheng
Date: Sun Jul 10 23:24:19 2011
New Revision: 134885
URL: http://llvm.org/viewvc/llvm-project?rev=134885&view=rev
Log:
Match createCodeEmitter change.
Modified:
cfe/trunk/tools/driver/cc1as_main.cpp
Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=134885&r1=134884&r2=134885&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Sun Jul 10 23:24:19 2011
@@ -29,6 +29,7 @@
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/CommandLine.h"
@@ -48,11 +49,13 @@
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetAsmParser.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/TargetSelect.h"
+#include "llvm/Target/TargetSubtargetInfo.h"
using namespace clang;
using namespace clang::driver;
using namespace llvm;
@@ -280,6 +283,8 @@
TM->getTargetLowering()->getObjFileLowering();
const_cast<TargetLoweringObjectFile&>(TLOF).Initialize(Ctx, *TM);
+ const MCSubtargetInfo &STI = TM->getSubtarget<MCSubtargetInfo>();
+
// FIXME: There is a bit of code duplication with addPassesToEmitFile.
if (Opts.OutputType == AssemblerInvocation::FT_Asm) {
MCInstPrinter *IP =
@@ -287,7 +292,7 @@
MCCodeEmitter *CE = 0;
TargetAsmBackend *TAB = 0;
if (Opts.ShowEncoding) {
- CE = TheTarget->createCodeEmitter(*TM, Ctx);
+ CE = TheTarget->createCodeEmitter(*TM->getInstrInfo(), STI, Ctx);
TAB = TheTarget->createAsmBackend(Opts.Triple);
}
Str.reset(TheTarget->createAsmStreamer(Ctx, *Out, /*asmverbose*/true,
@@ -299,7 +304,8 @@
} else {
assert(Opts.OutputType == AssemblerInvocation::FT_Obj &&
"Invalid file type!");
- MCCodeEmitter *CE = TheTarget->createCodeEmitter(*TM, Ctx);
+ MCCodeEmitter *CE = TheTarget->createCodeEmitter(*TM->getInstrInfo(),
+ STI, Ctx);
TargetAsmBackend *TAB = TheTarget->createAsmBackend(Opts.Triple);
Str.reset(TheTarget->createObjectStreamer(Opts.Triple, Ctx, *TAB, *Out,
CE, Opts.RelaxAll,
@@ -309,11 +315,8 @@
OwningPtr<MCAsmParser> Parser(createMCAsmParser(*TheTarget, SrcMgr, Ctx,
*Str.get(), *MAI));
- OwningPtr<MCSubtargetInfo>
- STI(TheTarget->createMCSubtargetInfo(TM->getTargetTriple(),
- TM->getTargetCPU(),
- TM->getTargetFeatureString()));
- OwningPtr<TargetAsmParser> TAP(TheTarget->createAsmParser(*STI, *Parser));
+ OwningPtr<TargetAsmParser>
+ TAP(TheTarget->createAsmParser(const_cast<MCSubtargetInfo&>(STI), *Parser));
if (!TAP) {
Diags.Report(diag::err_target_unknown_triple) << Opts.Triple;
return false;
@@ -353,6 +356,7 @@
InitializeAllTargetInfos();
// FIXME: We shouldn't need to initialize the Target(Machine)s.
InitializeAllTargets();
+ InitializeAllMCInstrInfos();
InitializeAllMCSubtargetInfos();
InitializeAllAsmPrinters();
InitializeAllAsmParsers();
More information about the cfe-commits
mailing list