[all-commits] [llvm/llvm-project] c1554f: [clang][FileManager] Support empty file name in ge...

Alex Lorenz via All-commits all-commits at lists.llvm.org
Wed Apr 14 11:29:45 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1554f32e3b3fafab64698fdb5b806b1bda4aa8a
      https://github.com/llvm/llvm-project/commit/c1554f32e3b3fafab64698fdb5b806b1bda4aa8a
  Author: Alex Lorenz <arphaman at gmail.com>
  Date:   2021-04-14 (Wed, 14 Apr 2021)

  Changed paths:
    M clang/lib/Basic/FileManager.cpp
    A clang/test/Misc/serialized-diags-empty-filename.c

  Log Message:
  -----------
  [clang][FileManager] Support empty file name in getVirtualFileRef for serialized diagnostics

After https://reviews.llvm.org/D90484 libclang is unable to read a serialized diagnostic file
which contains a diagnostic which came from a file with an empty filename. The reason being is
that the serialized diagnostic reader is creating a virtual file for the "" filename, which now
fails after the changes in https://reviews.llvm.org/D90484. This patch restores the previous
behavior in getVirtualFileRef by allowing it to construct a file entry ref with an empty name by
pretending its name is "." so that the directory entry can be created.

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




More information about the All-commits mailing list