[cfe-commits] r44098 - /cfe/trunk/Driver/RewriteTest.cpp

Steve Naroff snaroff at apple.com
Wed Nov 14 05:44:53 PST 2007


On Nov 13, 2007, at 10:25 PM, Chris Lattner wrote:

>
> On Nov 13, 2007, at 7:37 PM, Steve Naroff wrote:
>
>> void  
>> RewriteTest::RewriteForwardProtocolDecl(ObjcForwardProtocolDecl  
>> *PDecl) {
>>  SourceLocation LocStart = PDecl->getLocation();
>> +  if (LocStart.isInvalid())
>> +    assert(false && "Invalid SourceLocation");
>>  // FIXME: handle forward protocol that are declared across  
>> multiple lines.
>>  Rewrite.ReplaceText(LocStart, 0, "// ", 3);
>> }
>>
>
> Not a big deal, but why not:
>
> assert(LocStart.isValid() && "Invalid SourceLocation");
>
> ?

I had a custom "printf" when I was debugging and replaced it with the  
assert...

Your form is obviously more natural (and what I typically do...).

snaroff

>
>
> -Chris




More information about the cfe-commits mailing list