[llvm-dev] strdup vs __strdup?
carr27 via llvm-dev
llvm-dev at lists.llvm.org
Wed Oct 14 15:04:12 PDT 2015
For background, I'm writing a pass and would like to find all
instructions that could allocate memory, but this question mainly
I'm seeing that calls to strdup are getting replaced by calls to
__strdup when I compile with -O2. Can anyone tell me why and what the
The replacement is a minor issue for me because isAllocationFn doesn't
return true for calls to __strdup (but it does for strdup). My current
workaround is to check the name of every called function.
Also, if there are any other functions that are replaced (like strdup is
with __strdup), that'd be useful information to me.
My test case is . I'm getting the bitcode using Module.print inside
my pass.  is without -O2 and  is with -O2. My pass is in CodeGen
in case that is relevant.
Maybe this has been asked before but it's difficult to Google :)
More information about the llvm-dev