[Lldb-commits] [PATCH] D54843: [Expr] Check the language before ignoring Objective C keywords
Aleksandr Urakov via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 27 03:43:43 PST 2018
aleksandr.urakov marked 2 inline comments as done.
aleksandr.urakov added inline comments.
================
Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:404
- // non-Apple platforms, but for now it is needed.
- m_compiler->getLangOpts().ObjC = true;
break;
----------------
clayborg wrote:
> A better way would be to try and grab the Objective C runtime from the process. There are some variants of objective C that might run under non-apple targets:
>
> ```
> ProcessSP process_sp = target->GetProcess();
> if (process_sp)
> m_compiler->getLangOpts().ObjC = process_sp->GetLanguageRuntime(eLanguageTypeObjC) != nullptr;
> ```
>
> Then C and C++ programs on Mac will be able to use "id" and other reserved words in their expressions again.
Thanks for the idea! I've updated the patch.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54843/new/
https://reviews.llvm.org/D54843
More information about the lldb-commits
mailing list