Begin setting features for target based on target triple string.

llvm-svn: 46863
This commit is contained in:
Devang Patel 2008-02-07 22:32:50 +00:00
parent 6a80462568
commit eef348687e

View File

@ -247,8 +247,19 @@ LTO::getTarget (Module *M) {
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