<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/CodeCompletion/operator.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>[CodeComplete] Fix completion at the end of keywords</title>
<updated>2018-04-24T13:48:53+00:00</updated>
<author>
<name>Ilya Biryukov</name>
<email>ibiryukov@google.com</email>
</author>
<published>2018-04-24T13:48:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b3510c4254fb912045f1ded84df255d20ac0a1d1'/>
<id>b3510c4254fb912045f1ded84df255d20ac0a1d1</id>
<content type='text'>
Summary:
Make completion behave consistently no matter if it is run at the
start, in the middle or at the end of an identifier that happens to
be a keyword or a macro name. Since completion is often ran on
incomplete identifiers, they may turn into keywords by accident.

For example, we should produce same results for all of these
completion points:

    // ^ is completion point.
    ^class
    cla^ss
    class^

Previously clang produced different results for the last case (as if
the completion point was after a space: `class ^`).

This change also updates some offsets in tests that (unintentionally?)
relied on the old behavior.

Reviewers: sammccall, bkramer, arphaman, aaron.ballman

Reviewed By: sammccall

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D45887

llvm-svn: 330717
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Make completion behave consistently no matter if it is run at the
start, in the middle or at the end of an identifier that happens to
be a keyword or a macro name. Since completion is often ran on
incomplete identifiers, they may turn into keywords by accident.

For example, we should produce same results for all of these
completion points:

    // ^ is completion point.
    ^class
    cla^ss
    class^

Previously clang produced different results for the last case (as if
the completion point was after a space: `class ^`).

This change also updates some offsets in tests that (unintentionally?)
relied on the old behavior.

Reviewers: sammccall, bkramer, arphaman, aaron.ballman

Reviewed By: sammccall

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D45887

llvm-svn: 330717
</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>Tweak the code-completion results ranking and formation, so that</title>
<updated>2009-09-22T23:15:58+00:00</updated>
<author>
<name>Douglas Gregor</name>
<email>dgregor@apple.com</email>
</author>
<published>2009-09-22T23:15:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5bf52697b079b4b7c9db9a38c202788743d7264d'/>
<id>5bf52697b079b4b7c9db9a38c202788743d7264d</id>
<content type='text'>
members found in base classes have the same ranking as members found
in derived classes. However, we will introduce an informative note for
members found in base classes, showing (as a nested-name-specifier)
the qualification to name the base class, to make it clear which
members are from bases.
 

llvm-svn: 82586
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
members found in base classes have the same ranking as members found
in derived classes. However, we will introduce an informative note for
members found in base classes, showing (as a nested-name-specifier)
the qualification to name the base class, to make it clear which
members are from bases.
 

llvm-svn: 82586
</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>C++ code completion after the "operator" keyword. Provide overloaded</title>
<updated>2009-09-18T20:05:18+00:00</updated>
<author>
<name>Douglas Gregor</name>
<email>dgregor@apple.com</email>
</author>
<published>2009-09-18T20:05:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c811ede9b7cb930a1463e2d9e9a077d62ee00107'/>
<id>c811ede9b7cb930a1463e2d9e9a077d62ee00107</id>
<content type='text'>
operators, type specifiers, type names, and nested-name-specifiers.

llvm-svn: 82264
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
operators, type specifiers, type names, and nested-name-specifiers.

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