[cfe-commits] r119518 - /cfe/trunk/examples/clang-interpreter/main.cpp

Dan Gohman gohman at apple.com
Wed Nov 17 09:23:53 PST 2010


Author: djg
Date: Wed Nov 17 11:23:53 2010
New Revision: 119518

URL: http://llvm.org/viewvc/llvm-project?rev=119518&view=rev
Log:
Add a comment explaining why r117813 was needed.

Modified:
    cfe/trunk/examples/clang-interpreter/main.cpp

Modified: cfe/trunk/examples/clang-interpreter/main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/clang-interpreter/main.cpp?rev=119518&r1=119517&r2=119518&view=diff
==============================================================================
--- cfe/trunk/examples/clang-interpreter/main.cpp (original)
+++ cfe/trunk/examples/clang-interpreter/main.cpp Wed Nov 17 11:23:53 2010
@@ -32,6 +32,11 @@
 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.





More information about the cfe-commits mailing list