[LLVMdev] globals in DS graph

Ganesh Bikshandi bikshand at students.uiuc.edu
Sun Nov 24 19:47:00 PST 2002

I have some questions regarding how globals are represented in DS graph.

Specifically, I wrote the following simple program:

List *g;

void alloc_func(){
  g = ( List* ) malloc( sizeof( List ) );


void free_func(){
  free( g );

int main(){

I noticed that the DSnode for g in alloc_func is different from that of
free_func and NEITHER of them had GlobalNode bit set in their types. Only
the malloc bit and the incomplete bit have been set. I am completely
clueless how to figure out if it is a global node or not. I used
getGlobals and found that the returned map had size 0.

How can I get the "common" global node of g?

More information about the llvm-dev mailing list