From 9e3eb9f9d2a2e34d360d740fe95fc84411010b85 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 29 Mar 2018 22:42:24 +0000 Subject: Hoist MethodVFTableLocation out of MicrosoftVTableContext, NFC This allows forward declaring it so that we can add it to MicrosoftMangleContext::mangleVirtualMemPtrThunk without including VTableBuilder.h. That saves a hashtable lookup when emitting virtual member pointer functions. It also shortens a really long type name. This struct has "VFtable" in the name, so it seems pretty unlikely that someone will assume it is generally useful for non-MS C++ ABI stuff. llvm-svn: 328845 --- clang/lib/AST/VTableBuilder.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'clang/lib/AST/VTableBuilder.cpp') diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index a95791ce884..5f1ccdf2cc0 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -2367,8 +2367,6 @@ namespace { class VFTableBuilder { public: - typedef MicrosoftVTableContext::MethodVFTableLocation MethodVFTableLocation; - typedef llvm::DenseMap MethodVFTableLocationsTy; @@ -3544,10 +3542,9 @@ static void computeFullPathsForVFTables(ASTContext &Context, } } -static bool -vfptrIsEarlierInMDC(const ASTRecordLayout &Layout, - const MicrosoftVTableContext::MethodVFTableLocation &LHS, - const MicrosoftVTableContext::MethodVFTableLocation &RHS) { +static bool vfptrIsEarlierInMDC(const ASTRecordLayout &Layout, + const MethodVFTableLocation &LHS, + const MethodVFTableLocation &RHS) { CharUnits L = LHS.VFPtrOffset; CharUnits R = RHS.VFPtrOffset; if (LHS.VBase) @@ -3733,7 +3730,7 @@ MicrosoftVTableContext::getVFTableLayout(const CXXRecordDecl *RD, return *VFTableLayouts[id]; } -const MicrosoftVTableContext::MethodVFTableLocation & +const MethodVFTableLocation & MicrosoftVTableContext::getMethodVFTableLocation(GlobalDecl GD) { assert(cast(GD.getDecl())->isVirtual() && "Only use this method for virtual methods or dtors"); -- cgit v1.2.3