[llvm] r199350 - Prevent calls to __jit_debug_register_code from being optimized out.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jan 15 20:50:59 PST 2014
Author: rafael
Date: Wed Jan 15 22:50:58 2014
New Revision: 199350
URL: http://llvm.org/viewvc/llvm-project?rev=199350&view=rev
Log:
Prevent calls to __jit_debug_register_code from being optimized out.
Patch by Andrew MacPherson. I just tweaked the comment.
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp?rev=199350&r1=199349&r2=199350&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp Wed Jan 15 22:50:58 2014
@@ -47,7 +47,11 @@ extern "C" {
struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
// Debuggers puts a breakpoint in this function.
- LLVM_ATTRIBUTE_NOINLINE void __jit_debug_register_code() { }
+ LLVM_ATTRIBUTE_NOINLINE void __jit_debug_register_code() {
+ // The noinline and the asm prevent calls to this function from being
+ // optimized out.
+ asm volatile("":::"memory");
+ }
}
More information about the llvm-commits
mailing list