This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Bail gracefully if given an assembly or IR source file
ClosedPublic

Authored by nridge on Apr 25 2023, 11:23 PM.

Details

Summary

The previous behaviour is to try to parse such files, and in some
cases assert or hang in components that don't expect these forms of
input, like TokenBuffer.

Fixes https://github.com/llvm/llvm-project/issues/62090

Diff Detail

Event Timeline

nridge created this revision.Apr 25 2023, 11:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 11:23 PM
Herald added a subscriber: arphaman. · View Herald Transcript
nridge requested review of this revision.Apr 25 2023, 11:23 PM
nridge added inline comments.Apr 25 2023, 11:26 PM
clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
744

(I could alternatively give TestTU::build() an option to expect failure to build an AST.)

nridge added a comment.Jul 8 2023, 2:50 PM

Review ping

Adding Sam, since you're on a review roll ;)

sammccall accepted this revision.Aug 18 2023, 2:18 AM

Adding Sam, since you're on a review roll ;)

back from vacation :-)

clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
753

(the mangler isn't relevant here I think)

This revision is now accepted and ready to land.Aug 18 2023, 2:18 AM
nridge updated this revision to Diff 551694.Aug 18 2023, 8:25 PM

Address review comment

nridge marked an inline comment as done.Aug 18 2023, 8:26 PM
This revision was landed with ongoing or failed builds.Aug 18 2023, 8:26 PM
This revision was automatically updated to reflect the committed changes.