summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-01 20:16:19 +0000
committerChris Lattner <sabre@nondot.org>2008-10-01 20:16:19 +0000
commit41a83d99e6eff048f55b46aa41e04ca0f3b00423 (patch)
treead8a3cc3981ab1e534e931ccf704629b793b9db2
parent1dd27578dde4eddb5435b19edc2e2d6869ef5111 (diff)
downloadbcm5719-llvm-41a83d99e6eff048f55b46aa41e04ca0f3b00423.tar.gz
bcm5719-llvm-41a83d99e6eff048f55b46aa41e04ca0f3b00423.zip
add a new form of Type::dump that takes a module for type names,
patch provided by Tomas Lindquist Olsen! llvm-svn: 56929
-rw-r--r--llvm/include/llvm/Type.h5
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp8
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/include/llvm/Type.h b/llvm/include/llvm/Type.h
index 1f271957df7..b8f65582ba3 100644
--- a/llvm/include/llvm/Type.h
+++ b/llvm/include/llvm/Type.h
@@ -26,6 +26,7 @@ class PointerType;
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 @@ public:
/// @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.
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 5d765a4c658..c3186f69a5c 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -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(); }
OpenPOWER on IntegriCloud