+
+ if (gallivm_debug & GALLIVM_DEBUG_ASM) {
+ LLVMValueRef llvm_func = LLVMGetFirstFunction(gallivm->module);
+
+ while (llvm_func) {
+ /*
+ * Need to filter out functions which don't have an implementation,
+ * such as the intrinsics. May not be sufficient in case of IPO?
+ * LLVMGetPointerToGlobal() will abort otherwise.
+ */
+ if (!LLVMIsDeclaration(llvm_func)) {
+ void *func_code = LLVMGetPointerToGlobal(gallivm->engine, llvm_func);
+ lp_disassemble(llvm_func, func_code);
+ }
+ llvm_func = LLVMGetNextFunction(llvm_func);
+ }
+ }
+
+#if defined(PROFILE)
+ {
+ LLVMValueRef llvm_func = LLVMGetFirstFunction(gallivm->module);
+
+ while (llvm_func) {
+ if (!LLVMIsDeclaration(llvm_func)) {
+ void *func_code = LLVMGetPointerToGlobal(gallivm->engine, llvm_func);
+ lp_profile(llvm_func, func_code);
+ }
+ llvm_func = LLVMGetNextFunction(llvm_func);
+ }
+ }
+#endif