summaryrefslogtreecommitdiffstats
path: root/utils/not
diff options
context:
space:
mode:
Diffstat (limited to 'utils/not')
-rw-r--r--utils/not/CMakeLists.txt2
-rw-r--r--utils/not/Makefile6
-rw-r--r--utils/not/not.cpp16
3 files changed, 17 insertions, 7 deletions
diff --git a/utils/not/CMakeLists.txt b/utils/not/CMakeLists.txt
index 407c82e..155d2e3 100644
--- a/utils/not/CMakeLists.txt
+++ b/utils/not/CMakeLists.txt
@@ -2,7 +2,7 @@ add_executable(not
not.cpp
)
-target_link_libraries(not LLVMSystem)
+target_link_libraries(not LLVMSupport)
if( MINGW )
target_link_libraries(not imagehlp psapi)
endif( MINGW )
diff --git a/utils/not/Makefile b/utils/not/Makefile
index fef4802..f37f166 100644
--- a/utils/not/Makefile
+++ b/utils/not/Makefile
@@ -1,15 +1,15 @@
##===- utils/not/Makefile ----------------------------------*- Makefile -*-===##
-#
+#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
-#
+#
##===----------------------------------------------------------------------===##
LEVEL = ../..
TOOLNAME = not
-USEDLIBS = LLVMSupport.a LLVMSystem.a
+USEDLIBS = LLVMSupport.a
# This tool has no plugins, optimize startup time.
TOOL_NO_EXPORTS = 1
diff --git a/utils/not/not.cpp b/utils/not/not.cpp
index dd89b8f..9a924b5 100644
--- a/utils/not/not.cpp
+++ b/utils/not/not.cpp
@@ -7,11 +7,21 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/System/Path.h"
-#include "llvm/System/Program.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Support/Program.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
int main(int argc, const char **argv) {
sys::Path Program = sys::Program::FindProgramByName(argv[1]);
- return !sys::Program::ExecuteAndWait(Program, argv + 1);
+
+ std::string ErrMsg;
+ int Result = sys::Program::ExecuteAndWait(Program, argv + 1, 0, 0, 0, 0,
+ &ErrMsg);
+ if (Result < 0) {
+ errs() << "Error: " << ErrMsg << "\n";
+ return 1;
+ }
+
+ return Result == 0;
}
OpenPOWER on IntegriCloud