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

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 12:46:59 PDT 2024


================
@@ -60,6 +63,33 @@ 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(const llvm::Triple &Triple);
+
+    bool checkLibcalls(llvm::GlobalValue &GV) {
----------------
jdoerfert wrote:

```suggestion
    bool checkLibcalls(GlobalValue &GV) {
```

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


More information about the llvm-commits mailing list