Match createTargetMachine API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135469 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2011-07-19 06:37:41 +00:00
Родитель cb2a07e337
Коммит 2860e30d83
3 изменённых файлов: 15 добавлений и 11 удалений

Просмотреть файл

@ -236,16 +236,6 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
TargetMachine::setFunctionSections(CodeGenOpts.FunctionSections);
TargetMachine::setDataSections (CodeGenOpts.DataSections);
// FIXME: Parse this earlier.
if (CodeGenOpts.RelocationModel == "static") {
TargetMachine::setRelocationModel(llvm::Reloc::Static);
} else if (CodeGenOpts.RelocationModel == "pic") {
TargetMachine::setRelocationModel(llvm::Reloc::PIC_);
} else {
assert(CodeGenOpts.RelocationModel == "dynamic-no-pic" &&
"Invalid PIC model!");
TargetMachine::setRelocationModel(llvm::Reloc::DynamicNoPIC);
}
// FIXME: Parse this earlier.
if (CodeGenOpts.CodeModel == "small") {
TargetMachine::setCodeModel(llvm::CodeModel::Small);
@ -287,8 +277,20 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
Features.AddFeature(*it);
FeaturesStr = Features.getString();
}
llvm::Reloc::Model RM = llvm::Reloc::Default;
if (CodeGenOpts.RelocationModel == "static") {
RM = llvm::Reloc::Static;
} else if (CodeGenOpts.RelocationModel == "pic") {
RM = llvm::Reloc::PIC_;
} else {
assert(CodeGenOpts.RelocationModel == "dynamic-no-pic" &&
"Invalid PIC model!");
RM = llvm::Reloc::DynamicNoPIC;
}
TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU,
FeaturesStr);
FeaturesStr, RM);
if (CodeGenOpts.RelaxAll)
TM->setMCRelaxAll(true);

Просмотреть файл

@ -127,6 +127,7 @@ int cc1_main(const char **ArgBegin, const char **ArgEnd,
// Initialize targets first, so that --version shows registered targets.
llvm::InitializeAllTargets();
llvm::InitializeAllMCAsmInfos();
llvm::InitializeAllMCCodeGenInfos();
llvm::InitializeAllMCSubtargetInfos();
llvm::InitializeAllAsmPrinters();
llvm::InitializeAllAsmParsers();

Просмотреть файл

@ -361,6 +361,7 @@ int cc1as_main(const char **ArgBegin, const char **ArgEnd,
// FIXME: We shouldn't need to initialize the Target(Machine)s.
InitializeAllTargets();
InitializeAllMCAsmInfos();
InitializeAllMCCodeGenInfos();
InitializeAllMCInstrInfos();
InitializeAllMCRegisterInfos();
InitializeAllMCSubtargetInfos();