summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/APValue.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-16 03:56:14 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-16 03:56:14 +0000
commit235341bc88202e402225e43ce5e7dc8a29089a25 (patch)
tree1fdd650fdbd753484dca9f9dfa58466375bd1b98 /clang/lib/AST/APValue.cpp
parent426feb61b99defcc728185769ba3b7dbe6d82020 (diff)
downloadbcm5719-llvm-235341bc88202e402225e43ce5e7dc8a29089a25.tar.gz
bcm5719-llvm-235341bc88202e402225e43ce5e7dc8a29089a25.zip
Store SourceManager pointer on PrintingPolicy in the case where we're dumping,
and remove ASTContext reference (which was frequently bound to a dereferenced null pointer) from the recursive lump of printPretty functions. In so doing, fix (at least) one case where we intended to use the 'dump' mode, but that failed because a null ASTContext reference had been passed in. llvm-svn: 162011
Diffstat (limited to 'clang/lib/AST/APValue.cpp')
-rw-r--r--clang/lib/AST/APValue.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp
index a74ef14a9e2..2d7c9bd7864 100644
--- a/clang/lib/AST/APValue.cpp
+++ b/clang/lib/AST/APValue.cpp
@@ -367,8 +367,7 @@ void APValue::printPretty(raw_ostream &Out, ASTContext &Ctx, QualType Ty) const{
if (const ValueDecl *VD = Base.dyn_cast<const ValueDecl*>())
Out << *VD;
else
- Base.get<const Expr*>()->printPretty(Out, Ctx, 0,
- Ctx.getPrintingPolicy());
+ Base.get<const Expr*>()->printPretty(Out, 0, Ctx.getPrintingPolicy());
if (!O.isZero()) {
Out << " + " << (O / S);
if (IsReference)
@@ -389,7 +388,7 @@ void APValue::printPretty(raw_ostream &Out, ASTContext &Ctx, QualType Ty) const{
ElemTy = VD->getType();
} else {
const Expr *E = Base.get<const Expr*>();
- E->printPretty(Out, Ctx, 0,Ctx.getPrintingPolicy());
+ E->printPretty(Out, 0, Ctx.getPrintingPolicy());
ElemTy = E->getType();
}
OpenPOWER on IntegriCloud