summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/scripts/clang.tail-padded-arrays.diff26
1 files changed, 26 insertions, 0 deletions
diff --git a/lldb/scripts/clang.tail-padded-arrays.diff b/lldb/scripts/clang.tail-padded-arrays.diff
new file mode 100644
index 00000000000..504d4f025b3
--- /dev/null
+++ b/lldb/scripts/clang.tail-padded-arrays.diff
@@ -0,0 +1,26 @@
+Index: lib/Sema/SemaChecking.cpp
+===================================================================
+--- lib/Sema/SemaChecking.cpp (revision 152265)
++++ lib/Sema/SemaChecking.cpp (working copy)
+@@ -4416,12 +4416,16 @@
+
+ // Don't consider sizes resulting from macro expansions or template argument
+ // substitution to form C89 tail-padded arrays.
+- ConstantArrayTypeLoc TL =
+- cast<ConstantArrayTypeLoc>(FD->getTypeSourceInfo()->getTypeLoc());
+- const Expr *SizeExpr = dyn_cast<IntegerLiteral>(TL.getSizeExpr());
+- if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
+- return false;
+
++ TypeSourceInfo *TInfo = FD->getTypeSourceInfo();
++ if (TInfo) {
++ ConstantArrayTypeLoc TL =
++ cast<ConstantArrayTypeLoc>(TInfo->getTypeLoc());
++ const Expr *SizeExpr = dyn_cast<IntegerLiteral>(TL.getSizeExpr());
++ if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
++ return false;
++ }
++
+ const RecordDecl *RD = dyn_cast<RecordDecl>(FD->getDeclContext());
+ if (!RD) return false;
+ if (RD->isUnion()) return false;
OpenPOWER on IntegriCloud