On Fri, 22 Nov 2002, Juan Nicolas Ruiz wrote:> It is valid that a function returns without using an Instruction::Ret > as the last instruction?No: http://llvm.cs.uiuc.edu/docs/LangRef.html#terminators All basic blocks must have a terminator.> If so, can we assume that a BasicBlock with > no successors is an exit BB?Yes, but you don't want to do this. Just do: if (isa<ReturnInst>(BB->getTerminator())) and be done with it, that's much more explicit. -Chris -- http://llvm.cs.uiuc.edu/ http://www.nondot.org/~sabre/Projects/
How do I recognize that the callee function for a Instruction::Call is external? I have: CallInst *CI = cast<CallInst>(Inst); Function *G = CI->getCalledFunction(); nicolas
Juan Nicolas Ruiz
2002-Nov-22 17:53 UTC
[LLVMdev] Re: how can I identify external functions?
G->isExternal(), sorry. On Fri, 22 Nov 2002, Juan Nicolas Ruiz wrote:> How do I recognize that the callee function for a Instruction::Call is > external? I have: > > CallInst *CI = cast<CallInst>(Inst); > Function *G = CI->getCalledFunction(); > > nicolas > > >Juan Nicolas Ruiz | Dept. of Computer Science | Univ. of Illinois | #213 CSL, +1-217-244-1134
Apparently Analagous Threads
- [LLVMdev] Utility function to identify user defined function
- [LLVMdev] Utility function to identify user defined function
- [LLVMdev] getCalledFunction
- [LLVMdev] How to explain this weird phenomenon????????
- [LLVMdev] How to const char* Value for function argument