[Lldb-commits] [PATCH] D11790: Fix ObjC++ types Class and id being defined in C and C++ expressions.

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 14 13:27:11 PDT 2015


spyffe added a subscriber: spyffe.
spyffe added a comment.

I totally agree that Objective-C shouldn’t be part of the default on non-Apple platforms.
The way I imagine this working is that your current frame’s language gets “upgraded” – for the Clang expression parser, at least to something that supports C++, but for other languages perhaps something else.
So, supposing e.g. Go gets its own expression parser:

[on Apple]

(current frame -> expression language)
C -> ObjC++
C++ -> ObjC++
ObjC -> ObjC++
Go -> Go)

[on Linux]
C -> C++
C++ -> C++
ObjC -> ObjC++
Go -> Go

The dependency of the Clang expression parser on C++ is an implementation detail, so we should upgrade C/ObjC to C++/ObjC++ internally.
The only settable preference here is whether Objective-C is globally desirable.  Maybe it would be best to just have a simple global setting:

lldb.force-objc-in-clang-expressions = true (on Apple), false (elsewhere)

Sean


http://reviews.llvm.org/D11790





More information about the lldb-commits mailing list