[Lldb-commits] [PATCH] D17022: [LLDB][MIPS] Provide CPU string to compiler for appropriate code generation for MIPS

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 9 12:50:14 PST 2016


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

We should use local variable and avoid calling accessors many times. See inlined comments. I know the code was like this before, but we should fix these things as we go.


================
Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:178
@@ -177,1 +177,3 @@
 
+    ArchSpec arch;
+    if (target_sp)
----------------
name this "target_arch"

================
Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:197-198
@@ -192,4 +196,4 @@
 
     if (target_sp->GetArchitecture().GetMachine() == llvm::Triple::x86 ||
         target_sp->GetArchitecture().GetMachine() == llvm::Triple::x86_64)
     {
----------------
Many people are playing with the Target arhitecture's machine, please put this in a local variable and use it to avoid calling the access many times.

```
const auto target_machine = target_arch.GetMachine();
```

================
Comment at: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:204-208
@@ -199,1 +203,7 @@
 
+    if (arch.GetMachine() == llvm::Triple::mips ||
+        arch.GetMachine() == llvm::Triple::mipsel ||
+        arch.GetMachine() == llvm::Triple::mips64 ||
+        arch.GetMachine() == llvm::Triple::mips64el)
+    {
+        std::string cpu;
----------------
Use "target_machine"


Repository:
  rL LLVM

http://reviews.llvm.org/D17022





More information about the lldb-commits mailing list