[llvm-commits] [llvm] r52297 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp
Chris Lattner
sabre at nondot.org
Sun Jun 15 21:25:29 PDT 2008
Author: lattner
Date: Sun Jun 15 23:25:29 2008
New Revision: 52297
URL: http://llvm.org/viewvc/llvm-project?rev=52297&view=rev
Log:
Switch from generating the int128 typedefs based on targetdata to generating
them based on the end-compiler's capabilities. This fixes PR2453
Modified:
llvm/trunk/lib/Target/CBackend/CBackend.cpp
Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=52297&r1=52296&r2=52297&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Sun Jun 15 23:25:29 2008
@@ -1517,12 +1517,10 @@
// Output typedefs for 128-bit integers. If these are needed with a
// 32-bit target or with a C compiler that doesn't support mode(TI),
// more drastic measures will be needed.
- if (TD->getPointerSize() >= 8) {
- Out << "#ifdef __GNUC__ /* 128-bit integer types */\n"
- << "typedef int __attribute__((mode(TI))) llvmInt128;\n"
- << "typedef unsigned __attribute__((mode(TI))) llvmUInt128;\n"
- << "#endif\n\n";
- }
+ Out << "#if __GNUC__ && __LP64__ /* 128-bit integer types */\n"
+ << "typedef int __attribute__((mode(TI))) llvmInt128;\n"
+ << "typedef unsigned __attribute__((mode(TI))) llvmUInt128;\n"
+ << "#endif\n\n";
// Output target-specific code that should be inserted into main.
Out << "#define CODE_FOR_MAIN() /* Any target-specific code for main()*/\n";
More information about the llvm-commits
mailing list