This is an archive of the discontinued LLVM Phabricator instance.

Use LLVM-style include guard in regex_impl.h
ClosedPublic

Authored by hans on May 8 2023, 6:59 AM.

Details

Summary

The previous include guard (_REGEX_H_) is also used in a macOS SDK header (xlocale.h), causing potential for trouble. This was previously addressed in 2b8b90a7686858b1d22cae6fcfbd0904135112aa, but renaming the macro in line with LLVM's other include guards seems like a better fix.

Diff Detail

Event Timeline

hans created this revision.May 8 2023, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2023, 6:59 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
hans requested review of this revision.May 8 2023, 6:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2023, 6:59 AM
thakis accepted this revision.May 8 2023, 7:07 AM
thakis added a reviewer: JDevlieghere.

Makes sense to me.

JDevlieghere, do you remember why you went with that other approach?

This revision is now accepted and ready to land.May 8 2023, 7:08 AM
barannikov88 added inline comments.
llvm/lib/Support/regex_impl.h
108
hans marked an inline comment as done.May 8 2023, 9:55 AM
hans added inline comments.
llvm/lib/Support/regex_impl.h
108

Thanks! Will fix when committing.

This revision was landed with ongoing or failed builds.May 8 2023, 9:56 AM
This revision was automatically updated to reflect the committed changes.
hans marked an inline comment as done.
hans added a comment.May 8 2023, 10:21 AM

JDevlieghere, do you remember why you went with that other approach?

Let's follow up in https://reviews.llvm.org/D150127 which proposes to remove the old work-around.