[cfe-commits] Patch for review: add a fixit to remove an unused label.

Chris Lattner clattner at apple.com
Wed Jul 27 14:12:54 PDT 2011


On Jul 27, 2011, at 1:57 PM, Anna Zaks wrote:
>> In Lexer.h, please also add a non-static version of FindLocationAfterToken which doesn't require LangOpts and SourceMgr, just as a convenience (it should forward to the version you already have).
>> 
> 
> Lexer does not currently have a SourceMgr member. Adding a non-static method just for the convenience of not passing LangOpts might be an overkill?

Aha, ok!

>> 
>> SourceLocation loc..
>> 
>> Please capitalize local variable names.
>> 
>> +  // Lex from the start of the given location.
>> +  Lexer lexer(SM.getLocForStartOfFile(locInfo.first), LangOpts, file.begin(),
>> +                                      tokenBegin, file.end());
>> 
>> it seems that it would be more convenient to use this Lexer ctor:
>> 
>>   Lexer(FileID FID, const llvm::MemoryBuffer *InputBuffer,
>>         const SourceManager &SM, const LangOptions &Features);
>> 
> 
> We need the lexer to start processing the buffer starting from the specific position Loc. This constructor seems to be convenient if we were to start lexing from the beginning of the file.

ok!

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110727/aee63372/attachment.html>


More information about the cfe-commits mailing list