Reuse code from CGDebugInfo::getOrCreateFile() when creating the file
authorAdrian Prantl <aprantl@apple.com>
Tue, 11 Dec 2018 16:58:43 +0000 (16:58 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 11 Dec 2018 16:58:43 +0000 (16:58 +0000)
commitaa5bad449bec3b8b5aafca96e3d6daaac9be86a5
tree4d87d9f6828499b46a78bd819669bb472bf05394
parent743ae6045d41318149bc8d1bdaf8ce4f48792c90
Reuse code from CGDebugInfo::getOrCreateFile() when creating the file
for the DICompileUnit.

This addresses post-commit feedback for D55085. Without this patch, a
main source file with an absolute paths may appear in different
DIFiles, once with the absolute path and once with the common prefix
between the absolute path and the current working directory.

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

llvm-svn: 348865
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/test/CodeGen/debug-info-compilation-dir.c
clang/test/PCH/debug-info-pch-path.c