summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-20 05:58:47 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-20 05:58:47 +0000
commit76792992d66dc45c34fb28943c45a47a38d25c40 (patch)
tree061e869d07677a7eb47a1b76d37232c5286975f5 /llvm/tools
parent638b355a16adb909e0fbcfe3f382d9efd175df7f (diff)
downloadbcm5719-llvm-76792992d66dc45c34fb28943c45a47a38d25c40.tar.gz
bcm5719-llvm-76792992d66dc45c34fb28943c45a47a38d25c40.zip
Add MCObjectFileInfo and sink the MCSections initialization code from
TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! llvm-svn: 135569
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp9
-rw-r--r--llvm/tools/lto/LTOCodeGenerator.cpp2
-rw-r--r--llvm/tools/lto/LTOModule.cpp2
3 files changed, 10 insertions, 3 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index e2de05542b7..d930aea1e54 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
@@ -18,6 +18,8 @@
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCInstrInfo.h"
+#include "llvm/MC/MCObjectFileInfo.h"
+#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
@@ -346,7 +348,12 @@ static int AssembleInput(const char *ProgName) {
}
const TargetAsmInfo *tai = new TargetAsmInfo(*TM);
- MCContext Ctx(*MAI, *MRI, tai);
+ // 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);
+
if (SaveTempLabels)
Ctx.setAllowTemporaryLabels(false);
diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp
index 28cfa9cc750..2f02847e77c 100644
--- a/llvm/tools/lto/LTOCodeGenerator.cpp
+++ b/llvm/tools/lto/LTOCodeGenerator.cpp
@@ -314,7 +314,7 @@ void LTOCodeGenerator::applyScopeRestrictions() {
// mark which symbols can not be internalized
MCContext Context(*_target->getMCAsmInfo(), *_target->getRegisterInfo(),
- NULL);
+ NULL, 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 0ca96bc28ac..661674c8b2e 100644
--- a/llvm/tools/lto/LTOModule.cpp
+++ b/llvm/tools/lto/LTOModule.cpp
@@ -665,7 +665,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, NULL);
Mangler mangler(Context, *_target->getTargetData());
// add functions
OpenPOWER on IntegriCloud