diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-29 00:18:15 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-29 00:18:15 +0000 |
commit | d17020676106cd77cd35d263c5549b605dad0225 (patch) | |
tree | 0c226b716d4557190e486e71f490f08cbad50d14 /clang/lib/AST/StmtPrinter.cpp | |
parent | a5a8f76cea106a8d766bd6d9351fd0f51ef46a2f (diff) | |
download | bcm5719-llvm-d17020676106cd77cd35d263c5549b605dad0225.tar.gz bcm5719-llvm-d17020676106cd77cd35d263c5549b605dad0225.zip |
Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.
llvm-svn: 102571
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index b50bb0ce7e1..52f627d449e 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -718,7 +718,11 @@ void StmtPrinter::VisitOffsetOfExpr(OffsetOfExpr *Node) { PrintedSomething = true; continue; } - + + // Skip implicit base indirections. + if (ON.getKind() == OffsetOfExpr::OffsetOfNode::Base) + continue; + // Field or identifier node. IdentifierInfo *Id = ON.getFieldName(); if (!Id) |