This patch removes two uses of getenv() to read environment variables related to the MachineVerifier. Instead, it creates a new CMake build variable LLVM_ENABLE_MACHINE_VERIFIER that can be used to achieve the same purpose. There's a little bit of CMake cleverness involved here to minimize the amount of rebuilding required when toggling the flag on or off, which is important in my envisioned use case of staged builders.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
So, I have no problem with this patch or this design. It seems like a nice cleanup.
However, I'll float another idea:
What about adding a getenv call to lit (and maybe a flag) to flip this flag? No rebuild required, etc. Thoughts?
lib/CodeGen/MachineVerifier.cpp | ||
---|---|---|
278 | Why not just set this in the constructor (perhaps from a defaulted argument)? It can also be a reference then. |
Comment Actions
This is something I'd like!
Actually I was thinking that lit could replace "llc" with "llc --verify-machineinstrs" on the RUN line. Do you prefer to keep an environment variable inside LLVM?
Comment Actions
Abandoning this, as Chandler pointed out a better approach on IRC. The patch coming soon.
Why not just set this in the constructor (perhaps from a defaulted argument)? It can also be a reference then.