aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-10-24 00:08:51 +0000
committerChris Lattner <sabre@nondot.org>2005-10-24 00:08:51 +0000
commit9b2b56ef758ea93082817d421b3fc4cea6daf99e (patch)
treea2928ff039d4d9ec4e84b7ec4414ce14aab6b02b
parent3db4b62c2fa43b23fa02d32a7d3253885acafb9f (diff)
There is no need for this to be VC++ only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23915 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Transforms/LinkAllPasses.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/include/llvm/Transforms/LinkAllPasses.h b/include/llvm/Transforms/LinkAllPasses.h
index 333e721f8a..4ea75cc258 100644
--- a/include/llvm/Transforms/LinkAllPasses.h
+++ b/include/llvm/Transforms/LinkAllPasses.h
@@ -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 @@ namespace {
} _ForcePassLinking;
};
-#endif // _MSC_VER
-
#endif