Verify function attributes.
[oota-llvm.git] / lib / VMCore / AsmWriter.cpp
index d46ff3f3a509275d0e4753ff8ebeea88ae8dd0b0..c3186f69a5ca07e6aaafc8cc38415d877ca0d9f4 100644 (file)
@@ -385,7 +385,7 @@ int SlotTracker::getGlobalSlot(const GlobalValue *V) {
   
   // Find the type plane in the module map
   ValueMap::iterator MI = mMap.find(V);
-  return MI == mMap.end() ? -1 : MI->second;
+  return MI == mMap.end() ? -1 : (int)MI->second;
 }
 
 
@@ -397,7 +397,7 @@ int SlotTracker::getLocalSlot(const Value *V) {
   initialize();
   
   ValueMap::iterator FI = fMap.find(V);
-  return FI == fMap.end() ? -1 : FI->second;
+  return FI == fMap.end() ? -1 : (int)FI->second;
 }
 
 
@@ -1809,7 +1809,7 @@ void Value::print(raw_ostream &OS, AssemblyAnnotationWriter *AAW) const {
     AssemblyWriter W(OS, SlotTable, GV->getParent(), 0);
     W.write(GV);
   } else if (const Constant *C = dyn_cast<Constant>(this)) {
-    OS << ' ' << C->getType()->getDescription() << ' ';
+    OS << C->getType()->getDescription() << ' ';
     std::map<const Type *, std::string> TypeTable;
     WriteConstantInt(OS, C, TypeTable, 0);
   } else if (const Argument *A = dyn_cast<Argument>(this)) {
@@ -1834,6 +1834,14 @@ void Value::dump() const { print(errs()); errs() << '\n'; errs().flush(); }
 // Type::dump - allow easy printing of Types from the debugger.
 void Type::dump() const { print(errs()); errs() << '\n'; errs().flush(); }
 
+// Type::dump - allow easy printing of Types from the debugger.
+// This one uses type names from the given context module
+void Type::dump(const Module *Context) const {
+  WriteTypeSymbolic(errs(), this, Context);
+  errs() << '\n';
+  errs().flush();
+}
+
 // Module::dump() - Allow printing of Modules from the debugger.
 void Module::dump() const { print(errs(), 0); errs().flush(); }