From f05b0812145897ba34bc2d7fda436a54f9fbca22 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Fri, 12 Jan 2024 13:23:42 -0700 Subject: [clang] Adjust -mlarge-data-threshold handling (#77958) Make it apply to x86-64 medium and large code models since that's what the backend does. Limit logic to exclude x86-32. Default to 0, let the driver set it to 65536 for the medium code model if one is not passed. Set it to 0 for the large code model by default to match gcc and since some users make assumptions about the large code model that any small data will break. --- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index ad6fc71..0cfe7a0 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1201,7 +1201,7 @@ void CodeGenModule::Release() { llvm::CodeModel::Model codeModel = static_cast(CM); getModule().setCodeModel(codeModel); - if (CM == llvm::CodeModel::Medium && + if ((CM == llvm::CodeModel::Medium || CM == llvm::CodeModel::Large) && Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86_64) { getModule().setLargeDataThreshold(getCodeGenOpts().LargeDataThreshold); -- cgit v1.1