Do this more neatly.
authorDuncan Sands <baldrick@free.fr>
Fri, 25 Jan 2008 22:06:51 +0000 (22:06 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 25 Jan 2008 22:06:51 +0000 (22:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46369 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineFunction.cpp

index f730d534a55f54c867290626401ed2f4ebe712ee..552583042a77ac712950d6d998a11dd6b23a52f1 100644 (file)
@@ -245,8 +245,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
       // or readnone, because the copy would be unneeded: the callee doesn't
       // modify the struct.
       if (CalledFunc->paramHasAttr(ArgNo+1, ParamAttr::ByVal) &&
-          !CalledFunc->paramHasAttr(0, ParamAttr::ReadOnly) &&
-          !CalledFunc->paramHasAttr(0, ParamAttr::ReadNone)) {
+          !CalledFunc->onlyReadsMemory()) {
         const Type *AggTy = cast<PointerType>(I->getType())->getElementType();
         const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);