search for: some_env_var

Displaying 1 result from an estimated 1 matches for "some_env_var".

2013 Nov 26
0
[LLVMdev] Help needed with a pass
I'm a newbie to LLVM and I've really been struggling to write a pass which changes the behavior of the following function: #include<stdlib.h>#include<stdio.h>#include<string.h>void foo(char* bar){const char* path;path=getenv(<SOME_ENV_VAR>); if (path!=NULL){strcpy(bar,path);}else{printf("env_var not set!");}} In the pass, I hope to invoke strncpy(dest,src,n) instead of strcpy(dest,src). After looking at the IR, this is what I've got so far: #include <stdlib.h>#include <stdio.h>#include "llvm/Pass.h&...