From 2843e156f8d4c91f3b646b8c64699dbfbd536b8d Mon Sep 17 00:00:00 2001 From: Viktoria Maksimova Date: Thu, 25 Nov 2021 14:08:54 +0300 Subject: [PATCH] Restore the comment from 0ef7ad3 [NFC] Clarify why LinkAll*.h are actually necessary --- llvm/include/llvm/LinkAllPasses.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h index c2113140bfe1b..eb146d816a1b2 100644 --- a/llvm/include/llvm/LinkAllPasses.h +++ b/llvm/include/llvm/LinkAllPasses.h @@ -66,6 +66,9 @@ namespace { // delete it all as dead code, even with whole program optimization, // yet is effectively a NO-OP. As the compiler isn't smart enough // to know that getenv() never returns -1, this will do the job. + // This is so that globals in the translation units where these functions + // are defined are forced to be initialized, populating various + // registries. if (std::getenv("bar") != (char*) -1) return;