[llvm] r187224 - Collapse conditional and add an assert for unhandled scope types.

Bill Wendling wendling at apple.com
Fri Jul 26 15:47:39 PDT 2013


Thanks. :-) It does work, but has two drawbacks:

1) It's not as readable without the parens, and
B) I think that some compilers will complain about not having the parens.

-bw

On Jul 26, 2013, at 2:18 PM, Eric Christopher <echristo at gmail.com> wrote:

> It ends up working, but it's subtle. Parens added in r187247.
> 
> -eric
> 
> On Fri, Jul 26, 2013 at 2:06 PM, Robinson, Paul
> <Paul_Robinson at playstation.sony.com> wrote:
>>> -----Original Message-----
>>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
>>> bounces at cs.uiuc.edu] On Behalf Of Eric Christopher
>>> Sent: Friday, July 26, 2013 10:45 AM
>>> To: llvm-commits at cs.uiuc.edu
>>> Subject: [llvm] r187224 - Collapse conditional and add an assert for
>>> unhandled scope types.
>>> 
>>> Author: echristo
>>> Date: Fri Jul 26 12:45:19 2013
>>> New Revision: 187224
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=187224&view=rev
>>> Log:
>>> Collapse conditional and add an assert for unhandled scope types.
>>> 
>>> Modified:
>>>    llvm/trunk/lib/IR/DebugInfo.cpp
>>> 
>>> Modified: llvm/trunk/lib/IR/DebugInfo.cpp
>>> URL: http://llvm.org/viewvc/llvm-
>>> project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=187224&r1=187223&r2=187224&v
>>> iew=diff
>>> ========================================================================
>>> ======
>>> --- llvm/trunk/lib/IR/DebugInfo.cpp (original)
>>> +++ llvm/trunk/lib/IR/DebugInfo.cpp Fri Jul 26 12:45:19 2013
>>> @@ -711,9 +711,7 @@ DIScope DIScope::getContext() const {
>>>   if (isNameSpace())
>>>     return DINameSpace(DbgNode).getContext();
>>> 
>>> -  if (isFile() || isCompileUnit())
>>> -    return DIScope();
>>> -
>>> +  assert(isFile() || isCompileUnit() && "Unhandled type of scope.");
>> 
>> Wants to be this, I think...
>>  +  assert((isFile() || isCompileUnit()) && "Unhandled type of scope.");
>> 
>> --paulr
>> 
>>>   return DIScope();
>>> }
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list