[libclc] r212470 - prepare-builtins: Fix broken build due to recent LLVM API change
Tom Stellard
thomas.stellard at amd.com
Mon Jul 7 10:46:45 PDT 2014
Author: tstellar
Date: Mon Jul 7 12:46:45 2014
New Revision: 212470
URL: http://llvm.org/viewvc/llvm-project?rev=212470&view=rev
Log:
prepare-builtins: Fix broken build due to recent LLVM API change
Modified:
libclc/trunk/utils/prepare-builtins.cpp
Modified: libclc/trunk/utils/prepare-builtins.cpp
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/utils/prepare-builtins.cpp?rev=212470&r1=212469&r2=212470&view=diff
==============================================================================
--- libclc/trunk/utils/prepare-builtins.cpp (original)
+++ libclc/trunk/utils/prepare-builtins.cpp Mon Jul 7 12:46:45 2014
@@ -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)
More information about the cfe-commits
mailing list