<div dir="ltr">BTW, I am not aware of anyone actively developing/testing/using the renderscript support in lldb, and I wouldn't be surprised if it has actually bitrotted. I think this is also one of the things we could consider removing if it turns out it's standing in the way of making progress elsewhere.<div><br></div><div>pl</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 1 Feb 2020 at 07:07, Alex Langford via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Alex Langford<br>
Date: 2020-01-31T22:05:23-08:00<br>
New Revision: 2637769b9f38010082276b7b839a17b102d1ac93<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/2637769b9f38010082276b7b839a17b102d1ac93" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/2637769b9f38010082276b7b839a17b102d1ac93</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/2637769b9f38010082276b7b839a17b102d1ac93.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/2637769b9f38010082276b7b839a17b102d1ac93.diff</a><br>
<br>
LOG: [lldb] Remove LanguageRuntime::GetOverrideExprOptions<br>
<br>
LanguageRuntime::GetOverrideExprOptions is specific to clang and was<br>
only overridden in RenderScriptRuntime. LanguageRuntime in shouldn't<br>
have any knowledge of clang, so remove it from LanguageRuntime and leave<br>
it only in RenderScriptRuntime.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    lldb/include/lldb/Target/LanguageRuntime.h<br>
    lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt<br>
    lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp<br>
    lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/lldb/include/lldb/Target/LanguageRuntime.h b/lldb/include/lldb/Target/LanguageRuntime.h<br>
index 73c8dfa3874d..7af6cd2e91ff 100644<br>
--- a/lldb/include/lldb/Target/LanguageRuntime.h<br>
+++ b/lldb/include/lldb/Target/LanguageRuntime.h<br>
@@ -21,8 +21,6 @@<br>
 #include "lldb/lldb-private.h"<br>
 #include "lldb/lldb-public.h"<br>
<br>
-#include "clang/Basic/TargetOptions.h"<br>
-<br>
 namespace lldb_private {<br>
<br>
 class ExceptionSearchFilter : public SearchFilter {<br>
@@ -162,13 +160,6 @@ class LanguageRuntime : public PluginInterface {<br>
<br>
   virtual void ModulesDidLoad(const ModuleList &module_list) {}<br>
<br>
-  // Called by the Clang expression evaluation engine to allow runtimes to<br>
-  // alter the set of target options provided to the compiler. If the options<br>
-  // prototype is modified, runtimes must return true, false otherwise.<br>
-  virtual bool GetOverrideExprOptions(clang::TargetOptions &prototype) {<br>
-    return false;<br>
-  }<br>
-<br>
   // Called by ClangExpressionParser::PrepareForExecution to query for any<br>
   // custom LLVM IR passes that need to be run before an expression is<br>
   // assembled and run.<br>
<br>
diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt<br>
index 3bb120a48e90..909e92ace8d4 100644<br>
--- a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt<br>
+++ b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt<br>
@@ -41,6 +41,7 @@ add_lldb_library(lldbPluginExpressionParserClang PLUGIN<br>
     lldbPluginCPlusPlusLanguage<br>
     lldbPluginCPPRuntime<br>
     lldbPluginObjCRuntime<br>
+    lldbPluginRenderScriptRuntime<br>
     lldbPluginTypeSystemClang<br>
   CLANG_LIBS<br>
     clangAST<br>
<br>
diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp<br>
index 1516d5b0277b..3faf6f238b23 100644<br>
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp<br>
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp<br>
@@ -91,6 +91,7 @@<br>
 #include "lldb/Utility/StringList.h"<br>
<br>
 #include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"<br>
+#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"<br>
<br>
 #include <cctype><br>
 #include <memory><br>
@@ -392,9 +393,13 @@ ClangExpressionParser::ClangExpressionParser(<br>
   // target. In this case, a specialized language runtime is available and we<br>
   // can query it for extra options. For 99% of use cases, this will not be<br>
   // needed and should be provided when basic platform detection is not enough.<br>
-  if (lang_rt)<br>
+  // FIXME: Generalize this. Only RenderScriptRuntime currently supports this<br>
+  // currently. Hardcoding this isn't ideal but it's better than LanguageRuntime<br>
+  // having knowledge of clang::TargetOpts.<br>
+  if (auto *renderscript_rt =<br>
+          llvm::dyn_cast_or_null<RenderScriptRuntime>(lang_rt))<br>
     overridden_target_opts =<br>
-        lang_rt->GetOverrideExprOptions(m_compiler->getTargetOpts());<br>
+        renderscript_rt->GetOverrideExprOptions(m_compiler->getTargetOpts());<br>
<br>
   if (overridden_target_opts)<br>
     if (log && log->GetVerbose()) {<br>
<br>
diff  --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h<br>
index c3740ba55a11..2fec7dcf4f6e 100644<br>
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h<br>
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h<br>
@@ -24,6 +24,10 @@<br>
<br>
 #include "Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h"<br>
<br>
+namespace clang {<br>
+class TargetOptions;<br>
+};<br>
+<br>
 namespace lldb_private {<br>
 namespace lldb_renderscript {<br>
<br>
@@ -402,6 +406,8 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime {<br>
     return false;<br>
   }<br>
<br>
+  bool GetOverrideExprOptions(clang::TargetOptions &prototype);<br>
+<br>
   // PluginInterface protocol<br>
   lldb_private::ConstString GetPluginName() override;<br>
<br>
@@ -577,8 +583,6 @@ class RenderScriptRuntime : public lldb_private::CPPLanguageRuntime {<br>
   // any previous stored allocation which has the same address.<br>
   AllocationDetails *CreateAllocation(lldb::addr_t address);<br>
<br>
-  bool GetOverrideExprOptions(clang::TargetOptions &prototype) override;<br>
-<br>
   bool GetIRPasses(LLVMUserExpression::IRPasses &passes) override;<br>
 };<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>