Yes that's what I meant to do. That said, I will probably solve this by remove the calls to initialize all targets from CodeGen altogether and move them directly into ClangCheck.cpp. http://reviews.llvm.org/D11016