<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/CodeCompletion/nested-name-specifier.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lit] Script to automate use of %(line-n). Use in CodeComplete tests.</title>
<updated>2022-12-19T13:19:21+00:00</updated>
<author>
<name>Sam McCall</name>
<email>sam.mccall@gmail.com</email>
</author>
<published>2022-12-16T14:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cf9b25e0adc42546e4dc5ff51ee8674d45bac26b'/>
<id>cf9b25e0adc42546e4dc5ff51ee8674d45bac26b</id>
<content type='text'>
Tests where the RUN-lines/CHECK-ed output refer to line numbers in the test
file are a maintenance burden, as inserting text in the appropriate place
invalidates all the subsequent line numbers.

Lit supports %(line+n) for this, and FileCheck supports [[@LINE+N]].
But many existing tests don't make use of it and still need to be modified.

This commit adds a script that can find line numbers in tests according to a
regex and replace them with the appropriate relative-line reference.
It contains some options to avoid inappropriately rewriting tests where absolute
numbers are appropriate: a "nearby" threshold and a refusal by default to
replace only some matched line numbers.

I've applied it to CodeComplete tests, this proves the concept but also are the
single worst group of tests I've seen in this respect.
These changes are likely to hit merge conflicts, but can be regenerated with:

```
find ../clang/test/CodeCompletion/ -type f | grep -v /Inputs/ | xargs ../llvm/utils/relative_lines.py --verbose --near=20 --pattern='-code-completion-at[ =]%s:(\\d+):' --pattern='requires fix-it: {(\d+):\d+-(\d+):\d+}'
````

As requested in https://reviews.llvm.org/D140044

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

Differential Revision: https://reviews.llvm.org/D140217
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tests where the RUN-lines/CHECK-ed output refer to line numbers in the test
file are a maintenance burden, as inserting text in the appropriate place
invalidates all the subsequent line numbers.

Lit supports %(line+n) for this, and FileCheck supports [[@LINE+N]].
But many existing tests don't make use of it and still need to be modified.

This commit adds a script that can find line numbers in tests according to a
regex and replace them with the appropriate relative-line reference.
It contains some options to avoid inappropriately rewriting tests where absolute
numbers are appropriate: a "nearby" threshold and a refusal by default to
replace only some matched line numbers.

I've applied it to CodeComplete tests, this proves the concept but also are the
single worst group of tests I've seen in this respect.
These changes are likely to hit merge conflicts, but can be regenerated with:

```
find ../clang/test/CodeCompletion/ -type f | grep -v /Inputs/ | xargs ../llvm/utils/relative_lines.py --verbose --near=20 --pattern='-code-completion-at[ =]%s:(\\d+):' --pattern='requires fix-it: {(\d+):\d+-(\d+):\d+}'
````

As requested in https://reviews.llvm.org/D140044

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

Differential Revision: https://reviews.llvm.org/D140217
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix FileCheck --check-prefix lines.</title>
<updated>2013-08-12T12:51:05+00:00</updated>
<author>
<name>Tim Northover</name>
<email>tnorthover@apple.com</email>
</author>
<published>2013-08-12T12:51:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=19ae1175ae8d2597d16ea5ce7bb9f0993cd6765c'/>
<id>19ae1175ae8d2597d16ea5ce7bb9f0993cd6765c</id>
<content type='text'>
Various tests had sprung up over the years which had --check-prefix=ABC on the
RUN line, but "CHECK-ABC:" later on. This happened to work before, but was
strictly incorrect. FileCheck is getting stricter soon though.

Patch by Ron Ofir.

llvm-svn: 188174
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Various tests had sprung up over the years which had --check-prefix=ABC on the
RUN line, but "CHECK-ABC:" later on. This happened to work before, but was
strictly incorrect. FileCheck is getting stricter soon though.

Patch by Ron Ofir.

llvm-svn: 188174
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve the sorting of code-completion results. We now always sort by</title>
<updated>2010-01-13T23:24:38+00:00</updated>
<author>
<name>Douglas Gregor</name>
<email>dgregor@apple.com</email>
</author>
<published>2010-01-13T23:24:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=52ce62f06964d4212f31a01551b8106794b4cc7e'/>
<id>52ce62f06964d4212f31a01551b8106794b4cc7e</id>
<content type='text'>
the "typed" text, first, then take into account
nested-name-specifiers, name hiding, etc. This means that the
resulting sort is actually alphabetical :)

llvm-svn: 93370
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the "typed" text, first, then take into account
nested-name-specifiers, name hiding, etc. This means that the
resulting sort is actually alphabetical :)

llvm-svn: 93370
</pre>
</div>
</content>
</entry>
<entry>
<title>Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.</title>
<updated>2009-12-15T20:14:24+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-12-15T20:14:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8fbe78f6fc7b41d1a4228c126fcb522131150518'/>
<id>8fbe78f6fc7b41d1a4228c126fcb522131150518</id>
<content type='text'>
 - This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove RUN: true lines.</title>
<updated>2009-11-08T01:47:25+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-11-08T01:47:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=34546ce43d3d89c102a99882ae3825423a28abcd'/>
<id>34546ce43d3d89c102a99882ae3825423a28abcd</id>
<content type='text'>
llvm-svn: 86432
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm-svn: 86432
</pre>
</div>
</content>
</entry>
<entry>
<title>Eliminate &amp;&amp;s in tests.</title>
<updated>2009-11-08T01:45:36+00:00</updated>
<author>
<name>Daniel Dunbar</name>
<email>daniel@zuster.org</email>
</author>
<published>2009-11-08T01:45:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8b576979549184e73c6876ec4b494aacf7c87d2d'/>
<id>8b576979549184e73c6876ec4b494aacf7c87d2d</id>
<content type='text'>
 - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&amp;&amp; *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&amp;&amp; *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace the -code-completion-dump option with </title>
<updated>2009-09-22T21:11:38+00:00</updated>
<author>
<name>Douglas Gregor</name>
<email>dgregor@apple.com</email>
</author>
<published>2009-09-22T21:11:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ea9b03e6e23408325145ca089e4d7d6386b65a2d'/>
<id>ea9b03e6e23408325145ca089e4d7d6386b65a2d</id>
<content type='text'>
  -code-completion-at=filename:line:column

which performs code completion at the specified location by truncating
the file at that position and enabling code completion. This approach
makes it possible to run multiple tests from a single test file, and
gives a more natural command-line interface.

llvm-svn: 82571
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  -code-completion-at=filename:line:column

which performs code completion at the specified location by truncating
the file at that position and enabling code completion. This approach
makes it possible to run multiple tests from a single test file, and
gives a more natural command-line interface.

llvm-svn: 82571
</pre>
</div>
</content>
</entry>
<entry>
<title>In C++ code completion, only suggest the "template" keyword after ".",</title>
<updated>2009-09-18T23:55:56+00:00</updated>
<author>
<name>Douglas Gregor</name>
<email>dgregor@apple.com</email>
</author>
<published>2009-09-18T23:55:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b5c738b4347c5679fc4c2709d151886403e6ba5f'/>
<id>b5c738b4347c5679fc4c2709d151886403e6ba5f</id>
<content type='text'>
"-&gt;", or "::" if we will be looking into a dependent context. It's not
wrong to use the "template" keyword, but it's to needed, either.

llvm-svn: 82307
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"-&gt;", or "::" if we will be looking into a dependent context. It's not
wrong to use the "template" keyword, but it's to needed, either.

llvm-svn: 82307
</pre>
</div>
</content>
</entry>
<entry>
<title>Initial implementation of a code-completion interface in Clang. In</title>
<updated>2009-09-17T21:32:03+00:00</updated>
<author>
<name>Douglas Gregor</name>
<email>dgregor@apple.com</email>
</author>
<published>2009-09-17T21:32:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2436e7116bb1bda26d8b18b4b34a69a6b5d336d3'/>
<id>2436e7116bb1bda26d8b18b4b34a69a6b5d336d3</id>
<content type='text'>
essence, code completion is triggered by a magic "code completion"
token produced by the lexer [*], which the parser recognizes at
certain points in the grammar. The parser then calls into the Action
object with the appropriate CodeCompletionXXX action.

Sema implements the CodeCompletionXXX callbacks by performing minimal
translation, then forwarding them to a CodeCompletionConsumer
subclass, which uses the results of semantic analysis to provide
code-completion results. At present, only a single, "printing" code
completion consumer is available, for regression testing and
debugging. However, the design is meant to permit other
code-completion consumers.

This initial commit contains two code-completion actions: one for
member access, e.g., "x." or "p-&gt;", and one for
nested-name-specifiers, e.g., "std::". More code-completion actions
will follow, along with improved gathering of code-completion results
for the various contexts.

[*] In the current -code-completion-dump testing/debugging mode, the
file is truncated at the completion point and EOF is translated into
"code completion".

llvm-svn: 82166
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
essence, code completion is triggered by a magic "code completion"
token produced by the lexer [*], which the parser recognizes at
certain points in the grammar. The parser then calls into the Action
object with the appropriate CodeCompletionXXX action.

Sema implements the CodeCompletionXXX callbacks by performing minimal
translation, then forwarding them to a CodeCompletionConsumer
subclass, which uses the results of semantic analysis to provide
code-completion results. At present, only a single, "printing" code
completion consumer is available, for regression testing and
debugging. However, the design is meant to permit other
code-completion consumers.

This initial commit contains two code-completion actions: one for
member access, e.g., "x." or "p-&gt;", and one for
nested-name-specifiers, e.g., "std::". More code-completion actions
will follow, along with improved gathering of code-completion results
for the various contexts.

[*] In the current -code-completion-dump testing/debugging mode, the
file is truncated at the completion point and EOF is translated into
"code completion".

llvm-svn: 82166
</pre>
</div>
</content>
</entry>
</feed>
