summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-20 19:50:42 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-20 19:50:42 +0000
commitbbf3b0de8bedf01b0c5f162b25e9ee4ad0416df3 (patch)
tree1fde8debdd48103cfb187c74ff5a115f94a8c8d8 /llvm/tools
parent81383c20e4c6aa506842397c53112eee7ed8efb0 (diff)
downloadbcm5719-llvm-bbf3b0de8bedf01b0c5f162b25e9ee4ad0416df3.tar.gz
bcm5719-llvm-bbf3b0de8bedf01b0c5f162b25e9ee4ad0416df3.zip
Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.
There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. llvm-svn: 135611
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp29
-rw-r--r--llvm/tools/lto/LTOCodeGenerator.cpp3
-rw-r--r--llvm/tools/lto/LTOModule.cpp3
3 files changed, 4 insertions, 31 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index 092c3637211..f365972561d 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
@@ -28,10 +28,6 @@
#include "llvm/Target/TargetAsmParser.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetRegistry.h"
-#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"
#include "llvm/Support/CommandLine.h"
@@ -348,28 +344,11 @@ static int AssembleInput(const char *ProgName) {
// Package up features to be passed to target/subtarget
std::string FeaturesStr;
- // FIXME: We shouldn't need to do this (and link in codegen).
- // When we split this out, we should do it in a way that makes
- // it straightforward to switch subtargets on the fly (.e.g,
- // the .cpu and .code16 directives).
- OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName,
- MCPU,
- FeaturesStr,
- RelocModel,
- CMModel));
-
- if (!TM) {
- errs() << ProgName << ": error: could not create target for triple '"
- << TripleName << "'.\n";
- return 1;
- }
-
- const TargetAsmInfo *tai = new TargetAsmInfo(*TM);
// FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and
// MCObjectFileInfo needs a MCContext reference in order to initialize itself.
OwningPtr<MCObjectFileInfo> MOFI(new MCObjectFileInfo());
- MCContext Ctx(*MAI, *MRI, MOFI.get(), tai);
- MOFI->InitMCObjectFileInfo(TripleName, RelocModel, Ctx);
+ MCContext Ctx(*MAI, *MRI, MOFI.get());
+ MOFI->InitMCObjectFileInfo(TripleName, RelocModel, CMModel, Ctx);
if (SaveTempLabels)
Ctx.setAllowTemporaryLabels(false);
@@ -381,10 +360,6 @@ 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);
-
OwningPtr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
OwningPtr<MCSubtargetInfo>
STI(TheTarget->createMCSubtargetInfo(TripleName, MCPU, FeaturesStr));
diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp
index 2f02847e77c..a3a468ed8df 100644
--- a/llvm/tools/lto/LTOCodeGenerator.cpp
+++ b/llvm/tools/lto/LTOCodeGenerator.cpp
@@ -313,8 +313,7 @@ void LTOCodeGenerator::applyScopeRestrictions() {
passes.add(createVerifierPass());
// mark which symbols can not be internalized
- MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(),
- NULL, NULL);
+ MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(), NULL);
Mangler mangler(Context, *_target->getTargetData());
std::vector<const char*> mustPreserveList;
SmallPtrSet<GlobalValue*, 8> asmUsed;
diff --git a/llvm/tools/lto/LTOModule.cpp b/llvm/tools/lto/LTOModule.cpp
index 661674c8b2e..981c9f7a51f 100644
--- a/llvm/tools/lto/LTOModule.cpp
+++ b/llvm/tools/lto/LTOModule.cpp
@@ -664,8 +664,7 @@ static bool isAliasToDeclaration(const GlobalAlias &V) {
bool LTOModule::ParseSymbols() {
// Use mangler to add GlobalPrefix to names to match linker names.
- MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(),
- NULL, NULL);
+ MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(),NULL);
Mangler mangler(Context, *_target->getTargetData());
// add functions
OpenPOWER on IntegriCloud