Please also include a test that the produced lvalue actually has the right
value. Something like:
int &test7(bool cond) {
return cond ? throw 1 : val;
}
... and check that the value returned is @_Z3val
On Tue, Jun 10, 2014 at 3:01 PM, Marius Wachtler <[email protected]> wrote:
> Hi
> Attached you can find an updates patch.
>
>
>
>
> On Tue, Jun 10, 2014 at 11:50 PM, David Majnemer <[email protected]
> > wrote:
>
>> +
>>> + case Expr::CXXThrowExprClass: {
>>> + const auto* throwExpr = cast<CXXThrowExpr>(E);
>>>
>>
>> Please stick the star on the RHS. Also, it is customary in LLVM and clang
>> to spell it like "ThrowExpr"
>>
>>
>>> + EmitCXXThrowExpr(throwExpr);
>>> + const QualType subExprType = throwExpr->getSubExpr()->getType();
>>>
>>
>> Likewise for "subExprType"
>>
>> + llvm::Type *Ty =
>>> llvm::PointerType::getUnqual(ConvertType(subExprType));
>>> + return MakeAddrLValue(llvm::UndefValue::get(Ty), subExprType);
>>> }
>>
>>
>>
>> On Tue, Jun 10, 2014 at 5:19 PM, Marius Wachtler <[email protected]>
>> wrote:
>>
>>> Hello
>>>
>>> Attached you can find my first clang patch which should implement
>>> "cond ? throw 1 : val".
>>>
>>> Without this patch I get: "cannot compile this l-value expression yet"
>>>
>>> As this is my first time looking under the hood of clang I'm not sure if
>>> this is the right approach. I'm Looking forward to your feedback.
>>>
>>> - Marius Wachtler
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> [email protected]
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>
>>>
>>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits