Alejandro Serrano Mena
10/21/2021, 8:16 PMFirTypeAttributeExtension
ensured to be run over all possible functions before the next steps in the analysis continue; if not, what is the best way to perform this?
• the analysis works in two stages; what is the best way for a FIR plug-in to introduce several stages?
thanks very much in advance!dmitriy.novozhilov
10/22/2021, 11:22 AMwe need to scrape information from all functions in the CLASSPATH with a certain attributeIn FIR plugins which generate some declarations we don't provide a way to lookup whole classpath, because cost of such operation is too high (which blocks using of such plugin in IDE). All you can do is: 1. Get symbol for declarations with specific `classId`/`callableId` 2. Get all declarations from source code which are matching some annotation based predicate (e.g. "all classes annotated with
@foo.Ann
)
And what do you mean by "attribute of function"?dmitriy.novozhilov
10/22/2021, 11:22 AMwhat is the best way for a FIR plug-in to introduce several stages?I didn't get it, can you please elaborate your question?
dmitriy.novozhilov
10/22/2021, 11:26 AMAlejandro Serrano Mena
10/22/2021, 11:52 AMdmitriy.novozhilov
10/22/2021, 12:02 PMI see no other way of getting this informationWhat is your usecase for this? And
FirTypeAttributeExtension
is used for extending type system, not for collecting any info for declarations
with “stages” I mean have a series of steps in your analysisPlugins are integrated with predefined frontend phases and can not introduce additional ones, because in IDE there are no guaranties that whole world will be resolved to specific phase before running next one (moreover it's almost never true) Can you also provide usecase for this too?
Alejandro Serrano Mena
10/22/2021, 2:16 PMrequire
blocks
3. then we go into the bodies of the declarations and ensure that the preconditions for all method calls are satisfied
right now we stage (2) and (3) by performing (2), and then using a Retry
in the compiler; a mutable variable with the current stage points towards which is the thing to be done in each casedmitriy.novozhilov
10/22/2021, 3:23 PMdmitriy.novozhilov
10/22/2021, 3:24 PMAlejandro Serrano Mena
10/22/2021, 3:56 PMAlejandro Serrano Mena
10/22/2021, 3:57 PMAlejandro Serrano Mena
10/22/2021, 3:58 PMAlejandro Serrano Mena
10/22/2021, 3:59 PM