You should be able to just use cstdlib's getenv
function in your pass, just like in any other C++ code.
Is there a way to access environment variables in an LLVM pass
-
04-08-2022 - |
Question
I was wondering if there was a way to access environment variables while writing an LLVM pass. In my source file, I read a certain environment variable, depending on whose value the execution is furthered. I ought to recreate that in my pass and add a few checks therein.
I would really appreciate if there was some tutorial laying out these details in form of examples.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow