This option matches MSVC options and does the path substitution for the file references in the preprocessor macros, debug and coverage information. This option acts as a clang's ``-ffile-prefix-map=value`` and with some known differences in behavior with original CL's option that do not affect the functionality: * nomalizes the macro prefix map pathes -- removes `./` and uses the target's platform-specific path separator character when exanding the preprocessor macros -- ``-ffile-reproducible`` (but not the debug and coverage prefix maps). * does not require ``/experimental:deterministic`` as by MSVC. It needed for removing a hostname from a mangling hash gen, but clang-cl does not use a hostname when generates the hashes. Known issues: * does not remap the pathes within PCH/PCM files. Reland #198664
22 lines
712 B
C++
22 lines
712 B
C++
// Note: %s and %S must be preceded by --, otherwise it may be interpreted as a
|
|
// command-line option, e.g. on Mac where %s is commonly under /Users.
|
|
|
|
// RUN: %clang_cl /clang:-emit-llvm /pathmap:%p=x:/path-to/ -clang:-S -clang:-o- -- %s 2>&1 | FileCheck %s --check-prefix=CHECK-PREFIX-MAP
|
|
|
|
// CHECK-PREFIX-MAP: c"x:\\path-to\\cl-pathmap.cpp\00"
|
|
|
|
namespace std {
|
|
class source_location {
|
|
public:
|
|
struct __impl {
|
|
const char *_M_file_name;
|
|
const char *_M_function_name;
|
|
unsigned _M_line;
|
|
unsigned _M_column;
|
|
};
|
|
};
|
|
} // namespace std
|
|
|
|
const std::source_location::__impl *__m_impl = static_cast<const std::source_location::__impl *>(__builtin_source_location());
|
|
const char* file = __m_impl->_M_file_name;
|