[OpenMP][NFC] Remove the need to include `OpenMPClause.h`
authorReid Kleckner <rnk@google.com>
Fri, 3 Apr 2020 19:35:30 +0000 (12:35 -0700)
committerReid Kleckner <rnk@google.com>
Fri, 3 Apr 2020 20:27:52 +0000 (13:27 -0700)
commitba1ffd25c1f7a3564136b13e49fb1a7185561613
treef9ce85dbd9e415bc308baa008fd629593a998ba2
parente33a636e26349bf42557908766911654d60cb6c0
[OpenMP][NFC] Remove the need to include `OpenMPClause.h`

See rational here: https://reviews.llvm.org/D76173#1922916
Time to compile Attr.h in isolation goes from 2.6s to 1.8s.

Original patch by Johannes, plus some additions from Reid to fix some
clang tooling targets.

Effect on transitive includes is marginal, though:

$ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \
   | grep '^[-+] ' | sort | uniq -c | sort -nr
    104 -    /usr/local/google/home/rnk/llvm-project/clang/include/clang/AST/OpenMPClause.h
     87 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
     19 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/SmallSet.h
     19 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/SetVector.h
     14 -    /usr/include/c++/9/set
...

Differential Revision: https://reviews.llvm.org/D76184
13 files changed:
clang-tools-extra/clangd/XRefs.cpp
clang/include/clang/AST/Attr.h
clang/include/clang/AST/OpenMPClause.h
clang/include/clang/Basic/OpenMPKinds.h
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/AttrImpl.cpp
clang/lib/AST/OpenMPClause.cpp
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/lib/Tooling/Transformer/SourceCode.cpp