Use an existing function.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 12 Oct 2011 01:24:51 +0000 (01:24 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 12 Oct 2011 01:24:51 +0000 (01:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141763 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/TargetLowering.cpp

index c6eeebe606e9e4cbebee2a9b847baf039c2a924c..c2a58c6357ad0d7b4efed1a902ae104412ba5154 100644 (file)
@@ -2760,16 +2760,8 @@ getRegForInlineAsmConstraint(const std::string &Constraint,
 
     // If none of the value types for this register class are valid, we
     // can't use it.  For example, 64-bit reg classes on 32-bit targets.
-    bool isLegal = false;
-    for (TargetRegisterClass::vt_iterator I = RC->vt_begin(), E = RC->vt_end();
-         I != E; ++I) {
-      if (isTypeLegal(*I)) {
-        isLegal = true;
-        break;
-      }
-    }
-
-    if (!isLegal) continue;
+    if (!isLegalRC(RC))
+      continue;
 
     for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end();
          I != E; ++I) {