[Lldb-commits] [PATCH] D54843: [Expr] Check the language before ignoring Objective C keywords

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 26 07:15:29 PST 2018


clayborg requested changes to this revision.
clayborg added inline comments.
This revision now requires changes to proceed.


================
Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:404
-    // non-Apple platforms, but for now it is needed.
-    m_compiler->getLangOpts().ObjC = true;
     break;
----------------
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.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54843/new/

https://reviews.llvm.org/D54843





More information about the lldb-commits mailing list