aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-05-19 17:12:32 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-05-20 09:58:37 +0100
commitd9b9ce6c04764275a23cd0cf1856a35aae921af7 (patch)
tree5867dc1f70170b413dc625659f2ede3fd6416257
parente5fc9a3604dca40c89cf243a5208a5135821099c (diff)
downloadllvm-d9b9ce6c04764275a23cd0cf1856a35aae921af7.zip
llvm-d9b9ce6c04764275a23cd0cf1856a35aae921af7.tar.gz
llvm-d9b9ce6c04764275a23cd0cf1856a35aae921af7.tar.bz2
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
-rw-r--r--llvm/include/llvm/CodeGen/CommandFlags.h8
-rw-r--r--llvm/lib/CodeGen/CommandFlags.cpp4
-rw-r--r--llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp1
3 files changed, 8 insertions, 5 deletions
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index c017652..a019c48 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 12fc1df..1020d22 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 e353e33..4c672bc 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;