[CodeView] Add support for ref-qualified member functions.
authorZachary Turner <zturner@google.com>
Tue, 20 Nov 2018 22:13:43 +0000 (22:13 +0000)
committerZachary Turner <zturner@google.com>
Tue, 20 Nov 2018 22:13:43 +0000 (22:13 +0000)
commitc68f895702958dda96bfc297a3bc491082c5269d
tree78ce4e99f44a5ce5e82ef0e5a77ae67e494958fa
parent3826566c044e94f8c1e3d26c66f28a5545aab2bc
[CodeView] Add support for ref-qualified member functions.

When you have a member function with a ref-qualifier, for example:

struct Foo {
  void Func() &;
  void Func2() &&;
};

clang-cl was not emitting this information. Doing so is a bit
awkward, because it's not a property of the LF_MFUNCTION type, which
is what you'd expect. Instead, it's a property of the this pointer
which is actually an LF_POINTER. This record has an attributes
bitmask on it, and our handling of this bitmask was all wrong. We
had some parts of the bitmask defined incorrectly, but importantly
for this bug, we didn't know about these extra 2 bits that represent
the ref qualifier at all.

Differential Revision: https://reviews.llvm.org/D54667

llvm-svn: 347354
llvm/include/llvm/DebugInfo/CodeView/CodeView.h
llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
llvm/test/DebugInfo/COFF/types-method-ref-qualifiers.ll [new file with mode: 0644]