[cfe-commits] r122643 - in /cfe/trunk: lib/CodeGen/CGDecl.cpp	lib/CodeGen/CGStmt.cpp test/CodeGen/asm-variable.c
    Chris Lattner 
    clattner at apple.com
       
    Fri Dec 31 19:15:01 PST 2010
    
    
  
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
    
    
More information about the cfe-commits
mailing list