From f0bab7875e78e01c149d12302dcc4b6d4c43e25c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 26 Jun 2020 12:59:08 +0100 Subject: [PATCH] Triple.h - reduce Twine.h include to forward declarations. NFC. Move include down to a number of other files that had an implicit dependency on the Twine class. --- clang/lib/Basic/IdentifierTable.cpp | 1 + clang/lib/Basic/Targets/Mips.h | 1 + llvm/include/llvm/ADT/Triple.h | 4 +++- llvm/include/llvm/Support/TargetRegistry.h | 1 + llvm/lib/MC/MCSectionELF.cpp | 1 + llvm/lib/Support/Triple.cpp | 2 ++ llvm/unittests/ADT/TripleTest.cpp | 1 + llvm/unittests/Frontend/OpenMPContextTest.cpp | 1 + llvm/unittests/Support/ThreadPool.cpp | 1 + 9 files changed, 12 insertions(+), 1 deletion(-) diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 36b26d9..55d3f6a 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -23,6 +23,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" diff --git a/clang/lib/Basic/Targets/Mips.h b/clang/lib/Basic/Targets/Mips.h index b475c03..e2fcda3 100644 --- a/clang/lib/Basic/Targets/Mips.h +++ b/clang/lib/Basic/Targets/Mips.h @@ -16,6 +16,7 @@ #include "clang/Basic/TargetInfo.h" #include "clang/Basic/TargetOptions.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/Compiler.h" namespace clang { diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h index 8967961..c039d42 100644 --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/include/llvm/ADT/Triple.h @@ -9,7 +9,8 @@ #ifndef LLVM_ADT_TRIPLE_H #define LLVM_ADT_TRIPLE_H -#include "llvm/ADT/Twine.h" +#include "llvm/ADT/StringRef.h" +#include // Some system headers or GCC predefined macros conflict with identifiers in // this file. Undefine them here. @@ -19,6 +20,7 @@ namespace llvm { +class Twine; class VersionTuple; /// Triple - Helper class for working with autoconf configuration names. For diff --git a/llvm/include/llvm/Support/TargetRegistry.h b/llvm/include/llvm/Support/TargetRegistry.h index d91eaba..5592879 100644 --- a/llvm/include/llvm/Support/TargetRegistry.h +++ b/llvm/include/llvm/Support/TargetRegistry.h @@ -22,6 +22,7 @@ #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/Twine.h" #include "llvm/ADT/iterator_range.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/ErrorHandling.h" diff --git a/llvm/lib/MC/MCSectionELF.cpp b/llvm/lib/MC/MCSectionELF.cpp index 77c259c..ce94409 100644 --- a/llvm/lib/MC/MCSectionELF.cpp +++ b/llvm/lib/MC/MCSectionELF.cpp @@ -8,6 +8,7 @@ #include "llvm/MC/MCSectionELF.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCExpr.h" diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp index 75ec257..c35ca96 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -11,6 +11,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Host.h" #include "llvm/Support/SwapByteOrder.h" @@ -18,6 +19,7 @@ #include "llvm/Support/VersionTuple.h" #include #include + using namespace llvm; StringRef Triple::getArchTypeName(ArchType Kind) { diff --git a/llvm/unittests/ADT/TripleTest.cpp b/llvm/unittests/ADT/TripleTest.cpp index dc7a28c..1dd6b32 100644 --- a/llvm/unittests/ADT/TripleTest.cpp +++ b/llvm/unittests/ADT/TripleTest.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/Triple.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/VersionTuple.h" #include "gtest/gtest.h" diff --git a/llvm/unittests/Frontend/OpenMPContextTest.cpp b/llvm/unittests/Frontend/OpenMPContextTest.cpp index eb505be..9cdbd78 100644 --- a/llvm/unittests/Frontend/OpenMPContextTest.cpp +++ b/llvm/unittests/Frontend/OpenMPContextTest.cpp @@ -8,6 +8,7 @@ #include "llvm/Frontend/OpenMP/OMPConstants.h" #include "llvm/Frontend/OpenMP/OMPContext.h" +#include "llvm/ADT/Twine.h" #include "gtest/gtest.h" using namespace llvm; diff --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp index 43882d0..1f0b680 100644 --- a/llvm/unittests/Support/ThreadPool.cpp +++ b/llvm/unittests/Support/ThreadPool.cpp @@ -12,6 +12,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/Twine.h" #include "llvm/Support/Host.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/Threading.h" -- 2.7.4