From db89e312d968c258aba3c79c1c398f5fb19267a3 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 14 Jun 2009 09:23:33 +0000 Subject: Import LLVM r73340. --- lib/VMCore/Function.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/VMCore/Function.cpp') diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 3a991f6..54bd895 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(*I) && !isa(*I))) + return true; + } + return false; +} + // vim: sw=2 ai -- cgit v1.1