prepare-builtins: Use std:: prefix for error_code

This fixes the build with with newer LLVM.

llvm-svn: 210867
This commit is contained in:
Tom Stellard 2014-06-13 01:30:14 +00:00
parent bff5d0d16a
commit 0ab103422d

View File

@ -15,6 +15,15 @@
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
#define ERROR_CODE std::error_code
#else
#define ERROR_CODE error_code
#endif
static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
@ -37,12 +46,12 @@ int main(int argc, char **argv) {
#else
OwningPtr<MemoryBuffer> BufferPtr;
#endif
if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
if (ERROR_CODE ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))
ErrorMessage = ec.message();
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())
if (ERROR_CODE ec = ModuleOrErr.getError())
ErrorMessage = ec.message();
M.reset(ModuleOrErr.get());
#else