aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-14 03:02:37 +0000
committerChris Lattner <sabre@nondot.org>2009-09-14 03:02:37 +0000
commit90edac0e8b35f766599362b6301863229f0ddcdb (patch)
treeec0c825951d3cdd2acfad8d4701eb20771d5a6b9 /tools
parentdb5fe936db5e718ec6189f969749444ecdc1c484 (diff)
downloadexternal_llvm-90edac0e8b35f766599362b6301863229f0ddcdb.zip
external_llvm-90edac0e8b35f766599362b6301863229f0ddcdb.tar.gz
external_llvm-90edac0e8b35f766599362b6301863229f0ddcdb.tar.bz2
Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track of registered MCInstPrinters. llvm-mc is still linking in the entire target foo to get the code emitter stuff, but this is an important step in the right direction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index e5d99be..fad1dd1 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -12,13 +12,13 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/MC/MCAsmLexer.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCCodeEmitter.h"
+#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h"
-#include "llvm/MC/MCAsmLexer.h"
#include "llvm/ADT/OwningPtr.h"
-#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/ManagedStatic.h"
@@ -29,6 +29,7 @@
#include "llvm/System/Signals.h"
#include "llvm/Target/TargetAsmParser.h"
#include "llvm/Target/TargetRegistry.h"
+#include "llvm/Target/TargetMachine.h" // FIXME.
#include "llvm/Target/TargetSelect.h"
#include "AsmParser.h"
using namespace llvm;
@@ -243,7 +244,7 @@ static int AssembleInput(const char *ProgName) {
return 1;
}
- OwningPtr<AsmPrinter> AP;
+ OwningPtr<MCInstPrinter> IP;
OwningPtr<MCCodeEmitter> CE;
OwningPtr<MCStreamer> Str;
@@ -251,10 +252,12 @@ static int AssembleInput(const char *ProgName) {
assert(MAI && "Unable to create target asm info!");
if (FileType == OFT_AssemblyFile) {
- AP.reset(TheTarget->createAsmPrinter(*Out, *TM, MAI, true));
+ // FIXME: Syntax Variant should be selectable somehow?
+ unsigned SyntaxVariant = 0;
+ IP.reset(TheTarget->createMCInstPrinter(SyntaxVariant, *MAI, *Out));
if (ShowEncoding)
CE.reset(TheTarget->createCodeEmitter(*TM));
- Str.reset(createAsmStreamer(Ctx, *Out, *MAI, AP.get(), CE.get()));
+ Str.reset(createAsmStreamer(Ctx, *Out, *MAI, IP.get(), CE.get()));
} else {
assert(FileType == OFT_ObjectFile && "Invalid file type!");
CE.reset(TheTarget->createCodeEmitter(*TM));