mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 03:14:06 +08:00
Fix tests failure on 75993812d5
It follows the rules: 1. Use native path if it's already absolute 2. Use Windows back-slash if it's windows formatting. 3. Use Posix style otherwise.
This commit is contained in:
@@ -1392,9 +1392,11 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) {
|
||||
// clang::DirectoryLookup::LookupFile when the file path is relative
|
||||
// path.
|
||||
llvm::sys::path::Style Style =
|
||||
!llvm::sys::path::is_absolute(WrittenFile) && Policy.MSVCFormatting
|
||||
? llvm::sys::path::Style::windows_backslash
|
||||
: llvm::sys::path::Style::native;
|
||||
llvm::sys::path::is_absolute(WrittenFile)
|
||||
? llvm::sys::path::Style::native
|
||||
: (Policy.MSVCFormatting
|
||||
? llvm::sys::path::Style::windows_backslash
|
||||
: llvm::sys::path::Style::posix);
|
||||
llvm::sys::path::native(WrittenFile, Style);
|
||||
OS << WrittenFile << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user