[foreign-jextract] [Rev 01] RFR: 8239809: Need API to access attributes
    Maurizio Cimadamore 
    mcimadamore at openjdk.java.net
       
    Tue Feb 25 21:18:31 UTC 2020
    
    
  
On Tue, 25 Feb 2020 18:12:36 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> The pull request has been updated with 1 additional commit.
> 
> src/jdk.incubator.jextract/share/classes/jdk/incubator/jextract/Declaration.java line 295:
> 
>> 294:      */
>> 295:     static Declaration.Variable globalVariable(Position pos, String name, Type type, Map<String, List<ConstantDesc>> attrs) {
>> 296:         return new DeclarationImpl.VariableImpl(type, Declaration.Variable.Kind.GLOBAL, name, pos, attrs);
> 
> Uhmmm. I think I'd prefer not to have a Map accepting factory, but to have a `Declaration::withAttribute(String, ConstantDesc)` method. This makes the API a lot tidier (and is similar to what we did for layouts).
Also, I think we need a method to drop all attributes.
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/33
    
    
More information about the panama-dev
mailing list