[IR] Add doc about Function::createWithDefaultAttr. NFC
authorFangrui Song <i@maskray.me>
Wed, 21 Apr 2021 23:20:50 +0000 (16:20 -0700)
committerFangrui Song <i@maskray.me>
Wed, 21 Apr 2021 23:20:50 +0000 (16:20 -0700)
llvm/include/llvm/IR/Function.h

index 8bc5e12..e0094e2 100644 (file)
@@ -153,6 +153,11 @@ public:
   static Function *Create(FunctionType *Ty, LinkageTypes Linkage,
                           const Twine &N, Module &M);
 
+  /// Creates a function with some attributes recorded in llvm.module.flags
+  /// applied.
+  ///
+  /// Use this when synthesizing new functions that need attributes that would
+  /// have been set by command line options.
   static Function *createWithDefaultAttr(FunctionType *Ty, LinkageTypes Linkage,
                                          unsigned AddrSpace,
                                          const Twine &N = "",