This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][bugfix] Add missing macros for Power
AbandonedPublic

Authored by gtbercea on Aug 29 2018, 11:09 AM.

Details

Summary

Add missing macros when the auxiliary triple points to the PPC architecture.

Diff Detail

Repository
rC Clang

Event Timeline

gtbercea created this revision.Aug 29 2018, 11:09 AM
Hahnfeld requested changes to this revision.Aug 30 2018, 4:28 AM

Please also update the test.

lib/Frontend/InitPreprocessor.cpp
1115–1130

I'd suggest to merge these two:

case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
  Builder.defineMacro("__powerpc64__");

  StringRef ABI = AuxTI.getABI();
  // Set _CALL_ELF macro needed for gnu/stubs.h
  if (ABI == "elfv1" || ABI == "elfv1-qpx")
    Builder.defineMacro("_CALL_ELF", "1");
  if (ABI == "elfv2")
    Builder.defineMacro("_CALL_ELF", "2");

  // TODO: Add comment where this is needed and for what reason.
  if (AuxTI.getLongDoubleWidth() == 128) {
    Builder.defineMacro("__LONG_DOUBLE_128__");
    Builder.defineMacro("__LONGDOUBLE128");
  }
  break;
This revision now requires changes to proceed.Aug 30 2018, 4:28 AM
kkwli0 added a subscriber: kkwli0.Aug 30 2018, 6:49 AM

Need to update the test too?

Not needed anymore after the reverts in rC341115 and rC341118, right? Maybe we should revive the test to make sure we don't break this in the future?

gtbercea abandoned this revision.Jun 12 2019, 10:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2019, 10:12 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript