[LLVMdev] Function::getName in CallGraphSCCPass causes bus error
Trevor Harmon
Trevor.W.Harmon at nasa.gov
Mon Jul 19 13:26:44 PDT 2010
On Jul 19, 2010, at 4:55 AM, Duncan Sands wrote:
> Hi Trevor,
>
>> struct Hello : public CallGraphSCCPass {
>> static char ID; // Pass identification, replacement for typeid
>> Hello() : CallGraphSCCPass(&ID) {}
>> virtual bool runOnSCC(std::vector<CallGraphNode *> &SCC) {
>> CallGraphNode *node = SCC.front();
>> Function *function = node->getFunction();
>> StringRef str = function->getName();
>
> maybe function is NULL? This is the case for the "external node".
Hrmph, could have sworn I checked for that already. Indeed, I was
crashing on external nodes. Thanks for your help,
Trevor
More information about the llvm-dev
mailing list