diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/IR/Module.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/IR/Module.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/IR/Module.cpp b/contrib/llvm-project/llvm/lib/IR/Module.cpp index dbf4035ac7c1..271ae126d722 100644 --- a/contrib/llvm-project/llvm/lib/IR/Module.cpp +++ b/contrib/llvm-project/llvm/lib/IR/Module.cpp @@ -381,6 +381,22 @@ void Module::debug_compile_units_iterator::SkipNoDebugCUs() { ++Idx; } +iterator_range<Module::global_object_iterator> Module::global_objects() { + return concat<GlobalObject>(functions(), globals()); +} +iterator_range<Module::const_global_object_iterator> +Module::global_objects() const { + return concat<const GlobalObject>(functions(), globals()); +} + +iterator_range<Module::global_value_iterator> Module::global_values() { + return concat<GlobalValue>(functions(), globals(), aliases(), ifuncs()); +} +iterator_range<Module::const_global_value_iterator> +Module::global_values() const { + return concat<const GlobalValue>(functions(), globals(), aliases(), ifuncs()); +} + //===----------------------------------------------------------------------===// // Methods to control the materialization of GlobalValues in the Module. // @@ -604,7 +620,7 @@ GlobalVariable *llvm::collectUsedGlobalVariables( const ConstantArray *Init = cast<ConstantArray>(GV->getInitializer()); for (Value *Op : Init->operands()) { - GlobalValue *G = cast<GlobalValue>(Op->stripPointerCastsNoFollowAliases()); + GlobalValue *G = cast<GlobalValue>(Op->stripPointerCasts()); Set.insert(G); } return GV; |
