aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-07-25 23:16:38 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-07-25 23:16:38 +0000
commit47f3513dd574535aeb40c9eb11134f0899e92269 (patch)
tree7bd91987ca00ee4d618fbfd6038c24a60362993e /lib/VMCore/Instructions.cpp
parent5a1cb644c903da49dc612a0ba5044505d066259e (diff)
downloadexternal_llvm-47f3513dd574535aeb40c9eb11134f0899e92269.zip
external_llvm-47f3513dd574535aeb40c9eb11134f0899e92269.tar.gz
external_llvm-47f3513dd574535aeb40c9eb11134f0899e92269.tar.bz2
Initial implementation of 'fence' instruction, the new C++0x-style replacement for llvm.memory.barrier.
This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136009 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 6d27689..ba4dae5 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -996,6 +996,26 @@ void StoreInst::setAlignment(unsigned Align) {
}
//===----------------------------------------------------------------------===//
+// FenceInst Implementation
+//===----------------------------------------------------------------------===//
+
+FenceInst::FenceInst(LLVMContext &C, AtomicOrdering Ordering,
+ SynchronizationScope SynchScope,
+ Instruction *InsertBefore)
+ : Instruction(Type::getVoidTy(C), Fence, 0, 0, InsertBefore) {
+ setOrdering(Ordering);
+ setSynchScope(SynchScope);
+}
+
+FenceInst::FenceInst(LLVMContext &C, AtomicOrdering Ordering,
+ SynchronizationScope SynchScope,
+ BasicBlock *InsertAtEnd)
+ : Instruction(Type::getVoidTy(C), Fence, 0, 0, InsertAtEnd) {
+ setOrdering(Ordering);
+ setSynchScope(SynchScope);
+}
+
+//===----------------------------------------------------------------------===//
// GetElementPtrInst Implementation
//===----------------------------------------------------------------------===//
@@ -3018,6 +3038,10 @@ StoreInst *StoreInst::clone_impl() const {
isVolatile(), getAlignment());
}
+FenceInst *FenceInst::clone_impl() const {
+ return new FenceInst(getContext(), getOrdering(), getSynchScope());
+}
+
TruncInst *TruncInst::clone_impl() const {
return new TruncInst(getOperand(0), getType());
}