Casting NULL can cause problems so lets just not cast NULL to anything.
authorNick Hildenbrandt <hldnbrnd@uiuc.edu>
Mon, 28 Oct 2002 19:54:06 +0000 (19:54 +0000)
committerNick Hildenbrandt <hldnbrnd@uiuc.edu>
Mon, 28 Oct 2002 19:54:06 +0000 (19:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4349 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index 196281f6e85e261e108418bb9ab6176b2d80a51f..1922e6fd26548471415f71593198aa3e8d627581 100644 (file)
@@ -426,9 +426,7 @@ void CWriter::printConstant(Constant *CPV) {
 
   case Type::PointerTyID:
     if (isa<ConstantPointerNull>(CPV)) {
-      Out << "((";
-      printType(CPV->getType(), "");
-      Out << ")NULL)";
+      Out << "(NULL)";
       break;
     } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CPV)) {
       writeOperand(CPR->getValue());
index 196281f6e85e261e108418bb9ab6176b2d80a51f..1922e6fd26548471415f71593198aa3e8d627581 100644 (file)
@@ -426,9 +426,7 @@ void CWriter::printConstant(Constant *CPV) {
 
   case Type::PointerTyID:
     if (isa<ConstantPointerNull>(CPV)) {
-      Out << "((";
-      printType(CPV->getType(), "");
-      Out << ")NULL)";
+      Out << "(NULL)";
       break;
     } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CPV)) {
       writeOperand(CPR->getValue());