diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 |
commit | 600c6fa13de5c407dc36dbb0ab73807868741ae0 (patch) | |
tree | 49817b316c4fdaa56d9d16ebf2555303d1a990e0 /lib/VMCore/Function.cpp | |
parent | 93338c197185f946619794ce011ec27b5b6250e2 (diff) |
Notes
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r-- | lib/VMCore/Function.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 3a991f62d84e3..54bd895fd4096 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -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 |