[llvm-commits] [llvm] r56929 - in /llvm/trunk: include/llvm/Type.h lib/VMCore/AsmWriter.cpp
Chris Lattner
sabre at nondot.org
Wed Oct 1 13:16:19 PDT 2008
Author: lattner
Date: Wed Oct 1 15:16:19 2008
New Revision: 56929
URL: http://llvm.org/viewvc/llvm-project?rev=56929&view=rev
Log:
add a new form of Type::dump that takes a module for type names,
patch provided by Tomas Lindquist Olsen!
Modified:
llvm/trunk/include/llvm/Type.h
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/include/llvm/Type.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Type.h?rev=56929&r1=56928&r2=56929&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Type.h (original)
+++ llvm/trunk/include/llvm/Type.h Wed Oct 1 15:16:19 2008
@@ -26,6 +26,7 @@
class IntegerType;
class TypeMapBase;
class raw_ostream;
+class Module;
/// This file contains the declaration of the Type class. For more "Type" type
/// stuff, look in DerivedTypes.h.
@@ -162,6 +163,10 @@
/// @brief Debugging support: print to stderr
void dump() const;
+ /// @brief Debugging support: print to stderr (use type names from context
+ /// module).
+ void dump(const Module *Context) const;
+
//===--------------------------------------------------------------------===//
// Property accessors for dealing with types... Some of these virtual methods
// are defined in private classes defined in Type.cpp for primitive types.
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=56929&r1=56928&r2=56929&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Oct 1 15:16:19 2008
@@ -1834,6 +1834,14 @@
// 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(); }
More information about the llvm-commits
mailing list