[cfe-commits] r60578 - in /cfe/trunk: include/clang/Analysis/PathSensitive/SymbolManager.h lib/Analysis/MemRegion.cpp lib/Analysis/SymbolManager.cpp
Ted Kremenek
kremenek at apple.com
Thu Dec 4 18:45:20 PST 2008
Author: kremenek
Date: Thu Dec 4 20:45:20 2008
New Revision: 60578
URL: http://llvm.org/viewvc/llvm-project?rev=60578&view=rev
Log:
Add SymbolRef::print() and have SymbolicRegion::print() use this method instead of calling SymbolRef::getNumber().
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h
cfe/trunk/lib/Analysis/MemRegion.cpp
cfe/trunk/lib/Analysis/SymbolManager.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h?rev=60578&r1=60577&r2=60578&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h Thu Dec 4 20:45:20 2008
@@ -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 @@
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);
Modified: cfe/trunk/lib/Analysis/MemRegion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/MemRegion.cpp?rev=60578&r1=60577&r2=60578&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/MemRegion.cpp (original)
+++ cfe/trunk/lib/Analysis/MemRegion.cpp Thu Dec 4 20:45:20 2008
@@ -149,7 +149,8 @@
}
void SymbolicRegion::print(llvm::raw_ostream& os) const {
- os << "$" << sym.getNumber();
+ os << "SymRegion-";
+ sym.print(os);
}
void FieldRegion::print(llvm::raw_ostream& os) const {
Modified: cfe/trunk/lib/Analysis/SymbolManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SymbolManager.cpp?rev=60578&r1=60577&r2=60578&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/SymbolManager.cpp (original)
+++ cfe/trunk/lib/Analysis/SymbolManager.cpp Thu Dec 4 20:45:20 2008
@@ -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) ||
More information about the cfe-commits
mailing list