gallivm: added lp_build_load_volatile()
authorBrian Paul <brianp@vmware.com>
Fri, 15 Oct 2010 17:55:21 +0000 (11:55 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 15 Oct 2010 21:40:33 +0000 (15:40 -0600)
There's no LLVM C LLVMBuildLoadVolatile() function so roll our own.
Not used anywhere at this time but can come in handy during debugging.

src/gallium/auxiliary/gallivm/lp_bld_init.h
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp

index f26fdac46631541a52d08300d716f6ab39850c7f..0b4b1ca7d11d1d94f7bc07342cbd27dee8ad5198 100644 (file)
@@ -47,4 +47,10 @@ lp_build_init(void);
 extern void
 lp_func_delete_body(LLVMValueRef func);
 
+
+extern LLVMValueRef
+lp_build_load_volatile(LLVMBuilderRef B, LLVMValueRef PointerVal,
+                       const char *Name);
+
+
 #endif /* !LP_BLD_INIT_H */
index 48baf7c425c8881cf44fa225aedd5197268ea04d..f56ddee7fd71c57f9b861418ca1db0678b8d8af9 100644 (file)
@@ -178,3 +178,13 @@ lp_func_delete_body(LLVMValueRef FF)
    llvm::Function *func = llvm::unwrap<llvm::Function>(FF);
    func->deleteBody();
 }
+
+
+extern "C"
+LLVMValueRef
+lp_build_load_volatile(LLVMBuilderRef B, LLVMValueRef PointerVal,
+                       const char *Name)
+{
+   return llvm::wrap(llvm::unwrap(B)->CreateLoad(llvm::unwrap(PointerVal), true, Name));
+}
+