[cfe-commits] r59887 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp

Fariborz Jahanian fjahanian at apple.com
Sat Nov 22 14:45:17 PST 2008


On Nov 22, 2008, at 2:39 PM, Fariborz Jahanian wrote:

> This patch has broken many of the tests.

% clang 2007-11-29-ArraySizeFromInitializer.c -S
Assertion failed: (0 && "unhandled value kind!"), function  
EmitConstantExpr, file CGExprConstant.cpp, line 862.
0   clang                               0x00b84661  + 45
1   clang                               0x00b847cc  + 325
2   libSystem.B.dylib                   0x945f3e4b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libSystem.B.dylib                   0x9466a653 raise + 26
5   libSystem.B.dylib                   0x9467c283 abort + 93
6   libSystem.B.dylib                   0x9466bb8a __assert_rtn + 252
7   clang                               0x004c51b2  
_ZN5clang7CodeGen13CodeGenModule16EmitConstantExprEPKNS_4ExprEPNS0_15CodeGenFunctionE 
  + 204
8   clang                               0x004f42f3  
_ZN5clang7CodeGen13CodeGenModule23EmitGlobalVarDefinitionEPKNS_7VarDeclE 
  + 223
9   clang                               0x004f5199  
_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionEPKNS_9ValueDeclE 
  + 91
10  clang                               0x004f53a8  
_ZN5clang7CodeGen13CodeGenModule10EmitGlobalEPKNS_9ValueDeclE + 476
11  clang                               0x004f5cac  
_ZN5clang7CodeGen13CodeGenModule16EmitTopLevelDeclEPNS_4DeclE + 280
12  clang                               0x00502d16  + 58
13  clang                               0x0002f6df  + 41
14  clang                               0x0058f5fe  
_ZN5clang8ParseASTERNS_12PreprocessorEPNS_11ASTConsumerEbb + 538
15  clang                               0x00060fdc  + 1185
16  clang                               0x000630e2 main + 2053
17  clang                               0x0002636d start + 53


>
>
> - Fariborz
>
> On Nov 22, 2008, at 2:32 PM, Anders Carlsson wrote:
>
>> Author: andersca
>> Date: Sat Nov 22 16:32:07 2008
>> New Revision: 59887
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=59887&view=rev
>> Log:
>> An expression is not foldable if it can't be fully evaluated. Fixes
>> PR3060
>>
>> Modified:
>>   cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
>>
>> Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=59887&r1=59886&r2=59887&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> = 
>> =====================================================================
>> --- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Sat Nov 22 16:32:07  
>> 2008
>> @@ -197,8 +197,10 @@
>>
>>  // FIXME: Rename and handle conversion of other evaluatable things
>>  // to bool.
>> -  if (!Cond->Evaluate(V, getContext()) || !V.isInt())
>> -    return 0;  // Not foldable or not integer.
>> +  bool isEvaluated;
>> +  if (!Cond->Evaluate(V, getContext(), &isEvaluated) || !V.isInt()  
>> ||
>> +      !isEvaluated)
>> +    return 0;  // Not foldable, not integer or not fully  
>> evaluatable.
>>
>>  if (CodeGenFunction::ContainsLabel(Cond))
>>    return 0;  // Contains a label.
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list