diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-10 20:58:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-10 20:58:42 +0000 |
commit | 775aba249500147d5dcf54caad61f519af139a1d (patch) | |
tree | 1d016e8b9a18bda05de6748d915c7fe4e2fcd8c5 | |
parent | fd450c026ae0e804da7025d3318551b203d584a9 (diff) |
Simplify by using startswith instead of substr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103430 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Verifier.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 6ad427218d..819a5cba72 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1152,7 +1152,7 @@ void Verifier::VerifyCallSite(CallSite CS) { Assert1(CS.arg_size() == FTy->getNumParams(), "Incorrect number of arguments passed to called function!", I); - // Verify that all arguments to the call match the function type... + // Verify that all arguments to the call match the function type. for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) Assert3(CS.getArgument(i)->getType() == FTy->getParamType(i), "Call parameter type does not match function signature!", @@ -1180,7 +1180,7 @@ void Verifier::VerifyCallSite(CallSite CS) { // Verify that there's no metadata unless it's a direct call to an intrinsic. if (!CS.getCalledFunction() || CS.getCalledFunction()->getName().size() < 5 || - CS.getCalledFunction()->getName().substr(0, 5) != "llvm.") { + !CS.getCalledFunction()->getName().startswith("llvm.")) { for (FunctionType::param_iterator PI = FTy->param_begin(), PE = FTy->param_end(); PI != PE; ++PI) Assert1(!PI->get()->isMetadataTy(), |