aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-03-22 03:54:15 +0000
committerChris Lattner <sabre@nondot.org>2012-03-22 03:54:15 +0000
commiteabe3ad57d824c2b07016352fd97ce85777b6f9d (patch)
tree4233cebe895fff93c3ee7b6d87d1eb4691ee95ce /lib/VMCore
parent1fe6bfca593404e261922990f230326934dda4d6 (diff)
downloadexternal_llvm-eabe3ad57d824c2b07016352fd97ce85777b6f9d.zip
external_llvm-eabe3ad57d824c2b07016352fd97ce85777b6f9d.tar.gz
external_llvm-eabe3ad57d824c2b07016352fd97ce85777b6f9d.tar.bz2
add load/store volatility control to the C API, patch by Yiannis Tsiouris!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Core.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index e86d805..a9cca22 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -2066,6 +2066,20 @@ LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str,
return wrap(unwrap(B)->CreateGlobalStringPtr(Str, Name));
}
+LLVMBool LLVMGetVolatile(LLVMValueRef MemAccessInst) {
+ Value *P = unwrap<Value>(MemAccessInst);
+ if (LoadInst *LI = dyn_cast<LoadInst>(P))
+ return LI->isVolatile();
+ return cast<StoreInst>(P)->isVolatile();
+}
+
+void LLVMSetVolatile(LLVMValueRef MemAccessInst, LLVMBool isVolatile) {
+ Value *P = unwrap<Value>(MemAccessInst);
+ if (LoadInst *LI = dyn_cast<LoadInst>(P))
+ return LI->setVolatile(isVolatile);
+ return cast<StoreInst>(P)->setVolatile(isVolatile);
+}
+
/*--.. Casts ...............................................................--*/
LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef B, LLVMValueRef Val,