At the same time, fixes InstructionsTest::CastInst unittest: yes
you can leave the IR in an invalid state and exit when you don't
destroy the context (like the global one), no longer now.
Details
Diff Detail
Event Timeline
Red diffs are the best diffs.
lib/Target/Target.cpp | ||
---|---|---|
16 | This tends to be a compile time disaster. Can you add a comment that it is for the global context and that we want to kill it eventually ? Maybe you could declare the function locally instead of importing the whole Core.h thing ? |
This looks awesome, but maybe split this in two? One changes all uses and
another does the removal just in case we find something in another project?
tools/lli/lli.cpp | ||
---|---|---|
388 | I guess it might cause undefined behavior. See do_shutdown(). Appeased in r266441, or we should do;
|
Tried to clean it in r266652 by removing global variables in lli.
Thanks for the notification!
If anyone comes here looking for a fix on the client side, there is a very easy solution:
LLVMContext &getMyLLVMGlobalContext() { static LLVMContext MyGlobalContext; return MyGlobalContext; }
I encourage people to avoid global mutable state in general though :)
This tends to be a compile time disaster. Can you add a comment that it is for the global context and that we want to kill it eventually ?
Maybe you could declare the function locally instead of importing the whole Core.h thing ?