Remove some dead methods.
[oota-llvm.git] / lib / VMCore / Instructions.cpp
index b3acbc42410f73770fa506200de0d4e60debad58..8c3013b0bbc73bc3a1e7a2af2add57af1b06fd0e 100644 (file)
@@ -342,6 +342,56 @@ void CallInst::removeAttribute(unsigned i, Attributes attr) {
   setAttributes(PAL);
 }
 
+bool CallInst::fnHasNoAliasAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoAliasAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoAliasAttr();
+  return false;
+}
+bool CallInst::fnHasNoInlineAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoInlineAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoInlineAttr();
+  return false;
+}
+bool CallInst::fnHasNoReturnAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoReturnAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoReturnAttr();
+  return false;
+}
+bool CallInst::fnHasNoUnwindAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoUnwindAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoUnwindAttr();
+  return false;
+}
+bool CallInst::fnHasReadNoneAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasReadNoneAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasReadNoneAttr();
+  return false;
+}
+bool CallInst::fnHasReadOnlyAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasReadOnlyAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasReadOnlyAttr();
+  return false;
+}
+bool CallInst::fnHasReturnsTwiceAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasReturnsTwiceAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasReturnsTwiceAttr();
+  return false;
+}
+
 bool CallInst::paramHasSExtAttr(unsigned i) const {
   if (AttributeList.getParamAttributes(i).hasSExtAttr())
     return true;
@@ -390,11 +440,19 @@ bool CallInst::paramHasByValAttr(unsigned i) const {
   return false;
 }
 
-bool CallInst::paramHasAttr(unsigned i, Attributes attr) const {
-  if (AttributeList.paramHasAttr(i, attr))
+bool CallInst::paramHasNoAliasAttr(unsigned i) const {
+  if (AttributeList.getParamAttributes(i).hasNoAliasAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(i).hasNoAliasAttr();
+  return false;
+}
+
+bool CallInst::paramHasNoCaptureAttr(unsigned i) const {
+  if (AttributeList.getParamAttributes(i).hasNoCaptureAttr())
     return true;
   if (const Function *F = getCalledFunction())
-    return F->paramHasAttr(i, attr);
+    return F->getParamAttributes(i).hasNoCaptureAttr();
   return false;
 }
 
@@ -610,6 +668,56 @@ void InvokeInst::setSuccessorV(unsigned idx, BasicBlock *B) {
   return setSuccessor(idx, B);
 }
 
+bool InvokeInst::fnHasNoAliasAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoAliasAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoAliasAttr();
+  return false;
+}
+bool InvokeInst::fnHasNoInlineAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoInlineAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoInlineAttr();
+  return false;
+}
+bool InvokeInst::fnHasNoReturnAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoReturnAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoReturnAttr();
+  return false;
+}
+bool InvokeInst::fnHasNoUnwindAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasNoUnwindAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasNoUnwindAttr();
+  return false;
+}
+bool InvokeInst::fnHasReadNoneAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasReadNoneAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasReadNoneAttr();
+  return false;
+}
+bool InvokeInst::fnHasReadOnlyAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasReadOnlyAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasReadOnlyAttr();
+  return false;
+}
+bool InvokeInst::fnHasReturnsTwiceAttr() const {
+  if (AttributeList.getParamAttributes(~0U).hasReturnsTwiceAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(~0U).hasReturnsTwiceAttr();
+  return false;
+}
+
 bool InvokeInst::paramHasSExtAttr(unsigned i) const {
   if (AttributeList.getParamAttributes(i).hasSExtAttr())
     return true;
@@ -658,11 +766,19 @@ bool InvokeInst::paramHasByValAttr(unsigned i) const {
   return false;
 }
 
-bool InvokeInst::paramHasAttr(unsigned i, Attributes attr) const {
-  if (AttributeList.paramHasAttr(i, attr))
+bool InvokeInst::paramHasNoAliasAttr(unsigned i) const {
+  if (AttributeList.getParamAttributes(i).hasNoAliasAttr())
+    return true;
+  if (const Function *F = getCalledFunction())
+    return F->getParamAttributes(i).hasNoAliasAttr();
+  return false;
+}
+
+bool InvokeInst::paramHasNoCaptureAttr(unsigned i) const {
+  if (AttributeList.getParamAttributes(i).hasNoCaptureAttr())
     return true;
   if (const Function *F = getCalledFunction())
-    return F->paramHasAttr(i, attr);
+    return F->getParamAttributes(i).hasNoCaptureAttr();
   return false;
 }