[clang-format] Assert that filenames are not empty
authorpaulhoad <mydeveloperday@gmail.com>
Wed, 6 Nov 2019 17:24:10 +0000 (17:24 +0000)
committerpaulhoad <mydeveloperday@gmail.com>
Wed, 6 Nov 2019 17:25:17 +0000 (17:25 +0000)
commit7681435de148cf7a1c7db1b0daba0497630989d2
treef26d450010cb05276dc97257df9da08c4aea82c9
parent1b986b41ac40c9df82cc98ea4238d463e217bb25
[clang-format] Assert that filenames are not empty

Summary:
Adds asserts to catch empty filenames, which otherwise will cause a crash in SourceManager.
The clang-format tool now outputs an error if an empty filename is used.
Fixes bug: 34667

Reviewers: krasimir, djasper, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: cfe-commits

Patch by: @jr

Tags: #clang-format, #clang

Differential Revision: https://reviews.llvm.org/D56345
clang/tools/clang-format/ClangFormat.cpp