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 | a12c1ff25a2d85c01979ff1ccdb87874812e3624 (patch) | |
tree | bc2319984cf50b75fdcfcf5768df0b340e98cba7 /llvm/tools/lto/LTOCodeGenerator.cpp | |
parent | 1ef066083617570b4284018b9b0257ab2b5a6590 (diff) | |
download | bcm5719-llvm-a12c1ff25a2d85c01979ff1ccdb87874812e3624.tar.gz bcm5719-llvm-a12c1ff25a2d85c01979ff1ccdb87874812e3624.zip |
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.
llvm-svn: 103451
Diffstat (limited to 'llvm/tools/lto/LTOCodeGenerator.cpp')
-rw-r--r-- | llvm/tools/lto/LTOCodeGenerator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp index 10105921c4e..59e8405e7ec 100644 --- a/llvm/tools/lto/LTOCodeGenerator.cpp +++ b/llvm/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; |