summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-07 21:26:07 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-07 21:26:07 +0000
commitf09c2dc8e06480d962cea7bfd5562575bdf168ae (patch)
treec0ac589fab4e5c14741a466e948b633396870bed /clang/lib/AST
parent204b1d2268315ac4e14b9784b831526a439f18f0 (diff)
downloadbcm5719-llvm-f09c2dc8e06480d962cea7bfd5562575bdf168ae.tar.gz
bcm5719-llvm-f09c2dc8e06480d962cea7bfd5562575bdf168ae.zip
Fix printing of member references to avoid displaying implicitly-generated member references, e.g., for anonymous struct/unions or implicit 'this' in member functions
llvm-svn: 61885
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/StmtPrinter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index 679c8974975..7456e8cca9e 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -757,8 +757,10 @@ void StmtPrinter::VisitCallExpr(CallExpr *Call) {
OS << ")";
}
void StmtPrinter::VisitMemberExpr(MemberExpr *Node) {
- PrintExpr(Node->getBase());
- OS << (Node->isArrow() ? "->" : ".");
+ if (!Node->getBase()->isImplicit()) {
+ PrintExpr(Node->getBase());
+ OS << (Node->isArrow() ? "->" : ".");
+ }
OS << Node->getMemberDecl()->getNameAsString();
}
void StmtPrinter::VisitExtVectorElementExpr(ExtVectorElementExpr *Node) {
OpenPOWER on IntegriCloud