passlab / ompparser

ompparser: A Standalone and Unified OpenMP Parser
https://github.com/passlab/ompparser
Other
5 stars 1 forks source link

Bug in passing parameters to the variadic function #74

Closed ouankou closed 4 years ago

ouankou commented 4 years ago

To add new clauses, we need to pass a different number of parameters. However, the passed parameter has to have a primitive data type, such as int and char. Variadic function can know how to extract each parameter. If we pass a vector directly, there's no way to know how long this vector is and when will the next parameter start. This is the reason why the code has a compilation error on Clang/LLVM. In the parser, we need to only pass int or char parameters to the addClause function. The rest parameters are added by corresponding methods after clause creation. For example, during parsing we hold the iterators in depend clause and create a new clause without iterators. Then we call the function addIterators to append those iterators.

ouankou commented 4 years ago

It's been fixed in the commits https://github.com/passlab/ompparser/commit/478b9614aa1066b074932ecb977a0ae357b6b0fc and https://github.com/passlab/ompparser/commit/01686e2e433d524ebdb0aeaf91eb4e25f4b5b931.

Only primitive data types are passed. The rightmost named argument can't be a promotable type.