[clang] f0bab78 - Triple.h - reduce Twine.h include to forward declarations. NFC.
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 26 05:14:30 PDT 2020
Author: Simon Pilgrim
Date: 2020-06-26T13:06:57+01:00
New Revision: f0bab7875e78e01c149d12302dcc4b6d4c43e25c
URL: https://github.com/llvm/llvm-project/commit/f0bab7875e78e01c149d12302dcc4b6d4c43e25c
DIFF: https://github.com/llvm/llvm-project/commit/f0bab7875e78e01c149d12302dcc4b6d4c43e25c.diff
LOG: 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.
Added:
Modified:
clang/lib/Basic/IdentifierTable.cpp
clang/lib/Basic/Targets/Mips.h
llvm/include/llvm/ADT/Triple.h
llvm/include/llvm/Support/TargetRegistry.h
llvm/lib/MC/MCSectionELF.cpp
llvm/lib/Support/Triple.cpp
llvm/unittests/ADT/TripleTest.cpp
llvm/unittests/Frontend/OpenMPContextTest.cpp
llvm/unittests/Support/ThreadPool.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 36b26d9b7c68..55d3f6a447b2 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 b475c03889a1..e2fcda3329ab 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 89679619dd55..c039d424487d 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 <cassert>
// 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 d91eabae8235..5592879630de 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 77c259c27a04..ce94409a5429 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 75ec257e15b5..c35ca9641f60 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 <cassert>
#include <cstring>
+
using namespace llvm;
StringRef Triple::getArchTypeName(ArchType Kind) {
diff --git a/llvm/unittests/ADT/TripleTest.cpp b/llvm/unittests/ADT/TripleTest.cpp
index dc7a28c72f20..1dd6b32cb8eb 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 eb505be042cb..9cdbd783ae18 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 43882d0f3cee..1f0b6804338b 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"
More information about the cfe-commits
mailing list