[PATCH] D63194: [clangd] Link in target infos and pass target and mode while invoking driver

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 12 06:33:04 PDT 2019


ilya-biryukov added inline comments.


================
Comment at: clang-tools-extra/clangd/GlobalCompilationDatabase.cpp:36
   Cmd.CommandLine = ArgsAdjuster(Cmd.CommandLine, Cmd.Filename);
+  tooling::addTargetAndModeForProgramName(Cmd.CommandLine, Cmd.CommandLine[0]);
   // Inject the resource dir.
----------------
Do we actually need this if we provide a proper `Argv[0]` to the driver?
My understanding is that the driver should figure out the targets from custom binary names on its own.


================
Comment at: clang-tools-extra/clangd/test/target_info.test:1
+# RUN: rm -rf %t.dir && mkdir -p %t.dir
+
----------------
Could you add a short human-readable description of the test setup here?
Reading the bash scripts is not fun. Something like
```
Try to mock 'compile_commnands.json' for fuchsia-based builds and check the corresponding target flags
are being passed into clang.
```


================
Comment at: clang-tools-extra/clangd/test/target_info.test:8
+# (with the extra slash in the front), so we add it here.
+# RUN: sed -e "s|file://\([A-Z]\):/|file:///\1:/|g" %t.test.1 > %t.test
+
----------------
This is added unconditionally on all platforms, right?
Why not just add this extra slash directly into the input file?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63194





More information about the cfe-commits mailing list