summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVTables.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.h')
-rw-r--r--clang/lib/CodeGen/CGVTables.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVTables.h b/clang/lib/CodeGen/CGVTables.h
index b4262fe224c..bc113ec42fa 100644
--- a/clang/lib/CodeGen/CGVTables.h
+++ b/clang/lib/CodeGen/CGVTables.h
@@ -295,6 +295,15 @@ public:
CodeGenVTables(CodeGenModule &CGM)
: CGM(CGM) { }
+ // isKeyFunctionInAnotherTU - True if this record has a key function and it is
+ // in another translation unit.
+ static bool isKeyFunctionInAnotherTU(ASTContext &Context,
+ const CXXRecordDecl *RD) {
+ assert (RD->isDynamicClass() && "Non dynamic classes have no key.");
+ const CXXMethodDecl *KeyFunction = Context.getKeyFunction(RD);
+ return KeyFunction && !KeyFunction->getBody();
+ }
+
/// needsVTTParameter - Return whether the given global decl needs a VTT
/// parameter, which it does if it's a base constructor or destructor with
/// virtual bases.
OpenPOWER on IntegriCloud