aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorJeroen Dobbelaere <jeroen.dobbelaere@synopsys.com>2021-07-28 18:56:27 +0200
committerJeroen Dobbelaere <jeroen.dobbelaere@synopsys.com>2021-07-28 19:30:29 +0200
commit03b8c69d06f810f13d0b74d06dabea37c43e5b78 (patch)
tree01898fa83be11e024cded38285e0bf639614b190 /llvm/lib/IR/Module.cpp
parentdc5570d149ca6a0931413bf1ad469eb8f9517f82 (diff)
downloadllvm-03b8c69d06f810f13d0b74d06dabea37c43e5b78.zip
llvm-03b8c69d06f810f13d0b74d06dabea37c43e5b78.tar.gz
llvm-03b8c69d06f810f13d0b74d06dabea37c43e5b78.tar.bz2
[PredicateInfo] Use Intrinsic::getDeclaration now that it handles unnamed types.
This is a second attempt to fix the EXPENSIVE_CHECKS issue that was mentioned In D91661#2875179 by @jroelofs. (The first attempt was in D105983) D91661 more or less completely reverted D49126 and by doing so also removed the cleanup logic of the created declarations and calls. This patch is a replacement for D91661 (which must itself be reverted first). It replaces the custom declaration creation with the generic version and shows the test impact. It also tracks the number of NamedValues to detect if a new prototype was added instead of looking at the available users of a prototype. Reviewed By: jroelofs Differential Revision: https://reviews.llvm.org/D106147
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 7c18dc0..63ea41f 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -114,6 +114,10 @@ GlobalValue *Module::getNamedValue(StringRef Name) const {
return cast_or_null<GlobalValue>(getValueSymbolTable().lookup(Name));
}
+unsigned Module::getNumNamedValues() const {
+ return getValueSymbolTable().size();
+}
+
/// getMDKindID - Return a unique non-zero ID for the specified metadata kind.
/// This ID is uniqued across modules in the current LLVMContext.
unsigned Module::getMDKindID(StringRef Name) const {