[clang-tidy] Fix relative path in header-filter.

Summary:
Clang-tidy supports output diagnostics from header files if user
specifies --header-filter. But it can't handle relative path well.
For example, the folder structure of a project is:

```
// a.h is in /src/a/a.h

// b.h is in /src/b/b.h
...

// c.cpp is in /src/c.cpp

```

Now, we set --header-filter as --header-filter=/a/. That means we only
want to check header files under /src/a/ path, and ignore header files
uder /src/b/ path, but in current implementation, clang-tidy will check
/src/b/b.h also, because the name of b.h used in clang-tidy is
/src/a/../b/b.h.

This change tries to fix this issue.

Reviewers: alexfh, hokein, aaron.ballman, gribozavr

Reviewed By: gribozavr

Subscribers: MyDeveloperDay, xazax.hun, cfe-commits

Tags: #clang, #clang-tools-extra

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

Patch by Yubo Xie.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@372388 91177308-0d34-0410-b5e6-96231b3b80d8
5 files changed