Fix broken assertion. Didn't allow for pointer case
authorChris Lattner <sabre@nondot.org>
Mon, 29 Oct 2001 17:27:38 +0000 (17:27 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Oct 2001 17:27:38 +0000 (17:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1034 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/TraceValues.cpp

index 66f381e4698d81570a8aecd0df08471151014e6a..3547b298c16e1062996e63f7af6b706962d131a5 100644 (file)
@@ -60,7 +60,6 @@ PrintMethodNameForType(const Type* type)
     case Type::FloatTyID:   return "printFloat";
     case Type::DoubleTyID:  return "printDouble";
     case Type::PointerTyID: return "printPointer";
-    case Type::MethodTyID:  return "printPointer";
     default:
       assert(0 && "Unsupported type for printing");
       return NULL;
@@ -270,11 +269,9 @@ InsertPrintInsts(Value *Val,
 {
   const Type* ValTy = Val->getType();
   
-  assert(ValTy->isPrimitiveType() &&
-         ValTy->getPrimitiveID() != Type::VoidTyID &&
-         ValTy->getPrimitiveID() != Type::TypeTyID &&
-         ValTy->getPrimitiveID() != Type::LabelTyID && 
-         "Unsupported type for printing");
+  assert((ValTy->isPrimitiveType() || isa<PointerType>(ValTy)) &&
+         ValTy != Type::VoidTy && ValTy != Type::TypeTy &&
+         ValTy != Type::LabelTy && "Unsupported type for printing");
   
   const Value* scopeToUse = 
     isMethodExit ? (const Value*)BB->getParent() : (const Value*)BB;