[PATCH] D81676: [MSP430] Align the toolchain definition with the TI's msp430-gcc v8.3.1
Kristina Bessonova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 22 04:16:13 PDT 2020
krisb added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/MSP430.cpp:155
SmallString<128> Dir(computeSysRoot());
llvm::sys::path::append(Dir, "include");
addSystemInclude(DriverArgs, CC1Args, Dir.str());
----------------
Seems the driver stops adding `msp430-elf/include` to the default include search paths, instead it adds `$sysroot/include` (or `$gcc-toolchain/include`). As I can see the latter isn't among the default include paths used by TI gcc.
So, shouldn't we change here to `llvm::sys::path::append(Dir, "msp430-elf", "include");` as well?
================
Comment at: clang/lib/Driver/ToolChains/MSP430.cpp:239
+ ArgStringList &CmdArgs) {
+ if (!Args.hasArg(options::OPT_T)) {
+ if (Args.hasArg(options::OPT_msim)) {
----------------
What about an early exit here?
================
Comment at: clang/test/Driver/msp430-toolchain.c:12
// RUN: %clang %s -### -no-canonical-prefixes -target msp430 --sysroot="" 2>&1 \
-// RUN: | FileCheck -check-prefix=CC1 %s
-// CC1: clang{{.*}} "-cc1" "-triple" "msp430"
+// RUN: | FileCheck -check-prefix=DEFAULT-NEG %s
+// DEFAULT-POS: clang{{.*}} "-cc1" "-triple" "msp430"
----------------
How about using a single run line with just `--check-prefixes=DEFAULT-POS,DEFAULT-NEG`?
================
Comment at: clang/test/Driver/msp430-toolchain.c:37
+// RUN: %clang %s -### -no-canonical-prefixes -target msp430 --sysroot="" \
+// RUN: -o /tmp/test.elf -r -t -z muldefs -mrelax 2>&1 | FileCheck -check-prefix=MISC-FLAGS-1-NEG %s
+// MISC-FLAGS-1-POS: "{{.*}}msp430-elf-ld"
----------------
Same here about `--check-prefixes`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81676/new/
https://reviews.llvm.org/D81676
More information about the cfe-commits
mailing list