[llvm] d9b9ce6 - CommandFlags.h - remove unnecessary includes. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 02:02:31 PDT 2020
Author: Simon Pilgrim
Date: 2020-05-20T09:58:37+01:00
New Revision: d9b9ce6c04764275a23cd0cf1856a35aae921af7
URL: https://github.com/llvm/llvm-project/commit/d9b9ce6c04764275a23cd0cf1856a35aae921af7
DIFF: https://github.com/llvm/llvm-project/commit/d9b9ce6c04764275a23cd0cf1856a35aae921af7.diff
LOG: CommandFlags.h - remove unnecessary includes. NFC.
Replace with forward declarations and move necessary includes down to source files.
Exposes an implicit dependency on TargetMachine.h in llvm-opt-fuzzer.cpp
Added:
Modified:
llvm/include/llvm/CodeGen/CommandFlags.h
llvm/lib/CodeGen/CommandFlags.cpp
llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index c017652b469b..a019c4807873 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -16,18 +16,16 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
-#include "llvm/IR/Module.h"
#include "llvm/MC/MCTargetOptionsCommandFlags.h"
-#include "llvm/MC/SubtargetFeature.h"
#include "llvm/Support/CodeGen.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Host.h"
-#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include <string>
+#include <vector>
namespace llvm {
+class Module;
+
namespace codegen {
std::string getMArch();
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 12fc1df8d9b7..1020d22d1795 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -13,6 +13,10 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/CommandFlags.h"
+#include "llvm/IR/Module.h"
+#include "llvm/MC/SubtargetFeature.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Host.h"
using namespace llvm;
diff --git a/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp b/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
index e353e333f580..4c672bc2a3bd 100644
--- a/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
+++ b/llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
@@ -21,6 +21,7 @@
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
+#include "llvm/Target/TargetMachine.h"
using namespace llvm;
More information about the llvm-commits
mailing list