Skip to content

Commit a3eb446

Browse files
committed
Address remaining comments:
- avoid duplicating densemap insertion - remove virtual
1 parent 5f87ab5 commit a3eb446

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

clang/lib/AST/VTableBuilder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,10 +2657,11 @@ class VFTableBuilder {
26572657
MethodVFTableLocation Loc(MI.VBTableIndex, WhichVFPtr.getVBaseWithVPtr(),
26582658
WhichVFPtr.NonVirtualOffset, MI.VFTableIndex);
26592659
if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) {
2660-
if (!Context.getTargetInfo().getCXXABI().isMicrosoft())
2661-
MethodVFTableLocations[GlobalDecl(DD, Dtor_Deleting)] = Loc;
2662-
else
2663-
MethodVFTableLocations[GlobalDecl(DD, Dtor_VectorDeleting)] = Loc;
2660+
// In Microsoft ABI vftable always references vector deleting dtor.
2661+
CXXDtorType DtorTy = Context.getTargetInfo().getCXXABI().isMicrosoft()
2662+
? Dtor_VectorDeleting
2663+
: Dtor_Deleting;
2664+
MethodVFTableLocations[GlobalDecl(DD, DtorTy)] = Loc;
26642665
} else {
26652666
MethodVFTableLocations[MD] = Loc;
26662667
}

clang/lib/CodeGen/CGCXXABI.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,9 @@ class CGCXXABI {
578578

579579
/// Reads the array cookie associated with the given pointer,
580580
/// that should have one.
581-
virtual void ReadArrayCookie(CodeGenFunction &CGF, Address Ptr,
582-
QualType ElementType, llvm::Value *&NumElements,
583-
llvm::Value *&AllocPtr, CharUnits &CookieSize);
581+
void ReadArrayCookie(CodeGenFunction &CGF, Address Ptr, QualType ElementType,
582+
llvm::Value *&NumElements, llvm::Value *&AllocPtr,
583+
CharUnits &CookieSize);
584584

585585
/// Return whether the given global decl needs a VTT parameter.
586586
virtual bool NeedsVTTParameter(GlobalDecl GD);

0 commit comments

Comments
 (0)