[llvm] [CGData] Skip reading Names into StableFunctionMap in non-assertion b… (PR #142095)
Kyungwoo Lee via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 4 12:16:01 PDT 2025
================
@@ -155,7 +155,14 @@ CodeGenData &CodeGenData::getInstance() {
// Instead, just emit an warning message and fall back as if no CGData
// were available.
auto FS = vfs::getRealFileSystem();
- auto ReaderOrErr = CodeGenDataReader::create(CodeGenDataUsePath, *FS);
+ CodeGenDataReader::Options Opts;
+#ifdef NDEBUG
----------------
kyulee-com wrote:
I'd prefer to have consistent behavior between debug and release builds.
Also we can allow users to have explicit control regardless of build types.
It'd be simpler and maintainable without any confusion as the constructor sets it as true.
Can we define a command line flag, and set it based on that? Something like:
```
static cl::opt<bool> CodeGenDataReadFunctionMapNames(
"codegen-data-read-function-map-names", cl::init(true), cl::Hidden,
cl::desc("Read function map names in CodeGenData (disable to save memory and time)"));
...
Opts.ReadStableFunctionMapNames = CodeGenDataReadFunctionMapNames;
```
https://github.com/llvm/llvm-project/pull/142095
More information about the llvm-commits
mailing list