[Lldb-commits] [PATCH] D11102: Set the default language to use when evaluating to that of the frame's CU.

Dawn Perchik via lldb-commits lldb-commits at lists.llvm.org
Sat Aug 29 10:09:05 PDT 2015


dawn added a comment.

Thanks so much for your reviews!  I'll post a revised patch Monday.


================
Comment at: include/lldb/Target/StackFrame.h:475-476
@@ +474,4 @@
+    //------------------------------------------------------------------
+    lldb::LanguageType
+    GetDefaultExpressionLanguage ();
+
----------------
jingham wrote:
> This name seems confusing.  This is just the language of the current stack frame.  Deciding what language to use for the expression is just one possible use of this information.  It might also be useful to have the frame format print the language of the frame you've just stopped in.  So this should have a more generic name.  How about "GetLanguage".
Sure, GetLanguage is fine.  I went with GetDefaultExpressionLanguage because that is what Greg suggested in http://reviews.llvm.org/D11482.

================
Comment at: source/Expression/ClangExpressionParser.cpp:220-228
@@ +219,11 @@
+        //
+        // In http://reviews.llvm.org/D11482 Jim writes "Sean doesn't have a DESIRE to
+        // have the expression parser use ObjC++ anytime the language is a C family
+        // language. Rather he MUST right now, because the expression parser uses
+        // features of C++ to capture values. We could switch to using C++ in C/C++
+        // situations, and ObjC++ in others, but there wasn't sufficient motivation to
+        // add that. Sometime when we get some spare cycles we'll try to relax the need
+        // for C++, and then we'll truly be able to follow the frame language. For now,
+        // we do "Want C -> get ObjC++", "Want ObjC -> get ObjC++" etc... But again,
+        // that is not a fundamental choice, it is an implementation necessity.
+        m_compiler->getLangOpts().CPlusPlus = true;
----------------
jingham wrote:
> The contents of this comment are fine, but just state the reason rather than describing how you found out about the reason...
will do.


http://reviews.llvm.org/D11102





More information about the lldb-commits mailing list