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 | cc8a5d5f90bbbbcb46f342117b851b7e07ec34f1 (patch) | |
tree | a75f28ed6bd4b72e7830bdd531451f25fc68159c /lib/Frontend/PCHWriterStmt.cpp | |
parent | 6e45cbcba1807c01ce2fc9a768ebfffafcffa22d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriterStmt.cpp')
-rw-r--r-- | lib/Frontend/PCHWriterStmt.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriterStmt.cpp b/lib/Frontend/PCHWriterStmt.cpp index 3d158a48de..a1993d37f2 100644 --- a/lib/Frontend/PCHWriterStmt.cpp +++ b/lib/Frontend/PCHWriterStmt.cpp @@ -418,6 +418,11 @@ void PCHStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) { case OffsetOfExpr::OffsetOfNode::Identifier: Writer.AddIdentifierRef(ON.getFieldName(), Record); break; + + case OffsetOfExpr::OffsetOfNode::Base: + // FIXME: Implement this! + llvm_unreachable("PCH for offsetof(base-specifier) not implemented"); + break; } } for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I) |