summaryrefslogtreecommitdiff
path: root/lib/CompilerDriver
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-06-30 00:16:00 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-06-30 00:16:00 +0000
commit875ace52ee52c9100cf80a1f0229d26b77963a11 (patch)
tree3c181d261bb571981f4efd0adb0220d73e7e720e /lib/CompilerDriver
parent583cf319731fc50aac0413bf2f508f4991c81615 (diff)
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
Diffstat (limited to 'lib/CompilerDriver')
-rw-r--r--lib/CompilerDriver/Main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CompilerDriver/Main.cpp b/lib/CompilerDriver/Main.cpp
index 6807a830063..3a2917032ec 100644
--- a/lib/CompilerDriver/Main.cpp
+++ b/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);