[Lldb-commits] [PATCH] D63622: [Target] Hoist LanguageRuntime::GetDeclVendor

Saleem Abdulrasool via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 21 09:21:04 PDT 2019


compnerd added inline comments.


================
Comment at: include/lldb/Target/LanguageRuntime.h:137
 
+  virtual DeclVendor *GetDeclVendor() { return nullptr; }
+
----------------
Can this not be `const`?  Seems like retrieving the vendor should not mutate the runtime.


================
Comment at: source/API/SBTarget.cpp:1850
+    // Didn't find the type in the symbols; Try the loaded language runtimes
+    if (ProcessSP process_sp = target_sp->GetProcessSP()) {
+      for (auto *runtime : process_sp->GetLanguageRuntimes()) {
----------------
`auto` should be fine, the type is spelt out.



================
Comment at: source/API/SBTarget.cpp:1851
+    if (ProcessSP process_sp = target_sp->GetProcessSP()) {
+      for (auto *runtime : process_sp->GetLanguageRuntimes()) {
+        if (auto vendor = runtime->GetDeclVendor()) {
----------------
Can this not be `const auto *runtime`?


================
Comment at: source/API/SBTarget.cpp:1912
+    // Try the loaded language runtimes
+    if (ProcessSP process_sp = target_sp->GetProcessSP()) {
+      for (auto *runtime : process_sp->GetLanguageRuntimes()) {
----------------
`auto` should be fine, the type is spelt out in the method.


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

https://reviews.llvm.org/D63622





More information about the lldb-commits mailing list