Add SymbolRef::print() and have SymbolicRegion::print() use this method instead of calling SymbolRef::getNumber().

llvm-svn: 60578
This commit is contained in:
Ted Kremenek 2008-12-05 02:45:20 +00:00
parent 3cb81db1b2
commit c9e7622a52
3 changed files with 13 additions and 1 deletions

View File

@ -22,6 +22,10 @@
#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);

View 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 {

View File

@ -13,9 +13,14 @@
//===----------------------------------------------------------------------===//
#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) ||