aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Triple.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-10-06 17:25:50 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-10-06 17:25:50 +0000
commit92e3a06623077fceb781f66acfc691b26642c376 (patch)
tree8324a5077077ade09da88f1cc782679b6fde0b93 /llvm/lib/Support/Triple.cpp
parenta893f5bdf5efb294b1c7f3d6a33c34e561f24408 (diff)
downloadllvm-92e3a06623077fceb781f66acfc691b26642c376.zip
llvm-92e3a06623077fceb781f66acfc691b26642c376.tar.gz
llvm-92e3a06623077fceb781f66acfc691b26642c376.tar.bz2
Fix PR5112, a miscompilation on gcc-4.0.3. Patch by Collin Winter!
llvm-svn: 83391
Diffstat (limited to 'llvm/lib/Support/Triple.cpp')
-rw-r--r--llvm/lib/Support/Triple.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
index fc3b3f7..804769d 100644
--- a/llvm/lib/Support/Triple.cpp
+++ b/llvm/lib/Support/Triple.cpp
@@ -390,7 +390,10 @@ void Triple::setOS(OSType Kind) {
}
void Triple::setArchName(const StringRef &Str) {
- setTriple(Str + "-" + getVendorName() + "-" + getOSAndEnvironmentName());
+ // Work around a miscompilation bug in gcc 4.0.3.
+ Twine a = getVendorName() + "-" + getOSAndEnvironmentName();
+ Twine b = Str + "-" + a;
+ setTriple(b);
}
void Triple::setVendorName(const StringRef &Str) {