Permalink
Browse files

Use the new LLVM 3.0 API

  • Loading branch information...
1 parent 93f1468 commit 5fcdf48faa2ab3ce9ff29e791530a50221bd59fa @dbussink dbussink committed Mar 14, 2012
Showing with 10 additions and 12 deletions.
  1. +10 −12 vm/llvm/passes.cpp
View
@@ -348,11 +348,10 @@ namespace {
}
virtual
- AliasAnalysis::AliasResult alias(const Value *V1, unsigned V1Size,
- const Value *V2, unsigned V2Size)
+ AliasAnalysis::AliasResult alias(const Location &LocA, const Location &LocB)
{
// Indicate that tagged fixnums can't alias anything.
- if(const IntToPtrInst* ip = dyn_cast<IntToPtrInst>(V1)) {
+ if(const IntToPtrInst* ip = dyn_cast<IntToPtrInst>(LocA.Ptr)) {
if(ip->getType() == object_type_) {
if(const ConstantInt* ci = dyn_cast<ConstantInt>(ip->getOperand(0))) {
const APInt& cv = ci->getValue();
@@ -363,20 +362,19 @@ namespace {
}
}
- return AliasAnalysis::alias(V1, V1Size, V2, V2Size);
+ return AliasAnalysis::alias(LocA, LocB);
}
virtual
- AliasAnalysis::ModRefResult getModRefInfo(ImmutableCallSite cs,
- const Value* val, unsigned size) {
+ AliasAnalysis::ModRefResult getModRefInfo(ImmutableCallSite cs, const Location &Loc) {
if(const Function* func = cs.getCalledFunction()) {
if(func->getName() == "rbx_float_allocate") {
return NoModRef;
}
}
- return AliasAnalysis::getModRefInfo(cs, val, size);
+ return AliasAnalysis::getModRefInfo(cs, Loc);
}
// This method only exists to appease -Woverloaded-virtual. It's dumb
@@ -389,10 +387,10 @@ namespace {
return AliasAnalysis::getModRefInfo(CS1, CS2);
}
- virtual bool pointsToConstantMemory(const Value* val) {
- LLVMContext& ctx = val->getContext();
+ virtual bool pointsToConstantMemory(const Location &Loc, bool OrLocal = false) {
+ LLVMContext& ctx = Loc.Ptr->getContext();
- if(const GetElementPtrInst* gep = dyn_cast<GetElementPtrInst>(val)) {
+ if(const GetElementPtrInst* gep = dyn_cast<GetElementPtrInst>(Loc.Ptr)) {
if(gep->getPointerOperand()->getType() == class_type_) {
// Indicate that the class_id field is constant
if(gep->getNumIndices() == 2
@@ -411,12 +409,12 @@ namespace {
} else if(gep->getPointerOperand()->getType() == float_type_) {
return true;
}
- } else if(const BitCastInst* bc = dyn_cast<BitCastInst>(val)) {
+ } else if(const BitCastInst* bc = dyn_cast<BitCastInst>(Loc.Ptr)) {
if(bc->getType() == PointerType::getUnqual(Type::getDoubleTy(ctx))) {
return true;
}
}
- return AliasAnalysis::pointsToConstantMemory(val);
+ return AliasAnalysis::pointsToConstantMemory(Loc, OrLocal);
}
};

0 comments on commit 5fcdf48

Please sign in to comment.