On Fri, May 23, 2014 at 2:41 PM, Tyler Nowicki <[email protected]> wrote:
> Hi, > > As requested here is the patch to support non-type template parameters in > #pragma loop. The patch uses LookupName to build a DeclRefExpr to the > template parameter and overloads TransformAttr in the template instantiator > to transform the value expression and replace the LoopHintAttr. It is built > on the PragmaAttr and Pragma Spelling patch listed in the 'Add PragmaAttr > and Pragma Spelling to Tablegen’ thread. Since it is a git patch please use > ‘patch -p1’ to apply it. > This seems like fundamentally the wrong approach to me. It doesn't make much sense to me to accept only an identifier here; at a minimum you should accept an id-expression, and ideally you should accept any constant-expression. And that in turn means your approach of parsing the pragma from the lexer is unworkable -- you need to move the parsing logic to the parser in order to be able to actually parse an id-expression / constant-expression. See HandlePragmaMSPragma for an example of an existing pragma that does this. Is there some pre-existing standard / specification we're implementing here, or is this a pragma of our own invention? Also: + if (ValueName == "enable" || ValueName == "disable") + return ExprEmpty(); If this is a pragma we invented, can we design it such that we don't have an ambiguity between its pseudo-keywords and its identifier lookup?
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
