Unbreak the sanitizer buildbots after r209226 due to SROA issue described in http...
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 20 May 2014 21:40:13 +0000 (21:40 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 20 May 2014 21:40:13 +0000 (21:40 +0000)
Undecided whether this should include a test case - SROA produces bad
dbg.value metadata describing a value for a reference that is actually
the value of the thing the reference refers to. For now, loosening the
assert lets this not assert, but it's still bogus/wrong output...

If someone wants to tell me to add a test, I'm willing/able, just
undecided. Hopefully we'll get SROA fixed soon & we can tighten up this
assertion again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209240 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfUnit.cpp

index 68673f7fb84c784f1a4c20c980c6120e89dbaef7..f09cb6ade6385561d868b1ae6f632ba6d821b234 100644 (file)
@@ -751,11 +751,14 @@ static bool isUnsignedDIType(DwarfDebug *DD, DIType Ty) {
   if (DTy.isDerivedType()) {
     dwarf::Tag T = (dwarf::Tag)Ty.getTag();
     // Encode pointer constants as unsigned bytes. This is used at least for
-    // null pointer constant emission. Maybe DW_TAG_reference_type should be
-    // accepted here too, if there are ways to produce compile-time constant
-    // references.
+    // null pointer constant emission.
+    // FIXME: reference and rvalue_reference /probably/ shouldn't be allowed
+    // here, but accept them for now due to a bug in SROA producing bogus
+    // dbg.values.
     if (T == dwarf::DW_TAG_pointer_type ||
-        T == dwarf::DW_TAG_ptr_to_member_type)
+        T == dwarf::DW_TAG_ptr_to_member_type ||
+        T == dwarf::DW_TAG_reference_type ||
+        T == dwarf::DW_TAG_rvalue_reference_type)
       return true;
     assert(T == dwarf::DW_TAG_typedef || T == dwarf::DW_TAG_const_type ||
            T == dwarf::DW_TAG_volatile_type ||