[llvm] [Linker] Propagate `nobuiltin` attributes when linking known libcalls (PR #89431)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 11:41:27 PDT 2024


================
@@ -60,6 +63,34 @@ class IRMover {
     bool hasType(StructType *Ty);
   };
 
+  /// Utility for handling linking of known libcall functions. If a merged
+  /// module contains a recognized library call we can no longer perform any
+  /// libcall related transformations.
+  class LibcallHandler {
+    bool HasLibcalls = false;
+
+    StringSet<> Libcalls;
+    StringSet<> Triples;
+
+    BumpPtrAllocator Alloc;
+    StringSaver Saver;
+
+  public:
+    LibcallHandler() : Saver(Alloc) {}
+
+    void updateLibcalls(llvm::Triple Triple);
+
+    bool checkLibcalls(llvm::GlobalValue *GV) {
----------------
arsenm wrote:

I'd expect this to be never null 

https://github.com/llvm/llvm-project/pull/89431


More information about the llvm-commits mailing list