aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-mc/llvm-mc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index 1d42c4666a..46eb3727d6 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -24,9 +24,6 @@
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/SubtargetFeature.h" // FIXME.
-#include "llvm/Target/TargetAsmInfo.h" // FIXME.
-#include "llvm/Target/TargetLowering.h" // FIXME.
-#include "llvm/Target/TargetLoweringObjectFile.h" // FIXME.
#include "llvm/Target/TargetMachine.h" // FIXME.
#include "llvm/Target/TargetSelect.h"
#include "llvm/ADT/OwningPtr.h"
@@ -301,6 +298,8 @@ static int AssembleInput(const char *ProgName) {
llvm::OwningPtr<MCAsmInfo> MAI(TheTarget->createAsmInfo(TripleName));
assert(MAI && "Unable to create target asm info!");
+ MCContext Ctx(*MAI);
+
// Package up features to be passed to target/subtarget
std::string FeaturesStr;
if (MCPU.size()) {
@@ -322,9 +321,6 @@ static int AssembleInput(const char *ProgName) {
return 1;
}
- const TargetAsmInfo tai(*TM);
- MCContext Ctx(*MAI, &tai);
-
OwningPtr<tool_output_file> Out(GetOutputStream());
if (!Out)
return 1;
@@ -332,18 +328,15 @@ static int AssembleInput(const char *ProgName) {
formatted_raw_ostream FOS(Out->os());
OwningPtr<MCStreamer> Str;
- const TargetLoweringObjectFile &TLOF =
- TM->getTargetLowering()->getObjFileLowering();
- const_cast<TargetLoweringObjectFile&>(TLOF).Initialize(Ctx, *TM);
-
if (FileType == OFT_AssemblyFile) {
MCInstPrinter *IP =
TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI);
MCCodeEmitter *CE = 0;
if (ShowEncoding)
CE = TheTarget->createCodeEmitter(*TM, Ctx);
- Str.reset(TheTarget->createAsmStreamer(Ctx, FOS, /*asmverbose*/true,
- /*useLoc*/ true, IP, CE, ShowInst));
+ Str.reset(TheTarget->createAsmStreamer(Ctx, FOS,
+ TM->getTargetData()->isLittleEndian(),
+ /*asmverbose*/true, IP, CE, ShowInst));
} else if (FileType == OFT_Null) {
Str.reset(createNullStreamer(Ctx));
} else {