Change the AST generated for offsetof a bit so that it looks like a
normal expression, and change Evaluate and IRGen to evaluate it like a
normal expression. This simplifies the code significantly, and fixes
PR3396.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index 4468c79..7e25b46 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -724,7 +724,7 @@
}
bool StmtPrinter::PrintOffsetOfDesignator(Expr *E) {
- if (isa<CompoundLiteralExpr>(E)) {
+ if (isa<UnaryOperator>(E)) {
// Base case, print the type and comma.
OS << E->getType().getAsString() << ", ";
return true;