This is an archive of the discontinued LLVM Phabricator instance.

Revert "Revert "[clang][extract-api] Use relative includes""
ClosedPublic

Authored by zixuw on May 4 2022, 2:26 PM.

Details

Summary

Reapply the change after fixing sanitizer errors.
The original problem was that StringRefs in Matches are pointing to
temporary local std::strings created by path::convert_to_slash in
the regex match call. This patch does the conversion up front in
container FilePath.

This reverts commit 2966f0fa505266735dbc8324b8821b7f0aa901ff.

Diff Detail

Event Timeline

zixuw created this revision.May 4 2022, 2:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 2:26 PM
zixuw requested review of this revision.May 4 2022, 2:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 2:26 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
zixuw updated this revision to Diff 427140.May 4 2022, 2:36 PM

Whitespace change: clang-format removed an empty line

dang accepted this revision.May 4 2022, 2:49 PM

LGTM! If I understand the issue correctly we gave llvm::Regex::match a string temporary to match against before and now we store it for long enough to process the match results?

This revision is now accepted and ready to land.May 4 2022, 2:49 PM
zixuw added a comment.May 4 2022, 2:51 PM

LGTM! If I understand the issue correctly we gave llvm::Regex::match a string temporary to match against before and now we store it for long enough to process the match results?

Yup, exactly.

This revision was landed with ongoing or failed builds.May 4 2022, 2:53 PM
This revision was automatically updated to reflect the committed changes.
clang/lib/ExtractAPI/ExtractAPIConsumer.cpp