From 3fcdada6b479edc68072a7f7eb9fd5af35ee0606 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Tue, 30 Jun 2009 00:16:00 +0000 Subject: Add a way to access argv[0] in hooks. llvm-svn: 74483 --- llvm/lib/CompilerDriver/Main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/CompilerDriver/Main.cpp') diff --git a/llvm/lib/CompilerDriver/Main.cpp b/llvm/lib/CompilerDriver/Main.cpp index 6807a830063..3a2917032ec 100644 --- a/llvm/lib/CompilerDriver/Main.cpp +++ b/llvm/lib/CompilerDriver/Main.cpp @@ -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); -- cgit v1.2.3