aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-08-27 20:16:20 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-08-27 20:16:20 +0000
commit7af5d66ba0cc1748eea30a42f0c479d8c9c4c779 (patch)
treeac73386a558a692422ce1f380cb02820c8ce4206 /clang/lib/Frontend/InitPreprocessor.cpp
parent15f5407d92c6b02a0f70f44872cfc0122ea3fe52 (diff)
downloadllvm-7af5d66ba0cc1748eea30a42f0c479d8c9c4c779.zip
llvm-7af5d66ba0cc1748eea30a42f0c479d8c9c4c779.tar.gz
llvm-7af5d66ba0cc1748eea30a42f0c479d8c9c4c779.tar.bz2
[OpenMP][NVPTX] Use appropriate _CALL_ELF macro when offloading
Summary: 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. Reviewers: Hahnfeld, ABataev, caomhin Reviewed By: Hahnfeld Subscribers: guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D51312 llvm-svn: 340772
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 0519255..01a74d1 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -1106,14 +1106,19 @@ static void InitializePredefinedAuxMacros(const TargetInfo &AuxTI,
auto AuxTriple = AuxTI.getTriple();
// Define basic target macros needed by at least bits/wordsize.h and
- // bits/mathinline.h
+ // bits/mathinline.h.
+ // On PowerPC, explicitely set _CALL_ELF macro needed for gnu/stubs.h.
switch (AuxTriple.getArch()) {
case llvm::Triple::x86_64:
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;