[Lldb-commits] [lldb] r242016 - [LLDB][MIPS] Add mips cores in cores_match () in ArchSpec

Sagar Thakur sagar.thakur at imgtec.com
Mon Jul 13 02:52:07 PDT 2015


Author: slthakur
Date: Mon Jul 13 04:52:06 2015
New Revision: 242016

URL: http://llvm.org/viewvc/llvm-project?rev=242016&view=rev
Log:
[LLDB][MIPS] Add mips cores in cores_match () in ArchSpec

    This patch:
        - Allows mips32 cores to match with any mips32/mips64 cores.
        - Allows mips32r2 cores to match with core only up-to mips32r2/mips64r2.
        - Allows mips32r3 cores to match with core only up-to mips32r3/mips64r3.
        - Allows mips32r5 cores to match with core only up-to mips32r3/mips64r5.
        - Allows mips32r6 core to match with only mips32r6/mips64r6 or mips32/mips64.

Reviewers: emaste, jaydeep, clayborg
Subscribers: mohit.bhakkad, nitesh.jain, bhushan, lldb-commits
Differential Revision: http://reviews.llvm.org/D10921

Modified:
    lldb/trunk/source/Core/ArchSpec.cpp

Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=242016&r1=242015&r2=242016&view=diff
==============================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Mon Jul 13 04:52:06 2015
@@ -1181,11 +1181,46 @@ cores_match (const ArchSpec::Core core1,
         }
         break;
 
+    case ArchSpec::eCore_mips32:
+        if (!enforce_exact_match)
+        {
+            if (core2 >= ArchSpec::kCore_mips32_first && core2 <= ArchSpec::kCore_mips32_last)
+                return true;
+            try_inverse = false;
+        }
+        break;
+
+    case ArchSpec::eCore_mips32el:
+        if (!enforce_exact_match)
+        {
+            if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= ArchSpec::kCore_mips32el_last)
+                return true;
+            try_inverse = false;
+        }
+
     case ArchSpec::eCore_mips64:
+        if (!enforce_exact_match)
+        {
+            if (core2 >= ArchSpec::kCore_mips32_first && core2 <= ArchSpec::kCore_mips32_last)
+                return true;
+            if (core2 >= ArchSpec::kCore_mips64_first && core2 <= ArchSpec::kCore_mips64_last)
+                return true;
+            try_inverse = false;
+        }
+
+    case ArchSpec::eCore_mips64el:
+        if (!enforce_exact_match)
+        {
+            if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= ArchSpec::kCore_mips32el_last)
+                return true;
+            if (core2 >= ArchSpec::kCore_mips64el_first && core2 <= ArchSpec::kCore_mips64el_last)
+                return true;
+            try_inverse = false;
+        }
+
     case ArchSpec::eCore_mips64r2:
     case ArchSpec::eCore_mips64r3:
     case ArchSpec::eCore_mips64r5:
-    case ArchSpec::eCore_mips64r6:
         if (!enforce_exact_match)
         {
             if (core2 >= ArchSpec::kCore_mips32_first && core2 <= (core1 - 10))
@@ -1196,11 +1231,9 @@ cores_match (const ArchSpec::Core core1,
         }
         break;
 
-    case ArchSpec::eCore_mips64el:
     case ArchSpec::eCore_mips64r2el:
     case ArchSpec::eCore_mips64r3el:
     case ArchSpec::eCore_mips64r5el:
-    case ArchSpec::eCore_mips64r6el:
         if (!enforce_exact_match)
         {
             if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= (core1 - 10))
@@ -1211,6 +1244,63 @@ cores_match (const ArchSpec::Core core1,
         }
         break;
 
+    case ArchSpec::eCore_mips32r2:
+    case ArchSpec::eCore_mips32r3:
+    case ArchSpec::eCore_mips32r5:
+        if (!enforce_exact_match)
+        {
+            if (core2 >= ArchSpec::kCore_mips32_first && core2 <= core1)
+                return true;
+        }
+        break;
+
+    case ArchSpec::eCore_mips32r2el:
+    case ArchSpec::eCore_mips32r3el:
+    case ArchSpec::eCore_mips32r5el:
+        if (!enforce_exact_match)
+        {
+            if (core2 >= ArchSpec::kCore_mips32el_first && core2 <= core1)
+                return true;
+        }
+        break;
+
+    case ArchSpec::eCore_mips32r6:
+        if (!enforce_exact_match)
+        {
+            if (core2 == ArchSpec::eCore_mips32 || core2 == ArchSpec::eCore_mips32r6)
+                return true;
+        }
+        break;
+
+    case ArchSpec::eCore_mips32r6el:
+        if (!enforce_exact_match)
+        {
+            if (core2 == ArchSpec::eCore_mips32el || core2 == ArchSpec::eCore_mips32r6el)
+                return true;
+                return true;
+        }
+        break;
+
+    case ArchSpec::eCore_mips64r6:
+        if (!enforce_exact_match)
+        {
+            if (core2 == ArchSpec::eCore_mips32 || core2 == ArchSpec::eCore_mips32r6)
+                return true;
+            if (core2 == ArchSpec::eCore_mips64 || core2 == ArchSpec::eCore_mips64r6)
+                return true;
+        }
+        break;
+
+    case ArchSpec::eCore_mips64r6el:
+        if (!enforce_exact_match)
+        {
+            if (core2 == ArchSpec::eCore_mips32el || core2 == ArchSpec::eCore_mips32r6el)
+                return true;
+            if (core2 == ArchSpec::eCore_mips64el || core2 == ArchSpec::eCore_mips64r6el)
+                return true;
+        }
+        break;
+
     default:
         break;
     }





More information about the lldb-commits mailing list