summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-11-19 08:59:28 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-11-19 08:59:28 +0000
commit02fb33730c346d6a785d935d7aba9af93ba51da6 (patch)
treebc7d702d3d7f66d1e9083201cc8327bc0d06a450 /tools
parentd2e985fd323c167e20f77b045a1d99ad166e65db (diff)
downloadFreeBSD-src-02fb33730c346d6a785d935d7aba9af93ba51da6.zip
FreeBSD-src-02fb33730c346d6a785d935d7aba9af93ba51da6.tar.gz
Update LLVM to r89337.
Diffstat (limited to 'tools')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp3
-rw-r--r--tools/lto/LTOModule.cpp25
-rw-r--r--tools/lto/LTOModule.h2
3 files changed, 5 insertions, 25 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index eb82f98..0b9cb29 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -305,7 +305,8 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg)
}
// construct LTModule, hand over ownership of module and target
- std::string FeatureStr = getFeatureString(Triple.c_str());
+ const std::string FeatureStr =
+ SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple));
_target = march->createTargetMachine(Triple, FeatureStr);
}
return false;
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp
index e1cf48d..bce4162 100644
--- a/tools/lto/LTOModule.cpp
+++ b/tools/lto/LTOModule.cpp
@@ -19,6 +19,7 @@
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/ADT/OwningPtr.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Support/SystemUtils.h"
#include "llvm/Support/Mangler.h"
@@ -120,27 +121,6 @@ LTOModule* LTOModule::makeLTOModule(const void* mem, size_t length,
return makeLTOModule(buffer.get(), errMsg);
}
-/// getFeatureString - Return a string listing the features associated with the
-/// target triple.
-///
-/// FIXME: This is an inelegant way of specifying the features of a
-/// subtarget. It would be better if we could encode this information into the
-/// IR. See <rdar://5972456>.
-std::string getFeatureString(const char *TargetTriple) {
- InitializeAllTargets();
-
- SubtargetFeatures Features;
-
- if (strncmp(TargetTriple, "powerpc-apple-", 14) == 0) {
- Features.AddFeature("altivec", true);
- } else if (strncmp(TargetTriple, "powerpc64-apple-", 16) == 0) {
- Features.AddFeature("64bit", true);
- Features.AddFeature("altivec", true);
- }
-
- return Features.getString();
-}
-
LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer,
std::string& errMsg)
{
@@ -161,7 +141,8 @@ LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer,
return NULL;
// construct LTModule, hand over ownership of module and target
- std::string FeatureStr = getFeatureString(Triple.c_str());
+ const std::string FeatureStr =
+ SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple));
TargetMachine* target = march->createTargetMachine(Triple, FeatureStr);
return new LTOModule(m.take(), target);
}
diff --git a/tools/lto/LTOModule.h b/tools/lto/LTOModule.h
index 8fd3915..4019e01 100644
--- a/tools/lto/LTOModule.h
+++ b/tools/lto/LTOModule.h
@@ -107,7 +107,5 @@ private:
llvm::StringMap<NameAndAttributes> _undefines;
};
-extern std::string getFeatureString(const char *TargetTriple);
-
#endif // LTO_MODULE_H
OpenPOWER on IntegriCloud