[PATCH] D121141: [Clang] Add `-funstable` flag to enable unstable and experimental features: follow-up fixes

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 12:02:37 PDT 2022


MaskRay accepted this revision.
MaskRay added inline comments.
This revision is now accepted and ready to land.
Herald added a subscriber: StephenFan.


================
Comment at: clang/include/clang/Driver/Options.td:1186
 
-defm unstable : BoolFOption<"unstable",
-  LangOpts<"Unstable">, DefaultFalse,
-  PosFlag<SetTrue, [CC1Option, CoreOption], "Enable unstable and experimental features">,
+defm experimental_library : BoolFOption<"experimental-library",
+  LangOpts<"ExperimentalLibrary">, DefaultFalse,
----------------
This can be simplified with `OptInCC1FFlag` (both driver/CC1 for the pos form, but driver-only for the neg form).
You'll need to set CoreOption to make the option available to clang-cl.


================
Comment at: clang/lib/Driver/ToolChain.cpp:1016
     CmdArgs.push_back("-lc++");
+    if (Args.hasArg(options::OPT_fexperimental_library))
+      CmdArgs.push_back("-lc++experimental");
----------------
There may be an archive ordering problem. 


================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:279
     CmdArgs.push_back("-lc++abi");
+    if (Args.hasArg(options::OPT_fexperimental_library))
+      CmdArgs.push_back("-lc++experimental");
----------------
There may be an archive ordering problem. -lc++experimental should probably be before -lc++abi


================
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:280
     CmdArgs.push_back("-lc++abi");
+    if (Args.hasArg(options::OPT_fexperimental_library))
+      CmdArgs.push_back("-lc++experimental");
----------------
There may be an archive ordering problem. -lc++experimental should probably be before -lc++abi


================
Comment at: clang/lib/Driver/ToolChains/CloudABI.cpp:122
   CmdArgs.push_back("-lunwind");
+  if (Args.hasArg(options::OPT_fexperimental_library))
+    CmdArgs.push_back("-lc++experimental");
----------------
There may be an archive ordering problem. -lc++experimental should probably be before -lc++abi



================
Comment at: clang/lib/Driver/ToolChains/MipsLinux.cpp:117
   CmdArgs.push_back("-lunwind");
+  if (Args.hasArg(options::OPT_fexperimental_library))
+    CmdArgs.push_back("-lc++experimental");
----------------
There may be an archive ordering problem. -lc++experimental should probably be before -lc++abi


================
Comment at: clang/lib/Driver/ToolChains/OpenBSD.cpp:335
   CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
   CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
+  if (Args.hasArg(options::OPT_fexperimental_library))
----------------
There may be an archive ordering problem. -lc++experimental should probably be before -lc++abi


================
Comment at: clang/lib/Driver/ToolChains/VEToolchain.cpp:151
+
+  if (Args.hasArg(options::OPT_fexperimental_library))
+    CmdArgs.push_back("-lc++experimental");
----------------
There may be an archive ordering problem. -lc++experimental should probably be before -lc++abi


================
Comment at: clang/lib/Driver/ToolChains/WebAssembly.cpp:448
     CmdArgs.push_back("-lc++abi");
+    if (Args.hasArg(options::OPT_fexperimental_library))
+      CmdArgs.push_back("-lc++experimental");
----------------
There may be an archive ordering problem. -lc++experimental should probably be before -lc++abi


================
Comment at: clang/test/Driver/experimental-library-flag.cpp:5
+
+// -fexperimental-library must be passed to CC1
+// CHECK: -fexperimental-library
----------------
End full sentences with a period.


================
Comment at: clang/test/Driver/experimental-library-flag.cpp:6
+// -fexperimental-library must be passed to CC1
+// CHECK: -fexperimental-library
+
----------------
Suggest testing `-lc++` as well


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121141



More information about the cfe-commits mailing list