[libclc] r210867 - prepare-builtins: Use std:: prefix for error_code
Rafael EspĂndola
rafael.espindola at gmail.com
Fri Jun 13 06:03:42 PDT 2014
thanks! Is there a buildbot building this?
On 12 June 2014 21:30, Tom Stellard <thomas.stellard at amd.com> wrote:
> Author: tstellar
> Date: Thu Jun 12 20:30:14 2014
> New Revision: 210867
>
> URL: http://llvm.org/viewvc/llvm-project?rev=210867&view=rev
> Log:
> prepare-builtins: Use std:: prefix for error_code
>
> This fixes the build with with newer LLVM.
>
> 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=210867&r1=210866&r2=210867&view=diff
> ==============================================================================
> --- libclc/trunk/utils/prepare-builtins.cpp (original)
> +++ libclc/trunk/utils/prepare-builtins.cpp Thu Jun 12 20:30:14 2014
> @@ -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
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list