[llvm-commits] [llvm] r46863 - /llvm/trunk/tools/lto/lto.cpp
Devang Patel
dpatel at apple.com
Thu Feb 7 14:32:50 PST 2008
Author: dpatel
Date: Thu Feb 7 16:32:50 2008
New Revision: 46863
URL: http://llvm.org/viewvc/llvm-project?rev=46863&view=rev
Log:
Begin setting features for target based on target triple string.
Modified:
llvm/trunk/tools/lto/lto.cpp
Modified: llvm/trunk/tools/lto/lto.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=46863&r1=46862&r2=46863&view=diff
==============================================================================
--- llvm/trunk/tools/lto/lto.cpp (original)
+++ llvm/trunk/tools/lto/lto.cpp Thu Feb 7 16:32:50 2008
@@ -247,8 +247,19 @@
return;
// Create target
- std::string Features;
- Target = March->CtorFn(*M, Features);
+ SubtargetFeatures Features;
+ std::string FeatureStr;
+ std::string TargetTriple = M->getTargetTriple();
+
+ if (strncmp(TargetTriple.c_str(), "powerpc-apple-", 14) == 0)
+ Features.AddFeature("altivec", true);
+ else if (strncmp(TargetTriple.c_str(), "powerpc64-apple-", 16) == 0) {
+ Features.AddFeature("64bit", true);
+ Features.AddFeature("altivec", true);
+ }
+
+ FeatureStr = Features.getString();
+ Target = March->CtorFn(*M, FeatureStr);
}
/// Optimize module M using various IPO passes. Use exportList to
More information about the llvm-commits
mailing list