OSDN Git Service

[Support] Support both Windows and Posix paths on both platforms.
authorZachary Turner <zturner@google.com>
Thu, 16 Mar 2017 22:28:04 +0000 (22:28 +0000)
committerZachary Turner <zturner@google.com>
Thu, 16 Mar 2017 22:28:04 +0000 (22:28 +0000)
commitc33642eea7743d636bce1781a3adfaef5e9ee351
tree6bbfd380ddfc9c771a41032da32e08c843da6cd3
parent36d60de9d64cf228d80bf61fe67ae4c28d869e9d
[Support] Support both Windows and Posix paths on both platforms.

Previously which path syntax we supported dependend on what
platform we were compiling LLVM on.  While this is normally
desirable, there are situations where we need to be able to
handle a path that we know was generated on a remote host.
Remote debugging, for example, or parsing debug info.

99% of the code in LLVM for handling paths was platform
agnostic and literally just a few branches were gated behind
pre-processor checks, so this changes those sites to use
runtime checks instead, and adds a flag to every path
API that allows one to override the host native syntax.

Differential Revision: https://reviews.llvm.org/D30858

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298004 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/Path.h
lib/Support/Path.cpp
lib/Support/Windows/Path.inc
unittests/Support/Path.cpp