llvm-project/llvm
Vinicius Tinti 577adda54f [Support/Path] Add path::is_absolute_gnu
Implements IS_ABSOLUTE_PATH from GNU tools.

C++17 is_absolute behavior is different the from the behavior defined by GNU
tools.

According to cppreference.com, C++17 states: "An absolute path is a path
that unambiguously identifies the location of a file without reference
to an additional starting location."

In other words, the rules are:
 1. POSIX style paths with nonempty root directory are absolute.
 2. Windows style paths with nonempty root name and root directory are
    absolute.
 3. No other paths are absolute.

GNU rules are:
 1. Paths starting with a path separator are absolute.
 2. Windows style paths are also absolute if they start with a character
    followed by ':'.
 3. No other paths are absolute.

On Windows style the path "C:\Users\Default" has "C:" as root name and "\"
as root directory.

Hence "C:" on Windows is absolute under GNU rules and not absolute under
C++17 because it has no root directory. Likewise "/" and "\" on Windows are
absolute under GNU and are not absolute under C++17 due to empty root name.

Related to PR46368.

Differential Revision: https://reviews.llvm.org/D87667
2020-09-23 18:01:32 +01:00
..
benchmarks
bindings
cmake Revert "[CMake] Use find_dependency in LLVMConfig.cmake" 2020-09-22 00:24:15 -07:00
docs [docs][llvm] Fix typos 2020-09-23 10:19:02 -04:00
examples [ORC][examples] Add missing library dependencies. 2020-09-22 16:18:00 -07:00
include [Support/Path] Add path::is_absolute_gnu 2020-09-23 18:01:32 +01:00
lib [Support/Path] Add path::is_absolute_gnu 2020-09-23 18:01:32 +01:00
projects
resources
runtimes [cmake] Centralize LLVM_ENABLE_WARNINGS option 2020-09-21 10:23:17 -07:00
test [UpdateTestChecks] Remove bug-exposing test 2020-09-23 11:28:28 -05:00
tools [llvm-readelf/obj] - Fix extended section symbol indices printed in warnings for MIPS GOT/PLT entries. 2020-09-23 13:42:56 +03:00
unittests [Support/Path] Add path::is_absolute_gnu 2020-09-23 18:01:32 +01:00
utils [gn build] Port 8a64689e26 2020-09-22 18:07:36 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [cmake] Centralize LLVM_ENABLE_WARNINGS option 2020-09-21 10:23:17 -07:00
CODE_OWNERS.TXT Update PowerPC backend ownership in CODE_OWNERS.TXT 2020-09-14 15:45:57 -05:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.