diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-07-07 17:46:45 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-07-07 17:46:45 +0000 |
commit | 0ec7437d9c9be1df92872217ec22a15aa56abcf5 (patch) | |
tree | adff942d14a256c883af196fabf3611d211c1ea2 /utils | |
parent | 61127c58ffe9a798cf0b3403efe9b1bbfcb80a5f (diff) |
prepare-builtins: Fix broken build due to recent LLVM API change
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@212470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/prepare-builtins.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp index 20890ed..ce84148 100644 --- a/utils/prepare-builtins.cpp +++ b/utils/prepare-builtins.cpp @@ -47,8 +47,15 @@ int main(int argc, char **argv) { std::auto_ptr<Module> M; { +#if LLVM_350_AND_NEWER + ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr = + MemoryBuffer::getFile(InputFilename); + std::unique_ptr<MemoryBuffer> &BufferPtr = BufferOrErr.get(); + if (std::error_code ec = BufferOrErr.getError()) +#else UNIQUE_PTR<MemoryBuffer> BufferPtr; if (ERROR_CODE ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr)) +#endif ErrorMessage = ec.message(); else { #if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4) |