[PATCH] Recognize dwarf::DW_ATE_UTF in DwarfUnit isUnsignedDIType

Stephan Tolksdorf st at quanttec.com
Fri May 16 14:46:25 PDT 2014


Hi dblaikie,

This patch fixes an assert violation triggered by the following clang test case:

  // compile with -std=c++11 -g
  const char16_t c = 0;
  char16_t test() { return c; }

David, you wrote you could help me turn this into an LLVM test case?

http://reviews.llvm.org/D3810

Files:
  lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Index: lib/CodeGen/AsmPrinter/DwarfUnit.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -764,9 +764,11 @@
           Encoding == dwarf::DW_ATE_unsigned_char ||
           Encoding == dwarf::DW_ATE_signed ||
           Encoding == dwarf::DW_ATE_signed_char ||
+          Encoding == dwarf::DW_ATE_UTF ||
           Encoding == dwarf::DW_ATE_boolean) && "Unsupported encoding");
   return (Encoding == dwarf::DW_ATE_unsigned ||
           Encoding == dwarf::DW_ATE_unsigned_char ||
+          Encoding == dwarf::DW_ATE_UTF ||
           Encoding == dwarf::DW_ATE_boolean);
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3810.9496.patch
Type: text/x-patch
Size: 685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140516/85581037/attachment.bin>


More information about the llvm-commits mailing list