[PATCH] D76653: [clang] Allow -DDEFAULT_SYSROOT to be a relative path

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 10:50:33 PDT 2020


phosek added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:143
 
+  if (llvm::sys::path::is_relative(SysRoot)) {
+    // Prepend InstalledDir if SysRoot is relative
----------------
Does this return `true` or `false` when sysroot is empty?


================
Comment at: clang/lib/Driver/Driver.cpp:145
+    // Prepend InstalledDir if SysRoot is relative
+    SmallString<128> fullpath(InstalledDir);
+    llvm::sys::path::append(fullpath, SysRoot);
----------------
Nit: according to LLVM conventions, this should `FullPath` (or just `P` which is also very common temporary path variables).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76653





More information about the cfe-commits mailing list