Revert accidental commit.

Swift SVN r20711
This commit is contained in:
Nadav Rotem
2014-07-29 23:05:05 +00:00
parent 7faa5883df
commit cb1dc81308

View File

@@ -23,7 +23,6 @@
#include "swift/SIL/SILFunction.h"
#include "swift/SIL/SILInstruction.h"
#include "swift/SIL/SILModule.h"
#include "swift/SILAnalysis/ClassHierarchyAnalysis.h"
#include "swift/SILPasses/Passes.h"
#include "swift/SILPasses/Utils/Local.h"
#include "swift/SILPasses/PassManager.h"
@@ -858,19 +857,13 @@ static ApplyInst *CloneApply(ApplyInst *AI, SILBuilder &Builder) {
}
/// Specialize virtual dispatch.
static bool specializeClassMethodDispatch(ApplyInst *AI,
ClassHierarchyAnalysis *CHA) {
static bool specializeClassMethodDispatch(ApplyInst *AI) {
ClassMethodInst *CMI = dyn_cast<ClassMethodInst>(AI->getCallee());
assert(CMI && "Invalid class method instruction");
SILValue ClassInstance = CMI->getOperand();
SILType InstanceType = ClassInstance.stripCasts().getType();
ClassDecl *CD = InstanceType.getClassOrBoundGenericClass();
if (CHA->inheritedInModule(CD)) {
DEBUG(llvm::dbgs() << "Class " << CD->getName() << " is a superclass. "
" Not inserting monomorphic inline caches.\n");
return false;
}
if (!CD || CMI->isVolatile() || ClassInstance.getType() != InstanceType)
return false;
@@ -940,8 +933,6 @@ namespace {
virtual ~SILInlineCaches() {}
virtual void run() {
ClassHierarchyAnalysis *CHA = PM->getAnalysis<ClassHierarchyAnalysis>();
bool Changed = false;
// Collect virtual calls that may be specialized.
@@ -956,7 +947,7 @@ namespace {
// Create the inline caches.
for (auto AI : ToSpecialize)
Changed |= specializeClassMethodDispatch(AI, CHA);
Changed |= specializeClassMethodDispatch(AI);
if (Changed) {
invalidateAnalysis(SILAnalysis::InvalidationKind::CallGraph);