[libclc] 146/291: Fix breakage after r211259
Andreas Beckmann
anbe at moszumanska.debian.org
Tue Sep 8 10:53:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
anbe pushed a commit to branch master
in repository libclc.
commit a2daa48c4f97128532808ef511c50e4f9fe7b2e8
Author: Jeroen Ketema <j.ketema at imperial.ac.uk>
Date: Sat Jun 21 09:20:31 2014 +0000
Fix breakage after r211259
While we are here introduce the proper headers for the error code.
Reviewed-by: Tom Stellard <tom at stellard.net>
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@211432 91177308-0d34-0410-b5e6-96231b3b80d8
---
utils/prepare-builtins.cpp | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index c7f013f..20890ed 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -1,4 +1,3 @@
-#include "llvm/ADT/OwningPtr.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
@@ -13,17 +12,24 @@
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Config/config.h"
-using namespace llvm;
-
#define LLVM_350_AND_NEWER \
(LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5))
#if LLVM_350_AND_NEWER
+#include <system_error>
+
#define ERROR_CODE std::error_code
+#define UNIQUE_PTR std::unique_ptr
#else
+#include "llvm/ADT/OwningPtr.h"
+#include "llvm/Support/system_error.h"
+
#define ERROR_CODE error_code
+#define UNIQUE_PTR OwningPtr
#endif
+using namespace llvm;
+
static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
@@ -41,11 +47,7 @@ int main(int argc, char **argv) {
std::auto_ptr<Module> M;
{
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
- std::unique_ptr<MemoryBuffer> BufferPtr;
-#else
- OwningPtr<MemoryBuffer> BufferPtr;
-#endif
+ UNIQUE_PTR<MemoryBuffer> BufferPtr;
if (ERROR_CODE ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
ErrorMessage = ec.message();
else {
@@ -87,7 +89,7 @@ int main(int argc, char **argv) {
}
std::string ErrorInfo;
- OwningPtr<tool_output_file> Out
+ UNIQUE_PTR<tool_output_file> Out
(new tool_output_file(OutputFilename.c_str(), ErrorInfo,
#if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 4)
sys::fs::F_Binary));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git
More information about the Pkg-opencl-commits
mailing list