[llvm-commits] CVS: llvm/include/llvm/Transforms/LinkAllPasses.h

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 23 17:09:02 PDT 2005



Changes in directory llvm/include/llvm/Transforms:

LinkAllPasses.h updated: 1.20 -> 1.21
---
Log message:

There is no need for this to be VC++ only


---
Diffs of the changes:  (+6 -15)

 LinkAllPasses.h |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)


Index: llvm/include/llvm/Transforms/LinkAllPasses.h
diff -u llvm/include/llvm/Transforms/LinkAllPasses.h:1.20 llvm/include/llvm/Transforms/LinkAllPasses.h:1.21
--- llvm/include/llvm/Transforms/LinkAllPasses.h:1.20	Tue Oct 18 20:41:47 2005
+++ llvm/include/llvm/Transforms/LinkAllPasses.h	Sun Oct 23 19:08:51 2005
@@ -7,17 +7,14 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This header file is required for building with Microsoft's VC++, as it has
-// no way of linking all registered passes into executables other than by
-// explicit use.
+// This header file pulls in all transformation passes for tools like opts and
+// bugpoint that need this functionality.
 //
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_TRANSFORMS_LINKALLPASSES_H
 #define LLVM_TRANSFORMS_LINKALLPASSES_H
 
-#ifdef _MSC_VER
-
 #include "llvm/Analysis/Passes.h"
 #include "llvm/Analysis/LoadValueNumbering.h"
 #include "llvm/CodeGen/Passes.h"
@@ -25,20 +22,16 @@
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-
-// Trying not to include <windows.h>, though maybe we should... Problem is,
-// it pollutes the global namespace in some really nasty ways.
-extern "C" __declspec(dllimport) void* __stdcall GetCurrentProcess();
+#include <cstdlib>
 
 namespace {
   struct ForcePassLinking {
     ForcePassLinking() {
-      // We must reference the passes in such a way that VC++ will not
+      // We must reference the passes in such a way that compilers will not
       // delete it all as dead code, even with whole program optimization,
       // yet is effectively a NO-OP. As the compiler isn't smart enough
-      // to know that GetCurrentProcess() never returns
-      // INVALID_HANDLE_VALUE, this will do the job.
-      if (GetCurrentProcess() != (void *) -1)
+      // to know that getenv() never returns -1, this will do the job.
+      if (std::getenv("bar") != (char*) -1)
         return;
 
       (void) llvm::createAAEvalPass();
@@ -120,6 +113,4 @@
   } _ForcePassLinking;
 };
 
-#endif // _MSC_VER
-
 #endif






More information about the llvm-commits mailing list