While this probably should be considered a dump debugger utility, the C
API currently has no other ways to print a module to stderr for error
reporting purposes, so keep it even in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293436
91177308-0d34-0410-b5e6-
96231b3b80d8
unwrap(M)->setTargetTriple(Triple);
}
-#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-LLVM_DUMP_METHOD void LLVMDumpModule(LLVMModuleRef M) {
- unwrap(M)->dump();
+void LLVMDumpModule(LLVMModuleRef M) {
+ unwrap(M)->print(errs(), nullptr,
+ /*ShouldPreserveUseListOrder=*/false, /*IsForDebug=*/true);
}
-#endif
LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
char **ErrorMessage) {