diff options
author | Devang Patel <dpatel@apple.com> | 2008-02-07 22:32:50 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-02-07 22:32:50 +0000 |
commit | 5252ae6ecad11b578e9bc61806670494efd439c8 (patch) | |
tree | e152f0705234612ac649a5784c35837ddceb9a73 /tools | |
parent | 27240c7d5095857baaf66cc9496a68a2100e565f (diff) | |
download | external_llvm-5252ae6ecad11b578e9bc61806670494efd439c8.zip external_llvm-5252ae6ecad11b578e9bc61806670494efd439c8.tar.gz external_llvm-5252ae6ecad11b578e9bc61806670494efd439c8.tar.bz2 |
Begin setting features for target based on target triple string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lto/lto.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index b330af1..71bd9e6 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -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 |