Reverting dtor devirtualization patch.
[oota-llvm.git] / lib / VMCore / Instructions.cpp
index 8e484910d2d7597e588531f150addcd427f35084..0df0466112bc797aeeacb2ef1fcad8486687d905 100644 (file)
@@ -53,7 +53,18 @@ bool CallSite::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
   else
     return cast<InvokeInst>(I)->paramHasAttr(i, attr);
 }
-
+bool CallSite::doesNotAccessMemory() const {
+  if (CallInst *CI = dyn_cast<CallInst>(I))
+    return CI->doesNotAccessMemory();
+  else
+    return cast<InvokeInst>(I)->doesNotAccessMemory();
+}
+bool CallSite::onlyReadsMemory() const {
+  if (CallInst *CI = dyn_cast<CallInst>(I))
+    return CI->onlyReadsMemory();
+  else
+    return cast<InvokeInst>(I)->onlyReadsMemory();
+}
 
 
 
@@ -385,8 +396,9 @@ void CallInst::setParamAttrs(const ParamAttrsList *newAttrs) {
 bool CallInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
   if (ParamAttrs && ParamAttrs->paramHasAttr(i, attr))
     return true;
-  const Function *F = getCalledFunction();
-  return F && F->getParamAttrs() && F->getParamAttrs()->paramHasAttr(i, attr);
+  if (const Function *F = getCalledFunction())
+    return F->paramHasAttr(i, attr);
+  return false;
 }
 
 
@@ -462,8 +474,9 @@ void InvokeInst::setParamAttrs(const ParamAttrsList *newAttrs) {
 bool InvokeInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
   if (ParamAttrs && ParamAttrs->paramHasAttr(i, attr))
     return true;
-  const Function *F = getCalledFunction();
-  return F && F->getParamAttrs() && F->getParamAttrs()->paramHasAttr(i, attr);
+  if (const Function *F = getCalledFunction())
+    return F->paramHasAttr(i, attr);
+  return false;
 }