================
@@ -79,6 +79,48 @@ function(llvm_update_compile_flags name)
   target_compile_definitions(${name} PRIVATE ${LLVM_COMPILE_DEFINITIONS})
 endfunction()
 
+function(llvm_update_pch name)
+  if(LLVM_REQUIRES_RTTI OR LLVM_REQUIRES_EH)
+    # Non-default RTTI/EH results in incompatible flags, precluding PCH reuse.
+    set(ARG_DISABLE_PCH_REUSE ON)
+  endif()
----------------
aengelke wrote:

The PCH compile flags must match the source file compile flags. LLVM_REQUIRES_* 
are per-target overrides to enable EH/RTTI (currently used by two unit tests). 
If the PCH is compiled without RTTI/EH but the target overrides this, the PCH 
cannot be used.

RTTI+EH cause different macro definitions and actually also cause different 
preprocessed output on some standard library headers in e.g. shared_ptr.

https://github.com/llvm/llvm-project/pull/176420
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to