[llvm] 1809949 - [llvm][NFC][CallSite] Remove CallSite from Lint.cpp

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 12:29:26 PDT 2020


Author: Mircea Trofin
Date: 2020-04-20T12:29:11-07:00
New Revision: 1809949239ae9b029b8e6fc05269f46c0cd90908

URL: https://github.com/llvm/llvm-project/commit/1809949239ae9b029b8e6fc05269f46c0cd90908
DIFF: https://github.com/llvm/llvm-project/commit/1809949239ae9b029b8e6fc05269f46c0cd90908.diff

LOG: [llvm][NFC][CallSite] Remove CallSite from Lint.cpp

Summary: The CallSite arg iterator is really User::op_iterator.

Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78507

Added: 
    

Modified: 
    llvm/lib/Analysis/Lint.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp
index 53f2d4664078..338c6a4137e7 100644
--- a/llvm/lib/Analysis/Lint.cpp
+++ b/llvm/lib/Analysis/Lint.cpp
@@ -49,7 +49,6 @@
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/IR/Argument.h"
 #include "llvm/IR/BasicBlock.h"
-#include "llvm/IR/CallSite.h"
 #include "llvm/IR/Constant.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
@@ -249,7 +248,7 @@ void Lint::visitCallBase(CallBase &I) {
     // Check argument types (in case the callee was casted) and attributes.
     // TODO: Verify that caller and callee attributes are compatible.
     Function::arg_iterator PI = F->arg_begin(), PE = F->arg_end();
-    CallSite::arg_iterator AI = I.arg_begin(), AE = I.arg_end();
+    auto AI = I.arg_begin(), AE = I.arg_end();
     for (; AI != AE; ++AI) {
       Value *Actual = *AI;
       if (PI != PE) {
@@ -265,8 +264,7 @@ void Lint::visitCallBase(CallBase &I) {
         if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy()) {
           AttributeList PAL = I.getAttributes();
           unsigned ArgNo = 0;
-          for (CallSite::arg_iterator BI = I.arg_begin(); BI != AE;
-               ++BI, ++ArgNo) {
+          for (auto BI = I.arg_begin(); BI != AE; ++BI, ++ArgNo) {
             // Skip ByVal arguments since they will be memcpy'd to the callee's
             // stack so we're not really passing the pointer anyway.
             if (PAL.hasParamAttribute(ArgNo, Attribute::ByVal))


        


More information about the llvm-commits mailing list