#include "llvm/ADT/Triple.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
#include <cassert>
#include <cstring>
}
void Triple::setArchName(const StringRef &Str) {
- // Work around a miscompilation bug in gcc 4.0.3.
- Twine a = getVendorName() + "-" + getOSAndEnvironmentName();
- Twine b = Str + "-" + a;
- setTriple(b);
+ // Work around a miscompilation bug for Twines in gcc 4.0.3.
+ SmallString<64> Triple;
+ Triple += Str;
+ Triple += "-";
+ Triple += getVendorName();
+ Triple += "-";
+ Triple += getOSAndEnvironmentName();
+ setTriple(Triple.str());
}
void Triple::setVendorName(const StringRef &Str) {