summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2009-07-15 17:27:11 +0000
committerStuart Hastings <stuart@apple.com>2009-07-15 17:27:11 +0000
commit338191cd67a0a3e324c8b1475c975fed5ffa9e94 (patch)
treeeef241f50ca61beb5959953f38fdd29594a20597 /llvm/tools
parentc5928d2fad2313bf8e582fec74b2b9a385f350e7 (diff)
downloadbcm5719-llvm-338191cd67a0a3e324c8b1475c975fed5ffa9e94.tar.gz
bcm5719-llvm-338191cd67a0a3e324c8b1475c975fed5ffa9e94.zip
Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk. llvm-svn: 75799
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llc/llc.cpp23
-rw-r--r--llvm/tools/lto/LTOCodeGenerator.cpp8
-rw-r--r--llvm/tools/lto/LTOModule.cpp6
3 files changed, 16 insertions, 21 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 346e54706d2..9acfcd29000 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -128,8 +128,7 @@ GetFileNameRoot(const std::string &InputFilename) {
return outputFilename;
}
-static formatted_raw_ostream *GetOutputStream(const char *TargetName,
- const char *ProgName) {
+static formatted_raw_ostream *GetOutputStream(const char *ProgName) {
if (OutputFilename != "") {
if (OutputFilename == "-")
return &fouts();
@@ -170,10 +169,10 @@ static formatted_raw_ostream *GetOutputStream(const char *TargetName,
bool Binary = false;
switch (FileType) {
case TargetMachine::AssemblyFile:
- if (TargetName[0] == 'c') {
- if (TargetName[1] == 0)
+ if (MArch->Name[0] == 'c') {
+ if (MArch->Name[1] == 0)
OutputFilename += ".cbe.c";
- else if (TargetName[1] == 'p' && TargetName[2] == 'p')
+ else if (MArch->Name[1] == 'p' && MArch->Name[2] == 'p')
OutputFilename += ".cpp";
else
OutputFilename += ".s";
@@ -249,13 +248,10 @@ int main(int argc, char **argv) {
// Allocate target machine. First, check whether the user has
// explicitly specified an architecture to compile for.
- const Target *TheTarget;
- if (MArch) {
- TheTarget = &MArch->TheTarget;
- } else {
+ if (MArch == 0) {
std::string Err;
- TheTarget = TargetRegistry::getClosestStaticTargetForModule(mod, Err);
- if (TheTarget == 0) {
+ MArch = TargetMachineRegistry::getClosestStaticTargetForModule(mod, Err);
+ if (MArch == 0) {
errs() << argv[0] << ": error auto-selecting target for module '"
<< Err << "'. Please use the -march option to explicitly "
<< "pick a target.\n";
@@ -273,13 +269,12 @@ int main(int argc, char **argv) {
FeaturesStr = Features.getString();
}
- std::auto_ptr<TargetMachine>
- target(TheTarget->createTargetMachine(mod, FeaturesStr));
+ std::auto_ptr<TargetMachine> target(MArch->CtorFn(mod, FeaturesStr));
assert(target.get() && "Could not allocate target machine!");
TargetMachine &Target = *target.get();
// Figure out where we are going to send the output...
- formatted_raw_ostream *Out = GetOutputStream(TheTarget->getName(), argv[0]);
+ formatted_raw_ostream *Out = GetOutputStream(argv[0]);
if (Out == 0) return 1;
CodeGenOpt::Level OLvl = CodeGenOpt::Default;
diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp
index cb6c4ae6f5b..b4c4e7767b9 100644
--- a/llvm/tools/lto/LTOCodeGenerator.cpp
+++ b/llvm/tools/lto/LTOCodeGenerator.cpp
@@ -328,9 +328,9 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg)
if ( _target == NULL ) {
// create target machine from info for merged modules
Module* mergedModule = _linker.getModule();
- const Target *march =
- TargetRegistry::getClosestStaticTargetForModule(*mergedModule,
- errMsg);
+ const TargetMachineRegistry::entry* march =
+ TargetMachineRegistry::getClosestStaticTargetForModule(
+ *mergedModule, errMsg);
if ( march == NULL )
return true;
@@ -351,7 +351,7 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg)
// construct LTModule, hand over ownership of module and target
std::string FeatureStr =
getFeatureString(_linker.getModule()->getTargetTriple().c_str());
- _target = march->createTargetMachine(*mergedModule, FeatureStr.c_str());
+ _target = march->CtorFn(*mergedModule, FeatureStr.c_str());
}
return false;
}
diff --git a/llvm/tools/lto/LTOModule.cpp b/llvm/tools/lto/LTOModule.cpp
index be6543c8f7f..38ee1cc7a28 100644
--- a/llvm/tools/lto/LTOModule.cpp
+++ b/llvm/tools/lto/LTOModule.cpp
@@ -147,15 +147,15 @@ LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer,
if ( !m )
return NULL;
// find machine architecture for this module
- const Target* march =
- TargetRegistry::getClosestStaticTargetForModule(*m, errMsg);
+ const TargetMachineRegistry::entry* march =
+ TargetMachineRegistry::getClosestStaticTargetForModule(*m, errMsg);
if ( march == NULL )
return NULL;
// construct LTModule, hand over ownership of module and target
std::string FeatureStr = getFeatureString(m->getTargetTriple().c_str());
- TargetMachine* target = march->createTargetMachine(*m, FeatureStr);
+ TargetMachine* target = march->CtorFn(*m, FeatureStr);
return new LTOModule(m.take(), target);
}
OpenPOWER on IntegriCloud