Stop emitting llvm.ident metadata saying the compiler was Clang. (#5520)

This commit is contained in:
Richard Smith
2025-05-22 18:48:58 +00:00
committed by GitHub
parent f198b977f5
commit 6e7c035bef
2 changed files with 47 additions and 54 deletions
+3
View File
@@ -174,6 +174,9 @@ auto FileContext::CreateCppCodeGenerator()
RawStringOstream clang_module_name_stream;
clang_module_name_stream << llvm_module_->getName() << ".clang";
// Do not emit Clang's name and version as the creator of the output file.
cpp_code_gen_options_.EmitVersionIdentMetadata = false;
return std::unique_ptr<clang::CodeGenerator>(clang::CreateLLVMCodeGen(
cpp_ast()->getASTContext().getDiagnostics(),
clang_module_name_stream.TakeStr(), fs_, cpp_header_search_options_,