[llvm-commits] [llvm] r142013 - /llvm/trunk/lib/VMCore/Function.cpp
Chris Lattner
sabre at nondot.org
Fri Oct 14 15:50:21 PDT 2011
Author: lattner
Date: Fri Oct 14 17:50:21 2011
New Revision: 142013
URL: http://llvm.org/viewvc/llvm-project?rev=142013&view=rev
Log:
constify array itself, don't iterate multiple times.
Modified:
llvm/trunk/lib/VMCore/Function.cpp
Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=142013&r1=142012&r2=142013&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Fri Oct 14 17:50:21 2011
@@ -417,7 +417,7 @@
/// FIXME: Remove after <rdar://problem/8031714> is fixed.
/// FIXME: Is the above FIXME valid?
bool Function::callsFunctionThatReturnsTwice() const {
- static const char *ReturnsTwiceFns[] = {
+ static const char *const ReturnsTwiceFns[] = {
"_setjmp",
"setjmp",
"sigsetjmp",
@@ -442,7 +442,7 @@
if (!F)
continue;
StringRef Name = F->getName();
- for (unsigned J = 0; J < array_lengthof(ReturnsTwiceFns); ++J) {
+ for (unsigned J = 0, e = array_lengthof(ReturnsTwiceFns); J != e; ++J) {
if (Name == ReturnsTwiceFns[J])
return true;
}
More information about the llvm-commits
mailing list