//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
#include "llvm/Type.h"
#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
#include "llvm/Function.h"
+#include "llvm/Support/CallSite.h"
#include "llvm/Support/LeakDetector.h"
using namespace llvm;
case ExtractElement: return "extractelement";
case InsertElement: return "insertelement";
case ShuffleVector: return "shufflevector";
+ case GetResult: return "getresult";
default: return "<Invalid operator> ";
}
switch (getOpcode()) {
default: return false;
case Instruction::Free:
- case Instruction::Store:
case Instruction::Invoke:
+ case Instruction::Store:
case Instruction::VAArg:
return true;
case Instruction::Call:
- //if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(this)) {
- // If the intrinsic doesn't write memory, it is safe.
- // FIXME: this is obviously supposed to determine which intrinsics
- // don't write to memory, but hasn't been implemented yet.
- //}
- return true;
+ return !cast<CallInst>(this)->onlyReadsMemory();
case Instruction::Load:
return cast<LoadInst>(this)->isVolatile();
}
case Store:
case Call:
case Invoke:
+ case VAArg:
return true;
default:
return false;