]> granicus.if.org Git - clang/commitdiff
Add SymbolRef::print() and have SymbolicRegion::print() use this method instead of...
authorTed Kremenek <kremenek@apple.com>
Fri, 5 Dec 2008 02:45:20 +0000 (02:45 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 5 Dec 2008 02:45:20 +0000 (02:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60578 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/SymbolManager.h
lib/Analysis/MemRegion.cpp
lib/Analysis/SymbolManager.cpp

index 9d495bee5fd9a1f1ea35aac3e3cdcf71aeee07ea..887e3d9f9cd664425bb16a63d8fed2b25503983f 100644 (file)
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Allocator.h"
 
+namespace llvm {
+  class raw_ostream;
+}
+
 namespace clang {
   
 class MemRegion;
@@ -37,6 +41,8 @@ public:
   operator unsigned() const { return getNumber(); }
   unsigned getNumber() const { assert (isInitialized()); return Data; }
     
+  void print(llvm::raw_ostream& os) const;
+  
   void Profile(llvm::FoldingSetNodeID& ID) const { 
     assert (isInitialized());
     ID.AddInteger(Data);
index 99dc796213f5fc06586fd08c6957f4ea4e23db1c..6aff286dc154b35cc6a47b4a75bf68927456f86d 100644 (file)
@@ -149,7 +149,8 @@ void VarRegion::print(llvm::raw_ostream& os) const {
 }
 
 void SymbolicRegion::print(llvm::raw_ostream& os) const {
-  os << "$" << sym.getNumber();
+  os << "SymRegion-";
+  sym.print(os);
 }
 
 void FieldRegion::print(llvm::raw_ostream& os) const {
index 013202990a6bc8920ebf5c6b6053a3712b4e9497..1c2814a3afeb6157c3326f0428085761829030c2 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "clang/Analysis/PathSensitive/SymbolManager.h"
+#include "llvm/Support/raw_ostream.h"
 
 using namespace clang;
 
+void SymbolRef::print(llvm::raw_ostream& os) const {
+  os << getNumber();
+}
+
 SymbolRef SymbolManager::getSymbol(VarDecl* D) {
 
   assert (isa<ParmVarDecl>(D) || isa<ImplicitParamDecl>(D) ||