[llvm, clang] Remove stdlib includes from .h files without `std::`
authorNico Weber <thakis@chromium.org>
Tue, 27 Apr 2021 16:31:09 +0000 (12:31 -0400)
committerNico Weber <thakis@chromium.org>
Tue, 27 Apr 2021 16:41:39 +0000 (12:41 -0400)
commit21da04f701735ecd42f1d43b3f58b708ad382905
tree07b551a50d5444b670708883390a84b7e0aaa2d9
parent4dc6763289a0496f59af28141fff6133ba322a04
[llvm, clang] Remove stdlib includes from .h files without `std::`

Found files not containing `std::` with:

    INCL="algorithm|array|list|map|memory|queue|set|string|utility|vector|unordered_map|unordered_set"
    git ls-files llvm/include/llvm | grep '\.h$' | xargs grep -L std:: | \
        xargs grep -El "#include <($INCL)>$" > to_process.txt
    git ls-files clang/include/clang | grep '\.h$' | xargs grep -L std:: | \
        xargs grep -El "#include <($INCL)>$" >> to_process.txt

Then removed these headers from those files with

    INCL_ESCAPED="$(echo $INCL|sed 's/|/\\|/g')"
    cat to_process.txt | xargs sed -i "/^#include <\($INCL_ESCAPED\)>$/d"
    cat to_process.txt | xargs sed -i '/^$/N;/^\n$/D'

No behavior change.

Differential Revision: https://reviews.llvm.org/D101378
17 files changed:
clang/include/clang/AST/DeclContextInternals.h
clang/include/clang/Driver/Options.h
clang/include/clang/Index/CommentToXML.h
clang/include/clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h
clang/include/clang/Tooling/Refactoring/RefactoringActionRule.h
clang/include/clang/Tooling/Transformer/Parsing.h
llvm/include/llvm/CodeGen/MachineInstrBuilder.h
llvm/include/llvm/CodeGen/TileShapeInfo.h
llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
llvm/include/llvm/DebugInfo/GSYM/FileEntry.h
llvm/include/llvm/DebugInfo/GSYM/StringTable.h
llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
llvm/include/llvm/Target/CGPassBuilderOption.h
llvm/include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h