summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/VTableBuilder.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-03-29 22:42:24 +0000
committerReid Kleckner <rnk@google.com>2018-03-29 22:42:24 +0000
commit9e3eb9f9d2a2e34d360d740fe95fc84411010b85 (patch)
tree7123c24c2a9987ada5f9db2d100b5ebf2dfe1be2 /clang/lib/AST/VTableBuilder.cpp
parentf423062aff913a7f7867de74e7c984b43124b300 (diff)
downloadbcm5719-llvm-9e3eb9f9d2a2e34d360d740fe95fc84411010b85.tar.gz
bcm5719-llvm-9e3eb9f9d2a2e34d360d740fe95fc84411010b85.zip
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
Diffstat (limited to 'clang/lib/AST/VTableBuilder.cpp')
-rw-r--r--clang/lib/AST/VTableBuilder.cpp11
1 files changed, 4 insertions, 7 deletions
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<GlobalDecl, MethodVFTableLocation>
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<CXXMethodDecl>(GD.getDecl())->isVirtual() &&
"Only use this method for virtual methods or dtors");
OpenPOWER on IntegriCloud