mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 11:39:35 +00:00
Begin setting features for target based on target triple string.
llvm-svn: 46863
This commit is contained in:
parent
6a80462568
commit
eef348687e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user