[llvm] r240847 - Minor style cleanup after 240843 [NFC]
Philip Reames
listmail at philipreames.com
Fri Jun 26 15:21:52 PDT 2015
Author: reames
Date: Fri Jun 26 17:21:52 2015
New Revision: 240847
URL: http://llvm.org/viewvc/llvm-project?rev=240847&view=rev
Log:
Minor style cleanup after 240843 [NFC]
Use a for-each loop in one case and rename the function to reflect it's new usage.
Modified:
llvm/trunk/lib/IR/Verifier.cpp
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=240847&r1=240846&r2=240847&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Fri Jun 26 17:21:52 2015
@@ -370,7 +370,7 @@ private:
void visitSelectInst(SelectInst &SI);
void visitUserOp1(Instruction &I);
void visitUserOp2(Instruction &I) { visitUserOp1(I); }
- void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallSite CS);
+ void visitIntrinsicCallSite(Intrinsic::ID ID, CallSite CS);
template <class DbgIntrinsicTy>
void visitDbgIntrinsic(StringRef Kind, DbgIntrinsicTy &DII);
void visitAtomicCmpXchgInst(AtomicCmpXchgInst &CXI);
@@ -2294,7 +2294,7 @@ void Verifier::VerifyCallSite(CallSite C
if (Function *F = CS.getCalledFunction())
if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID())
- visitIntrinsicFunctionCall(ID, CS);
+ visitIntrinsicCallSite(ID, CS);
visitInstruction(*I);
}
@@ -3140,9 +3140,8 @@ Verifier::VerifyIntrinsicIsVarArg(bool i
return true;
}
-/// visitIntrinsicFunction - Allow intrinsics to be verified in different ways.
-///
-void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallSite CS) {
+/// Allow intrinsics to be verified in different ways.
+void Verifier::visitIntrinsicCallSite(Intrinsic::ID ID, CallSite CS) {
Function *IF = CS.getCalledFunction();
Assert(IF->isDeclaration(), "Intrinsic functions should never be defined!",
IF);
@@ -3187,9 +3186,9 @@ void Verifier::visitIntrinsicFunctionCal
// If the intrinsic takes MDNode arguments, verify that they are either global
// or are local to *this* function.
- for (unsigned i = 0, e = CS.getNumArgOperands(); i != e; ++i)
- if (auto *MD = dyn_cast<MetadataAsValue>(CS.getArgOperand(i)))
- visitMetadataAsValue(*MD, CS.getParent()->getParent());
+ for (Value *V : CS.args())
+ if (auto *MD = dyn_cast<MetadataAsValue>(V))
+ visitMetadataAsValue(*MD, CS.getCaller());
switch (ID) {
default:
More information about the llvm-commits
mailing list