mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 15:51:54 +00:00
Suppress the 128-bit integer typedef on 32-bit targets, because
it causes compile errors. llvm-svn: 49122
This commit is contained in:
parent
ebfa6edc65
commit
5b2503097e
@ -1363,7 +1363,8 @@ void CWriter::writeOperandWithCast(Value* Operand, const ICmpInst &Cmp) {
|
|||||||
// generateCompilerSpecificCode - This is where we add conditional compilation
|
// generateCompilerSpecificCode - This is where we add conditional compilation
|
||||||
// directives to cater to specific compilers as need be.
|
// directives to cater to specific compilers as need be.
|
||||||
//
|
//
|
||||||
static void generateCompilerSpecificCode(std::ostream& Out) {
|
static void generateCompilerSpecificCode(std::ostream& Out,
|
||||||
|
const TargetData *TD) {
|
||||||
// Alloca is hard to get, and we don't want to include stdlib.h here.
|
// Alloca is hard to get, and we don't want to include stdlib.h here.
|
||||||
Out << "/* get a declaration for alloca */\n"
|
Out << "/* get a declaration for alloca */\n"
|
||||||
<< "#if defined(__CYGWIN__) || defined(__MINGW32__)\n"
|
<< "#if defined(__CYGWIN__) || defined(__MINGW32__)\n"
|
||||||
@ -1480,10 +1481,15 @@ static void generateCompilerSpecificCode(std::ostream& Out) {
|
|||||||
<< "#define __builtin_stack_restore(X) /* noop */\n"
|
<< "#define __builtin_stack_restore(X) /* noop */\n"
|
||||||
<< "#endif\n\n";
|
<< "#endif\n\n";
|
||||||
|
|
||||||
Out << "#ifdef __GNUC__ /* 128-bit integer types */\n"
|
// Output typedefs for 128-bit integers. If these are needed with a
|
||||||
<< "typedef int __attribute__((mode(TI))) llvmInt128;\n"
|
// 32-bit target or with a C compiler that doesn't support mode(TI),
|
||||||
<< "typedef unsigned __attribute__((mode(TI))) llvmUInt128;\n"
|
// more drastic measures will be needed.
|
||||||
<< "#endif\n\n";
|
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";
|
||||||
|
}
|
||||||
|
|
||||||
// Output target-specific code that should be inserted into main.
|
// Output target-specific code that should be inserted into main.
|
||||||
Out << "#define CODE_FOR_MAIN() /* Any target-specific code for main()*/\n";
|
Out << "#define CODE_FOR_MAIN() /* Any target-specific code for main()*/\n";
|
||||||
@ -1568,7 +1574,7 @@ bool CWriter::doInitialization(Module &M) {
|
|||||||
Out << "/* Provide Declarations */\n";
|
Out << "/* Provide Declarations */\n";
|
||||||
Out << "#include <stdarg.h>\n"; // Varargs support
|
Out << "#include <stdarg.h>\n"; // Varargs support
|
||||||
Out << "#include <setjmp.h>\n"; // Unwind support
|
Out << "#include <setjmp.h>\n"; // Unwind support
|
||||||
generateCompilerSpecificCode(Out);
|
generateCompilerSpecificCode(Out, TD);
|
||||||
|
|
||||||
// Provide a definition for `bool' if not compiling with a C++ compiler.
|
// Provide a definition for `bool' if not compiling with a C++ compiler.
|
||||||
Out << "\n"
|
Out << "\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user