[PATCH] D142986: Enable multilib.yaml in the BareMetal ToolChain
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 10 22:47:03 PST 2023
MaskRay added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:167
+ std::vector<std::string> ArgsFlags = TC.getMultiSelectionFlags(Args);
+
+ if (!Result.Multilibs.parse(*MB.get())) {
----------------
delete blank line
================
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:169
+ if (!Result.Multilibs.parse(*MB.get())) {
+ return false;
+ }
----------------
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
================
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:193
+ if (D.getVFS().exists(MultilibPath)) {
+ return std::string(SysRootDir);
+ }
----------------
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
================
Comment at: clang/test/Driver/baremetal-multilib.cpp:1
+// REQUIRES: shell
+// UNSUPPORTED: system-windows
----------------
This C++ source file is empty excluding comments. Just name it `baremetal-multilib.yaml`.
Note: if you need extra files, check out `split-file`
================
Comment at: clang/test/Driver/baremetal-multilib.cpp:14
+// RUN: | FileCheck %s
+// CHECK: "{{.*}}clang{{.*}}" "-cc1" "-triple" "thumbv8m.main-none-unknown-eabihf"
+// CHECK-SAME: "-internal-isystem" "{{.*}}/baremetal_multilib/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/include/c++/v1"
----------------
With `-cc1` CHECK lines, remove `clang{{.*}}` before `-cc1`, then remove `-no-canonical-prefixes`. See my prior commits in this area.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142986/new/
https://reviews.llvm.org/D142986
More information about the cfe-commits
mailing list