[llvm-commits] [llvm-gcc-4.2] r79551 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Duncan Sands
baldrick at free.fr
Thu Aug 20 11:19:02 PDT 2009
Author: baldrick
Date: Thu Aug 20 13:19:02 2009
New Revision: 79551
URL: http://llvm.org/viewvc/llvm-project?rev=79551&view=rev
Log:
The target triple is already available in TargetTriple.
No need to recompute it.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=79551&r1=79550&r2=79551&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Thu Aug 20 13:19:02 2009
@@ -454,13 +454,12 @@
TheModule->setTargetTriple(TargetTriple);
TheTypeConverter = new TypeConverter();
-
+
// Create the TargetMachine we will be generating code with.
// FIXME: Figure out how to select the target and pass down subtarget info.
std::string Err;
- std::string Triple = TheModule->getTargetTriple();
const Target *TME =
- TargetRegistry::lookupTarget(Triple, Err);
+ TargetRegistry::lookupTarget(TargetTriple, Err);
if (!TME) {
cerr << "Did not get a target machine! Triplet is " << TargetTriple << '\n';
exit(1);
@@ -475,7 +474,7 @@
LLVM_SET_SUBTARGET_FEATURES(Features);
FeatureStr = Features.getString();
#endif
- TheTarget = TME->createTargetMachine(Triple, FeatureStr);
+ TheTarget = TME->createTargetMachine(TargetTriple, FeatureStr);
assert(TheTarget->getTargetData()->isBigEndian() == BYTES_BIG_ENDIAN);
TheFolder = new TargetFolder(TheTarget->getTargetData(), getGlobalContext());
More information about the llvm-commits
mailing list