[PATCH] D129045: [C++20][Modules] Update handling of implicit inlines [P1779R3]

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 3 19:14:53 PDT 2022


ChuanqiXu added inline comments.


================
Comment at: clang/lib/AST/TextNodeDumper.cpp:1723-1725
+  if (!D->isInlineSpecified() && D->isInlined()) {
+    OS << " implicit-inline";
+  }
----------------
Is this necessary to this revision?


================
Comment at: clang/lib/Sema/SemaDecl.cpp:9362
+      //   to the global module.
+      if (getLangOpts().CPlusPlus20 || getLangOpts().CPlusPlus2b) {
+        Module *M = NewFD->getOwningModule();
----------------
If I remember correctly, when we run `-std=c++2b`, `getLangOpts().CPlusPlus20` would be true too. So we could check `getLangOpts().CPlusPlus20` only here.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:9363-9365
+        Module *M = NewFD->getOwningModule();
+        if (!M || M->isGlobalModule())
+          NewFD->setImplicitlyInline();
----------------
nit: this is not  required.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:9657
+      //   in its class definition, it is inline.
+      if (getLangOpts().CPlusPlus20 || getLangOpts().CPlusPlus2b) {
+        Module *M = NewFD->getOwningModule();
----------------
ditto


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129045/new/

https://reviews.llvm.org/D129045



More information about the cfe-commits mailing list