[MS Demangler] Properly print all thunk types.
We were only printing the vtordisp thunk before as the previous
patch was more aimed at getting special operators working, one
of which was a thunk. This patch gets all thunk types to print
properly, and adds a test for each one.
llvm-svn: 340088
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp
index 172ba0b..a307914 100644
--- a/llvm/lib/Demangle/MicrosoftDemangle.cpp
+++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp
@@ -945,7 +945,6 @@
break;
}
case OperatorTy::Vcall: {
- // [thunk]: __cdecl Base::`vcall'{8, {flat}}' }'
const VirtualMemberPtrThunk &Thunk =
static_cast<const VirtualMemberPtrThunk &>(Oper);
OS << "[thunk]: ";
@@ -1194,9 +1193,17 @@
if (FunctionClass & NoPrototype)
return;
- if (FunctionClass & VirtualThisAdjust) {
- OS << "`vtordisp{" << ThisAdjust->VtordispOffset << ", "
- << ThisAdjust->StaticOffset << "}'";
+ if (FunctionClass & StaticThisAdjust) {
+ OS << "`adjustor{" << ThisAdjust->StaticOffset << "}'";
+ } else if (FunctionClass & VirtualThisAdjust) {
+ if (FunctionClass & VirtualThisAdjustEx) {
+ OS << "`vtordispex{" << ThisAdjust->VBPtrOffset << ", "
+ << ThisAdjust->VBOffsetOffset << ", " << ThisAdjust->VtordispOffset
+ << ", " << ThisAdjust->StaticOffset << "}'";
+ } else {
+ OS << "`vtordisp{" << ThisAdjust->VtordispOffset << ", "
+ << ThisAdjust->StaticOffset << "}'";
+ }
}
OS << "(";