Add a way to access argv[0] in hooks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74483 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov
2009-06-30 00:16:00 +00:00
parent 583cf31973
commit 875ace52ee
2 changed files with 27 additions and 0 deletions

View File

@ -71,11 +71,16 @@ namespace {
namespace llvmc {
// Sometimes plugins want to condition on the value in argv[0].
const char* ProgramName;
int Main(int argc, char** argv) {
try {
LanguageMap langMap;
CompilationGraph graph;
ProgramName = argv[0];
cl::ParseCommandLineOptions
(argc, argv, "LLVM Compiler Driver (Work In Progress)", true);