[llvm] r236124 - Temporarily relax a check in the debug info verifier.

Adrian Prantl aprantl at apple.com
Wed Apr 29 09:52:18 PDT 2015


Author: adrian
Date: Wed Apr 29 11:52:17 2015
New Revision: 236124

URL: http://llvm.org/viewvc/llvm-project?rev=236124&view=rev
Log:
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

Modified:
    llvm/trunk/lib/IR/Verifier.cpp

Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=236124&r1=236123&r2=236124&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Wed Apr 29 11:52:17 2015
@@ -3478,6 +3478,15 @@ void Verifier::verifyBitPieceExpression(
   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);





More information about the llvm-commits mailing list