diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-05-11 00:30:02 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-05-11 00:30:02 +0000 |
commit | 81043ee5dc4cca470db8d45e080ba0a38efbffc2 (patch) | |
tree | 1eb46a731b61748f345af8a66850350ae248fd48 /tools/lto | |
parent | 31b9c44cc13bb686010cf6bfbeef8745c39939b9 (diff) | |
download | external_llvm-81043ee5dc4cca470db8d45e080ba0a38efbffc2.zip external_llvm-81043ee5dc4cca470db8d45e080ba0a38efbffc2.tar.gz external_llvm-81043ee5dc4cca470db8d45e080ba0a38efbffc2.tar.bz2 |
The getDefaultSubtargetFeatures method of SubtargetFeature did actually return a
string of features for that target. However LTO was using that string to pass
into the "create target machine" stuff. That stuff needed the feature string to
be in a particular form. In particular, it needed the CPU specified first and
then the attributes. If there isn't a CPU specified, it required it to be blank
-- e.g., ",+altivec". Yuck.
Modify the getDefaultSubtargetFeatures method to be a non-static member
function. For all attributes for a specific subtarget, it will add them in like
normal. It will also take a CPU string so that it can satisfy this horrible
syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 5 | ||||
-rw-r--r-- | tools/lto/LTOModule.cpp | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 1010592..59e8405 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -300,8 +300,9 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg) } // construct LTModule, hand over ownership of module and target - const std::string FeatureStr = - SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple)); + SubtargetFeatures Features; + Features.getDefaultSubtargetFeatures("" /* cpu */, llvm::Triple(Triple)); + std::string FeatureStr = Features.getString(); _target = march->createTargetMachine(Triple, FeatureStr); } return false; diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index b269e78..0870205 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -140,8 +140,9 @@ LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer, return NULL; // construct LTModule, hand over ownership of module and target - const std::string FeatureStr = - SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple)); + SubtargetFeatures Features; + Features.getDefaultSubtargetFeatures("" /* cpu */, llvm::Triple(Triple)); + std::string FeatureStr = Features.getString(); TargetMachine* target = march->createTargetMachine(Triple, FeatureStr); return new LTOModule(m.take(), target); } |