This is an archive of the discontinued LLVM Phabricator instance.

[libclang] add supporting for indexing/visiting C++ concepts
ClosedPublic

Authored by arphaman on May 19 2022, 4:14 PM.

Details

Summary

This patch builds upon recently added indexing support for C++ concepts from https://reviews.llvm.org/D124441 by extending libclang to support indexing and visiting concepts, constraints and requires expressions as well.

Diff Detail

Event Timeline

arphaman created this revision.May 19 2022, 4:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2022, 4:14 PM
Herald added a subscriber: ributzka. · View Herald Transcript
arphaman requested review of this revision.May 19 2022, 4:14 PM

Looks like index-concepts.cpp is failing on Windows, @arphaman could you please take a look?

Yes, I'm going to check what's wrong with it.

arphaman updated this revision to Diff 431506.May 23 2022, 3:49 PM

Fix the windows test failure (add -fno-delayed-template-parsing)

Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 3:49 PM
egorzhdan accepted this revision.May 24 2022, 9:00 AM

I'm not super familiar with concepts but this LGTM, thanks!

This revision is now accepted and ready to land.May 24 2022, 9:00 AM
This revision was landed with ongoing or failed builds.May 24 2022, 10:03 AM
This revision was automatically updated to reflect the committed changes.

Hi, these tests fail on AIX, could you take a look please?

https://lab.llvm.org/buildbot/#/builders/214/builds/1489

Sure, investigating.

@Jake-Egan
Do you happen to have suggestions for how to try to reproduce this? Looking at the failure it looks like this CI job somehow was unable to be affected by this change, for instance the CI output of index-concept-kind.cpp does not have any concepts output:

+ : 'RUN: at line 1'
+ /scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/bin/c-index-test -index-file /scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Index/index-concept-kind.cpp -std=gnu++20
+ /scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/bin/FileCheck /scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Index/index-concept-kind.cpp
/scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Index/index-concept-kind.cpp:5:11: error: CHECK: expected string not found in input
// CHECK: [indexDeclaration]: kind: concept | name: LargeType | USR: c:@CT@LargeType | lang: C | cursor: ConceptDecl=LargeType:[[@LINE-1]]:9 (Definition) | loc: [[@LINE-1]]:9 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 0 | isImplicit: 0
          ^
<stdin>:1:1: note: scanning from here
[startedTranslationUnit]
^
<stdin>:1:1: note: with "@LINE-1" equal to "4"
[startedTranslationUnit]
^
<stdin>:1:1: note: with "@LINE-1" equal to "4"
[startedTranslationUnit]
^
Input file: <stdin>
Check file: /scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Index/index-concept-kind.cpp
-dump-input=help explains the following input dump.
Input was:
<<<<<<
           1: [startedTranslationUnit] 
check:5'0     X~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:5'1                               with "@LINE-1" equal to "4"
check:5'2                               with "@LINE-1" equal to "4"
           2: [enteredMainFile]: /scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Index/index-concept-kind.cpp 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: [indexDeclaration]: kind: function-template | name: f | USR: c:@FT@>1#Tf#v# | lang: C++ | cursor: FunctionDecl=f:9:6 | loc: 9:6 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 0 | isContainer: 0 | isImplicit: 0 
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

So far I was unable to reproduce this locally, and all the other CI jobs seem to pass.

@Jake-Egan
I'm going to disable these tests for aix for now to unblock the bot as they're still failing.

Jake-Egan added a comment.EditedMay 24 2022, 5:46 PM

@arphaman Thanks for the quick action. The tests pass on a clean build https://lab.llvm.org/buildbot/#/builders/214/builds/1493, so that's probably why there was trouble reproducing. I think we could revert 1b34f1e996565bc5e4f2be14b89f881f8fe0f3b9.

Reverted: https://reviews.llvm.org/rGbe3fc66f83b0