[Libclc-dev] [PATCH v3 libclc 1/2] Fix build against LLVM SVN >= r216393

Aaron Watry awatry at gmail.com
Wed Aug 27 10:00:55 PDT 2014


Both patches look good to me and they fix the build (and run) on my evergreen.

Do you have commit access, or will you need someone to push this for
you eventually?

--Aaron

On Tue, Aug 26, 2014 at 10:47 PM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>
> v3: Put LLVM_360_AND_NEWER in #endif comment as well
>
>  utils/prepare-builtins.cpp | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
> index 726866e..afa64a8 100644
> --- a/utils/prepare-builtins.cpp
> +++ b/utils/prepare-builtins.cpp
> @@ -12,6 +12,9 @@
>  #include "llvm/Support/ToolOutputFile.h"
>  #include "llvm/Config/llvm-config.h"
>
> +#define LLVM_360_AND_NEWER \
> +  (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6))
> +
>  #define LLVM_350_AND_NEWER \
>    (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5))
>
> @@ -95,6 +98,15 @@ int main(int argc, char **argv) {
>      return 1;
>    }
>
> +#if LLVM_360_AND_NEWER
> +  std::error_code EC;
> +  UNIQUE_PTR<tool_output_file> Out
> +  (new tool_output_file(OutputFilename, EC, sys::fs::F_None));
> +  if (EC) {
> +    errs() << EC.message() << '\n';
> +    exit(1);
> +  }
> +#else
>    std::string ErrorInfo;
>    UNIQUE_PTR<tool_output_file> Out
>    (new tool_output_file(OutputFilename.c_str(), ErrorInfo,
> @@ -109,6 +121,7 @@ int main(int argc, char **argv) {
>      errs() << ErrorInfo << '\n';
>      exit(1);
>    }
> +#endif // LLVM_360_AND_NEWER
>
>    WriteBitcodeToFile(M.get(), Out->os());
>
> --
> 2.1.0
>
>
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev




More information about the Libclc-dev mailing list