gtbercea created this revision.
gtbercea added reviewers: Hahnfeld, ABataev, caomhin.
Herald added subscribers: cfe-commits, guansong.

When offloading to a device and using the powerpc64le version of the auxiliary 
triple, the _CALL_ELF macro is not set correctly to 2 resulting in the attempt 
to include a header that does not exist. This patch fixes this problem.


Repository:
  rC Clang

https://reviews.llvm.org/D51312

Files:
  lib/Frontend/InitPreprocessor.cpp


Index: lib/Frontend/InitPreprocessor.cpp
===================================================================
--- lib/Frontend/InitPreprocessor.cpp
+++ lib/Frontend/InitPreprocessor.cpp
@@ -1112,8 +1112,12 @@
     Builder.defineMacro("__x86_64__");
     break;
   case llvm::Triple::ppc64:
+    Builder.defineMacro("__powerpc64__");
+    Builder.defineMacro("_CALL_ELF", "1");
+    break;
   case llvm::Triple::ppc64le:
     Builder.defineMacro("__powerpc64__");
+    Builder.defineMacro("_CALL_ELF", "2");
     break;
   default:
     break;


Index: lib/Frontend/InitPreprocessor.cpp
===================================================================
--- lib/Frontend/InitPreprocessor.cpp
+++ lib/Frontend/InitPreprocessor.cpp
@@ -1112,8 +1112,12 @@
     Builder.defineMacro("__x86_64__");
     break;
   case llvm::Triple::ppc64:
+    Builder.defineMacro("__powerpc64__");
+    Builder.defineMacro("_CALL_ELF", "1");
+    break;
   case llvm::Triple::ppc64le:
     Builder.defineMacro("__powerpc64__");
+    Builder.defineMacro("_CALL_ELF", "2");
     break;
   default:
     break;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D51312: [Op... Gheorghe-Teodor Bercea via Phabricator via cfe-commits

Reply via email to