[OpenMP] Introduce RAII to protect certain RTL calls from DCE
This patch introduces a new RAII struct that will temporarily make an OpenMP RTL function have external linkage. This is done before the attributor is invoked to prevent it from incorrectly removing some function definitions that we will use later. For example, if we determine all calls to one function are dead, because it has internal linkage it can safely be removed. Later when we try to get an instance to that function to modify the source using `getOrCreateRuntimeFunction` we will then get an empty declaration for that function that won't be defined anywhere. This patch prevents this from occurring. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D106707
Loading
Please register or sign in to comment