aleksandr.urakov added a subscriber: labath.
aleksandr.urakov added a comment.

Hello!

I just have tried to patch `CPlusPlusNameParser` in the way to support MSVC 
demangled names, but there is a problem. `CPlusPlusNameParser` splits an 
incoming name in tokens with `clang::Lexer`. I've lexed the next name:

  `anonymous namespace'::foo

The lexer treats the first character (a grave accent) as an unknown token, and 
it's ok for our purposes. Then it sees an identifier (`anonymous`), a keyword 
(`namespace`), and it's ok too. But the problem is with the last part of the 
string. The lexer sees an apostrophe and supposes that it's a character 
constant, it looks for a closing apostrophe, don't find it and treats all the 
line ending (`'::foo`) as a single unknown token.

It is possible to somehow make `clang::Lexer` lex MSVC demangled names 
correctly, but I'm not sure if it is the right place to do it. And it may have 
then some side effects during lexing a real code.

Another option is to somehow preprocess the name before lexing and replace all 
//paired// apostrophes with grave accents, and after lexing replace with 
apostrophes back, and make `CPlusPlusNameParser` understand unknown grave 
accent tokens. But it's a bit tricky, may be you can suggest some better 
solution?


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D52461



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to