[PATCH] D53957: [CodeView] Emit the correct TypeIndex for std::nullptr_t

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 16:19:32 PDT 2018


zturner created this revision.
zturner added a reviewer: rnk.
Herald added subscribers: arphaman, JDevlieghere, hiraditya, aprantl.

The TypeIndex used by cl.exe is 0x103, which indicates a `SimpleTypeMode` of `NearPointer` (note the absence of the bitness, normally pointers use a mode of `SimpleTypeMode::NearPointer32` or `SimpleTypeMode::NearPointer64`) and a `SimpleTypeKind` of `void`.  So this is basically a `void*`, but without a specified size, which makes sense given how `std::nullptr_t` is defined.

Anyway, we were actually not emitting *anything* for this.  When we encountered `std::nullptr_t` in a `DIType`, we would actually just emit a TypeIndex of `0`, which is obviously wrong.

The check for this whether we're looking at `std::nullptr_t` looks hacky, but apparently this is the "official" way to do this in DWARF.

I had to udpate some tests in LLDB since they now start working after this change (meaning the old test with broken output would start failing)


https://reviews.llvm.org/D53957

Files:
  lldb/lit/SymbolFile/NativePDB/function-types-builtins.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/test/DebugInfo/COFF/types-std-nullptr-t.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53957.172043.patch
Type: text/x-patch
Size: 6269 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181031/ef78ed82/attachment.bin>


More information about the llvm-commits mailing list