[sanitizer] Move __sanitizer_set_death_callback to a more appropriate file
Summary: `__sanitizer_set_death_callback` is a public interface function wrapping `SetUserDieCallback`. Said function is defined in `sanitizer_termination.cc`, which is not included in all the RT. Moving the interface function to that file allows to not have a spurious public fuinction in RT that don't use it. Reviewers: eugenis Reviewed By: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D52363 llvm-svn: 342747
This commit is contained in:
		
							parent
							
								
									c9de3b4d26
								
							
						
					
					
						commit
						7bdb0b9493
					
				| 
						 | 
				
			
			@ -338,11 +338,6 @@ int __sanitizer_acquire_crash_state() {
 | 
			
		|||
  return !atomic_exchange(&in_crash_state, 1, memory_order_relaxed);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SANITIZER_INTERFACE_ATTRIBUTE
 | 
			
		||||
void __sanitizer_set_death_callback(void (*callback)(void)) {
 | 
			
		||||
  SetUserDieCallback(callback);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SANITIZER_INTERFACE_ATTRIBUTE
 | 
			
		||||
int __sanitizer_install_malloc_and_free_hooks(void (*malloc_hook)(const void *,
 | 
			
		||||
                                                                  uptr),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -84,3 +84,12 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
} // namespace __sanitizer
 | 
			
		||||
 | 
			
		||||
using namespace __sanitizer;  // NOLINT
 | 
			
		||||
 | 
			
		||||
extern "C" {
 | 
			
		||||
SANITIZER_INTERFACE_ATTRIBUTE
 | 
			
		||||
void __sanitizer_set_death_callback(void (*callback)(void)) {
 | 
			
		||||
  SetUserDieCallback(callback);
 | 
			
		||||
}
 | 
			
		||||
}  // extern "C"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue