mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 07:31:53 +00:00
Fix bug: CBackend/2003-06-01-NullPointerType.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6526 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
71799cda17
commit
cf135cbc77
@ -435,7 +435,9 @@ void CWriter::printConstant(Constant *CPV) {
|
||||
|
||||
case Type::PointerTyID:
|
||||
if (isa<ConstantPointerNull>(CPV)) {
|
||||
Out << "(NULL)";
|
||||
Out << "((";
|
||||
printType(Out, CPV->getType());
|
||||
Out << ")/*NULL*/0)";
|
||||
break;
|
||||
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CPV)) {
|
||||
writeOperand(CPR->getValue());
|
||||
@ -545,9 +547,8 @@ void CWriter::printModule(Module *M) {
|
||||
Out << "#include <stdarg.h>\n";
|
||||
Out << "#include <setjmp.h>\n";
|
||||
|
||||
// Provide a definition for null if one does not already exist,
|
||||
// and for `bool' if not compiling with a C++ compiler.
|
||||
Out << "#ifndef NULL\n#define NULL 0\n#endif\n\n"
|
||||
// Provide a definition for `bool' if not compiling with a C++ compiler.
|
||||
Out << "\n"
|
||||
<< "#ifndef __cplusplus\ntypedef unsigned char bool;\n#endif\n"
|
||||
|
||||
<< "\n\n/* Support for floating point constants */\n"
|
||||
|
@ -435,7 +435,9 @@ void CWriter::printConstant(Constant *CPV) {
|
||||
|
||||
case Type::PointerTyID:
|
||||
if (isa<ConstantPointerNull>(CPV)) {
|
||||
Out << "(NULL)";
|
||||
Out << "((";
|
||||
printType(Out, CPV->getType());
|
||||
Out << ")/*NULL*/0)";
|
||||
break;
|
||||
} else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CPV)) {
|
||||
writeOperand(CPR->getValue());
|
||||
@ -545,9 +547,8 @@ void CWriter::printModule(Module *M) {
|
||||
Out << "#include <stdarg.h>\n";
|
||||
Out << "#include <setjmp.h>\n";
|
||||
|
||||
// Provide a definition for null if one does not already exist,
|
||||
// and for `bool' if not compiling with a C++ compiler.
|
||||
Out << "#ifndef NULL\n#define NULL 0\n#endif\n\n"
|
||||
// Provide a definition for `bool' if not compiling with a C++ compiler.
|
||||
Out << "\n"
|
||||
<< "#ifndef __cplusplus\ntypedef unsigned char bool;\n#endif\n"
|
||||
|
||||
<< "\n\n/* Support for floating point constants */\n"
|
||||
|
Loading…
Reference in New Issue
Block a user