[llvm] [LLVM] Maintain element type of @llvm.compiler.used/@llvm.used if it already exists (PR #162660)
    Nikita Popov via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Oct 21 06:21:27 PDT 2025
    
    
  
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>,
Juan Manuel Martinez =?utf-8?q?Caamaño?= <juamarti at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/162660 at github.com>
================
@@ -5861,28 +5862,19 @@ static const char *getSectionNameForCommandline(const Triple &T) {
   llvm_unreachable("Unimplemented ObjectFormatType");
 }
 
+static auto globalInUsedHasName(StringRef Name) {
+  return [Name](Constant *C) { return C->getName() == Name; };
+}
----------------
nikic wrote:
Please just inline this trivial function. I don't want to think about what exactly the memory safety rules for returning capturing closures are.
https://github.com/llvm/llvm-project/pull/162660
    
    
More information about the llvm-commits
mailing list