Write constexpr casts using the cast X to Y notation, not using the implicit
authorChris Lattner <sabre@nondot.org>
Thu, 15 Aug 2002 19:37:43 +0000 (19:37 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 15 Aug 2002 19:37:43 +0000 (19:37 +0000)
type result

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3354 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index aeca6f7e21eacc883b2fe0a020bcef58feacbadd..465890858ff86538f02aed315911c60a9b827f77 100644 (file)
@@ -337,7 +337,7 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName,
     Out << CE->getOpcodeName();
 
     bool isGEP = CE->getOpcode() == Instruction::GetElementPtr;
-    Out << (isGEP? " (" : " ");
+    Out << (isGEP ? " (" : " ");
     
     for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) {
       printTypeInt(Out, (*OI)->getType(), TypeTable);
@@ -348,6 +348,11 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName,
     
     if (isGEP)
       Out << ")";
+    else if (CE->getOpcode() == Instruction::Cast) {
+      Out << " to ";
+      printTypeInt(Out, CE->getType(), TypeTable);
+    }
+
   } else {
     Out << "<placeholder or erroneous Constant>";
   }