summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-04-29 16:52:17 +0000
committerAdrian Prantl <aprantl@apple.com>2015-04-29 16:52:17 +0000
commitba6ec4b70bc49bf8b65b59f64b43df4df3fe786e (patch)
treec586a79f158f33436e7d48c560f411428c835c81 /llvm/lib/IR/Verifier.cpp
parentc69547136582e1e3155c903202583aea6490faf0 (diff)
downloadbcm5719-llvm-ba6ec4b70bc49bf8b65b59f64b43df4df3fe786e.tar.gz
bcm5719-llvm-ba6ec4b70bc49bf8b65b59f64b43df4df3fe786e.zip
Temporarily relax a check in the debug info verifier.
The clang frontend helps out GDB by emitting the members of local anonymous unions as artificial local variables with shared storage. When SROA splits the storage for artificial local variables that are smaller than the entire union, the overhang piece will be outside of the allotted space for the variable and this check fails. rdar://problem/20730771 llvm-svn: 236124
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 3ccc48e3ffd..1e1c4942576 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3478,6 +3478,15 @@ void Verifier::verifyBitPieceExpression(const DbgInfoIntrinsic &I,
if (!E->isBitPiece())
return;
+ // The frontend helps out GDB by emitting the members of local anonymous
+ // unions as artificial local variables with shared storage. When SROA splits
+ // the storage for artificial local variables that are smaller than the entire
+ // union, the overhang piece will be outside of the allotted space for the
+ // variable and this check fails.
+ // FIXME: Remove this check as soon as clang stops doing this; it hides bugs.
+ if (V->isArtificial())
+ return;
+
// If there's no size, the type is broken, but that should be checked
// elsewhere.
uint64_t VarSize = getVariableSize(*V, TypeRefs);
OpenPOWER on IntegriCloud