Mesa (master): gallivm: added lp_build_load_volatile()
Brian Paul
brianp at kemper.freedesktop.org
Fri Oct 15 23:05:57 UTC 2010
Module: Mesa
Branch: master
Commit: fb8f3d7711557d34d8a171304c589891d5bda047
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fb8f3d7711557d34d8a171304c589891d5bda047
Author: Brian Paul <brianp at vmware.com>
Date: Fri Oct 15 11:55:21 2010 -0600
gallivm: added lp_build_load_volatile()
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 | 6 ++++++
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 10 ++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.h b/src/gallium/auxiliary/gallivm/lp_bld_init.h
index f26fdac..0b4b1ca 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.h
@@ -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 */
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 48baf7c..f56ddee 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -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));
+}
+
More information about the mesa-commit
mailing list