[llvm-branch-commits] [llvm-branch] r134740 - /llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp
Chris Lattner
sabre at nondot.org
Fri Jul 8 14:13:12 PDT 2011
Author: lattner
Date: Fri Jul 8 16:13:12 2011
New Revision: 134740
URL: http://llvm.org/viewvc/llvm-project?rev=134740&view=rev
Log:
Make T->dump() print the body of non-anonymous structs.
Modified:
llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp
Modified: llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp?rev=134740&r1=134739&r2=134740&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/VMCore/AsmWriter.cpp Fri Jul 8 16:13:12 2011
@@ -1973,7 +1973,15 @@
OS << "<null Type>";
return;
}
- TypePrinting().print(const_cast<Type*>(this), OS);
+ TypePrinting TP;
+ TP.print(const_cast<Type*>(this), OS);
+
+ // If the type is a named struct type, print the body as well.
+ if (StructType *STy = dyn_cast<StructType>(const_cast<Type*>(this)))
+ if (!STy->isAnonymous()) {
+ OS << " = type ";
+ TP.printStructBody(STy, OS);
+ }
}
void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
More information about the llvm-branch-commits
mailing list