Hi Aaron, Thanks for the feedback.
>> @@ -2974,0 +2975,59 @@ static Expr *BuildFloatingLiteral(Sema &S,
>> NumericLiteralParser &Literal,
>> +bool Sema::DiagnoseLoopHintValue(SourceLocation Loc, Expr *ValueExpr,
>> + StringRef OptionName) {
>
> This should take a const Expr * and a const IdentifierInfo *.
I changed the option to an identifier info. However, the source location here
is the location of the value not the option. I retained it so we can make sure
the carrot points to the right thing. If I missed a way to get the location
from the value expr please let me know.
>> + CXXScopeSpec SS;
>> + ExprResult DRE = BuildDeclRefExpr(D, D->getType().getNonReferenceType(),
>> + VK_LValue, TemplateLoc, &SS);
>> +
>> + if (DRE.isInvalid()) {
>> + Diag(Tok.getLocation(), diag::err_pragma_loop_invalid_value) <<
>> OptionName;
>> + return ExprError();
>> + }
>> +
>> + DRE.get()->setValueDependent(true);
>
> Also, should there be acessibility checks, since the lookup can
> find members and those members may be visible, but inaccessible?
I’m not exactly sure what you mean here. Is it something like #pragma loop
vectorize(Foo.bar) where bar is a private member of Foo? Can non-type template
parameters be inaccessible?
>> @@ -5426,3 +5434,17 @@ TreeTransform<Derived>::TransformLabelStmt(LabelStmt
>> *S) {
>> -template<typename Derived>
>> -StmtResult
>> -TreeTransform<Derived>::TransformAttributedStmt(AttributedStmt *S) {
>> +template <typename Derived>
>> +const Attr *TreeTransform<Derived>::TransformAttr(const Attr *A) {
>> + return A;
>> +}
>> +
>> +template <typename Derived>
>> +StmtResult TreeTransform<Derived>::TransformAttributedStmt(AttributedStmt
>> *S) {
>
> I think that declaration attributes should get the same treatment.
Declaration don’t use an equivalent to attributed stmt. From what I can tell
declaration attributes are transformed using a tablegen generated function
instantiateTemplateAttribute(). The generated function iterates over the
arguments of each attribute and calls SubstExpr that calls TransformExpr. Humm…
it may be possible to use this method for transforming LoopHintAttrs. I will
look into it more.
In the mean time here are my latest patches.
Thanks,
Tyler
pragma_pragmagroup.patch
Description: Binary data
pragma_nontypetemplate.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
