This is an archive of the discontinued LLVM Phabricator instance.

[UpdateCCTestChecks] Detect function mangled name on separate line
ClosedPublic

Authored by greened on Oct 1 2019, 7:29 AM.

Details

Summary

Sometimes functions with large comment blocks in front of them have their declarations output on several lines by c-index-test. Hence the one-line function name/line/mangled pattern will not work to detect them. Break the pattern up into two patterns and keep state after seeing the name/line information until we finally see the mangled name.

Diff Detail

Event Timeline

greened created this revision.Oct 1 2019, 7:29 AM

Can you give an example demonstrating the issue?

Can you give an example demonstrating the issue?

This test:

/***********************************/
/*                                 */
/* A test.                         */
/*                                 */
/***********************************/
int foo(void) {
  return 1;
}

c-index-test -write-pch test.pch test.c
c-index-test -test-print-mangle test.pch

Produces this:

FunctionDecl=foo:6:5 (Definition) RawComment=[/***********************************/] RawCommentRange=[5:1 - 5:38] BriefComment=[********************************] FullCommentAsHTML=[<p class="para-brief">********************************</p>] FullCommentAsXML=[<Function file="/ptmp/dag/test/test.c" line="6" column="5"><Name>foo</Name><USR>c:@F@foo</USR><Declaration>int foo()</Declaration><Abstract><Para>********************************</Para></Abstract></Function>]
// CHECK:  CommentAST=[
// CHECK:    (CXComment_FullComment
// CHECK:       (CXComment_Paragraph
// CHECK:         (CXComment_Text Text=[********************************])))] [mangled=foo]

Note that mangled=foo appears on a separate line.

MaskRay accepted this revision.Oct 7 2019, 7:28 PM
This revision is now accepted and ready to land.Oct 7 2019, 7:28 PM
This revision was automatically updated to reflect the committed changes.