bug 122:
authorReid Spencer <rspencer@reidspencer.com>
Sun, 18 Jul 2004 00:16:21 +0000 (00:16 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 18 Jul 2004 00:16:21 +0000 (00:16 +0000)
- Correct ordering of tests because for GlobalValue isa Constant

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

lib/Bytecode/Writer/Writer.cpp

index 8686f4935612c180112707d518009fab2af6c791..395386d6621a8bb015135a9863d0c2a72d582c5c 100644 (file)
@@ -135,8 +135,8 @@ void BytecodeWriter::outputConstantsInPlane(const std::vector<const Value*>
 
   for (unsigned i = ValNo; i < ValNo+NC; ++i) {
     const Value *V = Plane[i];
-    if (const Constant *CPV = dyn_cast<Constant>(V)) {
-      outputConstant(CPV);
+    if (const Constant *C = dyn_cast<Constant>(V)) {
+      outputConstant(C);
     }
   }
 }
@@ -151,13 +151,11 @@ void BytecodeWriter::outputConstants(bool isFunction) {
 
   unsigned NumPlanes = Table.getNumPlanes();
 
-  // Output the type plane before any constants!
-  if (isFunction) {
+  if (isFunction)
+    // Output the type plane before any constants!
     outputTypes( Table.getModuleTypeLevel() );
-  }
-  
-  // Output module-level string constants before any other constants.x
-  if (!isFunction)
+  else
+    // Output module-level string constants before any other constants.x
     outputConstantStrings();
 
   for (unsigned pno = 0; pno != NumPlanes; pno++) {
@@ -397,3 +395,5 @@ void llvm::WriteBytecodeToFile(const Module *C, std::ostream &Out) {
   }
   Out.flush();
 }
+
+// vim: sw=2 ai