summaryrefslogtreecommitdiffstats
path: root/libclc/utils
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-01-20 20:28:48 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-01-20 20:28:48 +0000
commit8a63b15b3c54cf87a2b6a5aed7fd0bdb69448bbc (patch)
treecab8b92ea2ff4454ed9d5930480d2aa53b6605b2 /libclc/utils
parent9cacbabd33eea88e9c416e4bc8abf58eebf5589d (diff)
downloadbcm5719-llvm-8a63b15b3c54cf87a2b6a5aed7fd0bdb69448bbc.tar.gz
bcm5719-llvm-8a63b15b3c54cf87a2b6a5aed7fd0bdb69448bbc.zip
Fix build broken by LLVM commit r199279
Patch by: Udo van den Heuvel Tom Stellard: - Added ifdef and error handling llvm-svn: 199687
Diffstat (limited to 'libclc/utils')
-rw-r--r--libclc/utils/prepare-builtins.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/libclc/utils/prepare-builtins.cpp b/libclc/utils/prepare-builtins.cpp
index 4ad21e8c76b..bf856447f25 100644
--- a/libclc/utils/prepare-builtins.cpp
+++ b/libclc/utils/prepare-builtins.cpp
@@ -9,6 +9,7 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/system_error.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Config/config.h"
@@ -34,8 +35,16 @@ int main(int argc, char **argv) {
OwningPtr<MemoryBuffer> BufferPtr;
if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
ErrorMessage = ec.message();
- else
+ else {
+#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
+ ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(BufferPtr.get(), Context);
+ if (error_code ec = ModuleOrErr.getError())
+ ErrorMessage = ec.message();
+ M.reset(ModuleOrErr.get());
+#else
M.reset(ParseBitcodeFile(BufferPtr.get(), Context, &ErrorMessage));
+#endif
+ }
}
if (M.get() == 0) {
OpenPOWER on IntegriCloud