diff options
author | Craig Topper <craig.topper@gmail.com> | 2015-10-21 02:34:10 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2015-10-21 02:34:10 +0000 |
commit | 55765ca54a994e331ef82667f2188e552915b9bd (patch) | |
tree | 59b861e4791d4618b3c6b480419c7168d4930b2e /clang/lib/Basic/TargetInfo.cpp | |
parent | 1a59c6b2c967e76cd5e5d9884e47da133a430e52 (diff) | |
download | bcm5719-llvm-55765ca54a994e331ef82667f2188e552915b9bd.tar.gz bcm5719-llvm-55765ca54a994e331ef82667f2188e552915b9bd.zip |
Use ArrayRef and MutableArrayRef instead of a pointer and size. NFC
llvm-svn: 250876
Diffstat (limited to 'clang/lib/Basic/TargetInfo.cpp')
-rw-r--r-- | clang/lib/Basic/TargetInfo.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp index 21368f8b114..eca3a6f710f 100644 --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/lib/Basic/TargetInfo.cpp @@ -510,8 +510,7 @@ bool TargetInfo::validateOutputConstraint(ConstraintInfo &Info) const { } bool TargetInfo::resolveSymbolicName(const char *&Name, - ConstraintInfo *OutputConstraints, - unsigned NumOutputs, + ArrayRef<ConstraintInfo> OutputConstraints, unsigned &Index) const { assert(*Name == '[' && "Symbolic name did not start with '['"); Name++; @@ -526,16 +525,16 @@ bool TargetInfo::resolveSymbolicName(const char *&Name, std::string SymbolicName(Start, Name - Start); - for (Index = 0; Index != NumOutputs; ++Index) + for (Index = 0; Index != OutputConstraints.size(); ++Index) if (SymbolicName == OutputConstraints[Index].getName()) return true; return false; } -bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints, - unsigned NumOutputs, - ConstraintInfo &Info) const { +bool TargetInfo::validateInputConstraint( + MutableArrayRef<ConstraintInfo> OutputConstraints, + ConstraintInfo &Info) const { const char *Name = Info.ConstraintStr.c_str(); if (!*Name) @@ -556,7 +555,7 @@ bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints, return false; // Check if matching constraint is out of bounds. - if (i >= NumOutputs) return false; + if (i >= OutputConstraints.size()) return false; // A number must refer to an output only operand. if (OutputConstraints[i].isReadWrite()) @@ -579,7 +578,7 @@ bool TargetInfo::validateInputConstraint(ConstraintInfo *OutputConstraints, break; case '[': { unsigned Index = 0; - if (!resolveSymbolicName(Name, OutputConstraints, NumOutputs, Index)) + if (!resolveSymbolicName(Name, OutputConstraints, Index)) return false; // If the constraint is already tied, it must be tied to the |