[llvm] r180044 - Fix unused variable warning.

Chad Rosier mcrosier at apple.com
Mon Apr 22 15:40:38 PDT 2013


On Apr 22, 2013, at 3:17 PM, Benjamin Kramer <benny.kra at gmail.com> wrote:

> 
> On 22.04.2013, at 22:42, Chad Rosier <mcrosier at apple.com> wrote:
> 
>> Author: mcrosier
>> Date: Mon Apr 22 15:42:32 2013
>> New Revision: 180044
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=180044&view=rev
>> Log:
>> Fix unused variable warning.
>> 
>> Modified:
>>   llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
>> 
>> Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=180044&r1=180043&r2=180044&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Apr 22 15:42:32 2013
>> @@ -1130,7 +1130,7 @@ X86AsmParser::CreateMemForInlineAsm(unsi
>>                                    InlineAsmIdentifierInfo &Info){
>> 
>> 
>> -  if (const MCSymbolRefExpr *SymRef = dyn_cast<MCSymbolRefExpr>(Disp)) {
>> +  if (Disp && isa<MCSymbolRefExpr>(Disp)) {
> 
> dyn_cast doesn't allow NULLs, so you probably don't have to check if Disp is NULL here.

You are correct. Committed revision 180059.  Thanks, Ben.

 Chad

> 
> - Ben
> 
>>    // If this is not a VarDecl then assume it is a FuncDecl or some other label
>>    // reference.  We need an 'r' constraint here, so we need to create register
>>    // operand to ensure proper matching.  Just pick a GPR based on the size of
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130422/df87e799/attachment.html>


More information about the llvm-commits mailing list