On Dec 31, 2010, at 7:05 PM, Chris Lattner wrote:

>> 
>> 1. Pinned local variables are treated no differently than normal local 
>> variables except when they are used as operands for inline asm. This is what 
>> Rafael's patch implements. I suppose you could warn if such a variable is 
>> never used for inline asm.
> 
> Yes, this sounds right.  The warning should be something like "warning: 
> register assignment ignored" to give people a head's up that they have 
> useless code.

This warning should be straight-forward to implement: just add an 'isused' bit 
on AsmLabelAttr and set it in AddVariableConstraits.

Rafael, could you tackle this if you get a chance?  Also, please add a doxygen 
comment to AddVariableConstraits and s/Constraits/Constraints/.

One other question, what valid code does this ErrorUnsupported reject?  Should 
it just be a normal error?

+  if (!Target.isValidGCCRegisterName(Register)) {
+    CGM.ErrorUnsupported(Variable, "__asm__");
+    return Constraint;
+  }

Thanks!

-Chris
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to