[PATCH] D61040: [Fuchsia] Support multilib for -fsanitize=address and -fno-exceptions
Roland McGrath via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 24 16:42:35 PDT 2019
mcgrathr accepted this revision.
mcgrathr added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1507
+ Multilib::flags_list &Flags) {
+ if (Enabled)
+ Flags.push_back(std::string("+") + Flag);
----------------
I'd have reduced the duplication and just used `Enabled ? "+" : "-"`
================
Comment at: clang/lib/Driver/ToolChains/Fuchsia.cpp:197
+ SmallString<128> P(D.ResourceDir);
+ llvm::sys::path::append(P, D.getTargetTriple(), "lib", M.gccSuffix());
+ return std::vector<std::string>({P.str()});
----------------
These two lines repeating the path construction logic could be CSEd into a lambda.
================
Comment at: clang/lib/Driver/ToolChains/Fuchsia.cpp:201
+
+ if (const auto &PathsCallback = Multilibs.filePathsCallback())
+ for (const auto &Path : PathsCallback(SelectedMultilib))
----------------
This merits a comment about the order they're being inserted.
================
Comment at: clang/test/Driver/fuchsia.cpp:60
+// CHECK-NOEXCEPTIONS-X86: "-L[[RESOURCE_DIR]]{{/|\\\\}}x86_64-fuchsia{{/|\\\\}}lib"
+
+// RUN: %clang %s -### --target=aarch64-fuchsia -fno-exceptions \
----------------
Might be worth adding a test that noexcept does *not* appear by default (or explicit -fexceptions).
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61040/new/
https://reviews.llvm.org/D61040
More information about the cfe-commits
mailing list