Page MenuHomePhabricator

[CUDA] Fix grep pattern in cuda-types.cu
ClosedPublic

Authored by hubert.reinterpretcast on Jun 7 2019, 3:05 PM.

Details

Summary

vertical-line is not a BRE special character.

POSIX.1-2017 XBD Section 9.3.2 indicates that the interpretation of \| is undefined. This patch uses EREs instead.

Additionally, the pattern is further fixed so that SIZEOF and WIDTH macros are checked.

Diff Detail

Repository
rL LLVM

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2019, 3:05 PM
Herald added subscribers: jsji, jfb. · View Herald Transcript
tra added a subscriber: tra.Jun 7 2019, 3:11 PM
tra added inline comments.
test/Preprocessor/cuda-types.cu
11 ↗(On Diff #203631)

I believe that was a typo in the original test. It should be TYPE|MAX|SIZEOF|WIDTH now.
SIZEOF and WIDTH are parts of different defines we're looking for.

E.g

#define __SIZEOF_DOUBLE__ 8
...
#define __INTPTR_WIDTH__ 32
tra added a reviewer: tra.Jun 7 2019, 3:14 PM
tra removed a subscriber: tra.
test/Preprocessor/cuda-types.cu
11 ↗(On Diff #203631)

I can give that a try. I'll update on the status of whether the test passes once SIZEOF and WIDTH is actually tested.

Fix grep pattern in cuda-types.cu

As requested, further fix so that the SIZEOF and WIDTH macros are checked.

hubert.reinterpretcast retitled this revision from [NFC][CUDA] Avoid undefined grep in cuda-types.cu to [CUDA] Fix grep pattern in cuda-types.cu.Jun 7 2019, 6:12 PM
hubert.reinterpretcast edited the summary of this revision. (Show Details)
hubert.reinterpretcast marked 3 inline comments as done.
hubert.reinterpretcast added inline comments.
test/Preprocessor/cuda-types.cu
11 ↗(On Diff #203631)

The test still passes after updating the pattern to pick up SIZEOF and WIDTH macros. I've updated the patch.

tra accepted this revision.Jun 10 2019, 9:19 AM
This revision is now accepted and ready to land.Jun 10 2019, 9:19 AM
This revision was automatically updated to reflect the committed changes.
hubert.reinterpretcast marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2019, 3:26 PM