aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-16 04:25:29 +0000
committerChris Lattner <sabre@nondot.org>2008-06-16 04:25:29 +0000
commitab6d338e1a80d5b1bf7c2cd7a8a40a5ef1198493 (patch)
treec4ea8a30d50b1eb2a3d323a8fd828c9a2496cf7b
parent1aa9aa3f5e2b5165be2413acca6775d03fc526ec (diff)
downloadexternal_llvm-ab6d338e1a80d5b1bf7c2cd7a8a40a5ef1198493.zip
external_llvm-ab6d338e1a80d5b1bf7c2cd7a8a40a5ef1198493.tar.gz
external_llvm-ab6d338e1a80d5b1bf7c2cd7a8a40a5ef1198493.tar.bz2
Switch from generating the int128 typedefs based on targetdata to generating
them based on the end-compiler's capabilities. This fixes PR2453 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52297 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/CBackend/CBackend.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 6829218..2e9902d 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -1517,12 +1517,10 @@ static void generateCompilerSpecificCode(std::ostream& Out,
// 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";