AliasAnalysis::ModRefBehavior
AliasAnalysis::getModRefBehavior(CallSite CS,
std::vector<PointerAccessInfo> *Info) {
- if (CS.doesNotAccessMemory())
+ if (CS.doesNotAccessMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ CS.getCalledFunction() && CS.getCalledFunction()->isDeclaration())
// Can't do better than this.
return DoesNotAccessMemory;
ModRefBehavior MRB = UnknownModRefBehavior;
if (Function *F = CS.getCalledFunction())
MRB = getModRefBehavior(F, CS, Info);
- if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory())
+ if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ CS.getCalledFunction() && CS.getCalledFunction()->isDeclaration())
return OnlyReadsMemory;
return MRB;
}
AliasAnalysis::ModRefBehavior
AliasAnalysis::getModRefBehavior(Function *F,
std::vector<PointerAccessInfo> *Info) {
- if (F->doesNotAccessMemory())
+ if (F->doesNotAccessMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ F->isDeclaration())
// Can't do better than this.
return DoesNotAccessMemory;
ModRefBehavior MRB = getModRefBehavior(F, CallSite(), Info);
- if (MRB != DoesNotAccessMemory && F->onlyReadsMemory())
+ if (MRB != DoesNotAccessMemory && F->onlyReadsMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ F->isDeclaration())
return OnlyReadsMemory;
return MRB;
}
#include "llvm/Type.h"
#include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h" // FIXME: remove
#include "llvm/Function.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/LeakDetector.h"
case Instruction::VAArg:
return true;
case Instruction::Call:
+ if (!isa<IntrinsicInst>(this))
+ return true; // FIXME: workaround gcc bootstrap breakage
return !cast<CallInst>(this)->onlyReadsMemory();
case Instruction::Load:
return cast<LoadInst>(this)->isVolatile();