diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-11-19 08:59:28 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-11-19 08:59:28 +0000 |
commit | 02fb33730c346d6a785d935d7aba9af93ba51da6 (patch) | |
tree | bc7d702d3d7f66d1e9083201cc8327bc0d06a450 /lib/Target/SubtargetFeature.cpp | |
parent | d2e985fd323c167e20f77b045a1d99ad166e65db (diff) | |
download | FreeBSD-src-02fb33730c346d6a785d935d7aba9af93ba51da6.zip FreeBSD-src-02fb33730c346d6a785d935d7aba9af93ba51da6.tar.gz |
Update LLVM to r89337.
Diffstat (limited to 'lib/Target/SubtargetFeature.cpp')
-rw-r--r-- | lib/Target/SubtargetFeature.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Target/SubtargetFeature.cpp b/lib/Target/SubtargetFeature.cpp index 664a43c..590574e 100644 --- a/lib/Target/SubtargetFeature.cpp +++ b/lib/Target/SubtargetFeature.cpp @@ -357,3 +357,30 @@ void SubtargetFeatures::print(raw_ostream &OS) const { void SubtargetFeatures::dump() const { print(errs()); } + +/// getDefaultSubtargetFeatures - Return a string listing +/// the features associated with the target triple. +/// +/// FIXME: This is an inelegant way of specifying the features of a +/// subtarget. It would be better if we could encode this information +/// into the IR. See <rdar://5972456>. +/// +std::string SubtargetFeatures::getDefaultSubtargetFeatures( + const Triple& Triple) { + switch (Triple.getVendor()) { + case Triple::Apple: + switch (Triple.getArch()) { + case Triple::ppc: // powerpc-apple-* + return std::string("altivec"); + case Triple::ppc64: // powerpc64-apple-* + return std::string("64bit,altivec"); + default: + break; + } + break; + default: + break; + } + + return std::string(""); +} |