]> granicus.if.org Git - clang/commitdiff
Add a comment explaining why r117813 was needed.
authorDan Gohman <gohman@apple.com>
Wed, 17 Nov 2010 17:23:53 +0000 (17:23 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 17 Nov 2010 17:23:53 +0000 (17:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119518 91177308-0d34-0410-b5e6-96231b3b80d8

examples/clang-interpreter/main.cpp

index 2866c44c3c959ca1356977fc28baf9e51a6c2914..1890848f3501bd43301947a5a7b88100916637a9 100644 (file)
 using namespace clang;
 using namespace clang::driver;
 
+// This function isn't referenced outside its translation unit, but it
+// can't use the "static" keyword because its address is used for
+// GetMainExecutable (since some platforms don't support taking the
+// address of main, and some platforms can't implement GetMainExecutable
+// without being given the address of a function in the main executable).
 llvm::sys::Path GetExecutablePath(const char *Argv0) {
   // This just needs to be some symbol in the binary; C++ doesn't
   // allow taking the address of ::main however.