Page MenuHomePhabricator

Pass the cmdline aapcs bitfield options to cc1
ClosedPublic

Authored by stuij on Feb 16 2021, 6:48 AM.

Details

Summary

The following commits added commandline arguments to control following the Arm
Procedure Call Standard for certain volatile bitfield operations:

This commit fixes the oversight that these args weren't passed from the driver
to cc1 if appropriate.

Where *appropriate* means:

  • -faapcs-bitfield-width: is the default, so won't be passed
  • -fno-aapcs-bitfield-width: should be passed
  • -faapcs-bitfield-load: should be passed

Diff Detail

Event Timeline

stuij created this revision.Feb 16 2021, 6:48 AM
stuij requested review of this revision.Feb 16 2021, 6:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2021, 6:48 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
simon_tatham accepted this revision.Feb 16 2021, 7:37 AM
This revision is now accepted and ready to land.Feb 16 2021, 7:37 AM

Looks ok but needs tests. See clang/test/Driver for examples of checking -### output.

clang/lib/Driver/ToolChains/Clang.cpp
1525

Name this AddARMAAPCSVolatileBitfieldArgs to match the other helpers.

stuij updated this revision to Diff 324589.Feb 18 2021, 3:46 AM

added unit tests for the cmdline args

clang/lib/Driver/ToolChains/Clang.cpp
1525

I deliberately didn't add ARM to the name as this function is used by both the Arm and AArch64 targets, and ARM would cause confusion. I figured AAPCS is differentiating enough, as it implies Arm without choosing a specific arch.

LGTM with /// for the comments in the test.

clang/lib/Driver/ToolChains/Clang.cpp
1525

Good point. At least one of the A's stands for Arm in any case.

clang/test/Driver/arm-aarch64-bitfield-flags.c
2

Nit: Use /// for comments that aren't run/check lines.

DavidSpickett accepted this revision.Feb 18 2021, 4:12 AM
This revision was automatically updated to reflect the committed changes.