aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2020-11-17 14:44:25 -0800
committerTeresa Johnson <tejohnson@google.com>2020-11-24 12:06:24 -0800
commit0768b0576a938b6a4832884384fcb02cd2f74e09 (patch)
tree223bcf409327cdc7550c7b45f34d178225c55c51 /clang/lib/CodeGen/CodeGenModule.h
parentc24708102501115efae27f82c24d5991059a5770 (diff)
downloadllvm-0768b0576a938b6a4832884384fcb02cd2f74e09.zip
llvm-0768b0576a938b6a4832884384fcb02cd2f74e09.tar.gz
llvm-0768b0576a938b6a4832884384fcb02cd2f74e09.tar.bz2
Avoid redundant work when computing vtable vcall visibility
Add a Visited set to avoid repeatedly processing the same base classes in complex class hierarchies. This cut down the compile time of one source file from >12min to ~1min. Differential Revision: https://reviews.llvm.org/D91676
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 7d812b6..c595705 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -1333,8 +1333,11 @@ public:
/// a virtual function call could be made which ends up being dispatched to a
/// member function of this class. This scope can be wider than the visibility
/// of the class itself when the class has a more-visible dynamic base class.
+ /// The client should pass in an empty Visited set, which is used to prevent
+ /// redundant recursive processing.
llvm::GlobalObject::VCallVisibility
- GetVCallVisibilityLevel(const CXXRecordDecl *RD);
+ GetVCallVisibilityLevel(const CXXRecordDecl *RD,
+ llvm::DenseSet<const CXXRecordDecl *> &Visited);
/// Emit type metadata for the given vtable using the given layout.
void EmitVTableTypeMetadata(const CXXRecordDecl *RD,