mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
Implement and use new method Function::hasAddressTaken().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -364,4 +364,15 @@ Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys,
|
||||
#include "llvm/Intrinsics.gen"
|
||||
#undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
|
||||
|
||||
/// hasAddressTaken - returns true if there are any uses of this function
|
||||
/// other than direct calls or invokes to it.
|
||||
bool Function::hasAddressTaken() const {
|
||||
for (Value::use_const_iterator I = use_begin(), E = use_end(); I != E; ++I) {
|
||||
if (I.getOperandNo() != 0 ||
|
||||
(!isa<CallInst>(*I) && !isa<InvokeInst>(*I)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// vim: sw=2 ai
|
||||
|
||||
Reference in New Issue
Block a user