Move CFG building code to a new lib/MC/MCAnalysis library.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Jul 2014 19:49:34 +0000 (19:49 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 2 Jul 2014 19:49:34 +0000 (19:49 +0000)
The new library is 150KB on a Release+Asserts build, so it is quiet a bit of
code that regular users of MC don't need to link with now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212209 91177308-0d34-0410-b5e6-96231b3b80d8

20 files changed:
include/llvm/MC/MCAnalysis/MCAtom.h [moved from include/llvm/MC/MCAtom.h with 100% similarity]
include/llvm/MC/MCAnalysis/MCFunction.h [moved from include/llvm/MC/MCFunction.h with 100% similarity]
include/llvm/MC/MCAnalysis/MCModule.h [moved from include/llvm/MC/MCModule.h with 100% similarity]
include/llvm/MC/MCAnalysis/MCModuleYAML.h [moved from include/llvm/MC/MCModuleYAML.h with 96% similarity]
lib/MC/CMakeLists.txt
lib/MC/LLVMBuild.txt
lib/MC/MCAnalysis/CMakeLists.txt [new file with mode: 0644]
lib/MC/MCAnalysis/LLVMBuild.txt [new file with mode: 0644]
lib/MC/MCAnalysis/MCAtom.cpp [moved from lib/MC/MCAtom.cpp with 97% similarity]
lib/MC/MCAnalysis/MCFunction.cpp [moved from lib/MC/MCFunction.cpp with 94% similarity]
lib/MC/MCAnalysis/MCModule.cpp [moved from lib/MC/MCModule.cpp with 97% similarity]
lib/MC/MCAnalysis/MCModuleYAML.cpp [moved from lib/MC/MCModuleYAML.cpp with 99% similarity]
lib/MC/MCAnalysis/MCObjectDisassembler.cpp [moved from lib/MC/MCObjectDisassembler.cpp with 99% similarity]
lib/MC/MCAnalysis/MCObjectSymbolizer.cpp [moved from lib/MC/MCObjectSymbolizer.cpp with 100% similarity]
tools/llvm-objdump/CMakeLists.txt
tools/llvm-objdump/LLVMBuild.txt
tools/llvm-objdump/llvm-objdump.cpp
unittests/MC/CMakeLists.txt
unittests/MC/MCAtomTest.cpp
unittests/MC/Makefile

similarity index 96%
rename from include/llvm/MC/MCModuleYAML.h
rename to include/llvm/MC/MCAnalysis/MCModuleYAML.h
index c4ae829535c2db4187f615c0364354ffb32d3ee4..13b58a7ad64129b750a3043b1aee598c1dd4898f 100644 (file)
@@ -17,7 +17,7 @@
 #define LLVM_MC_MCMODULEYAML_H
 
 #include "llvm/ADT/StringRef.h"
-#include "llvm/MC/MCModule.h"
+#include "llvm/MC/MCAnalysis/MCModule.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
index 78bd8c4ba14444656ee860e0911f62f02828da55..f62894cab39cdfb82fd39e4dd16b248e835cd356 100644 (file)
@@ -8,7 +8,6 @@ add_llvm_library(LLVMMC
   MCAsmInfoELF.cpp
   MCAsmStreamer.cpp
   MCAssembler.cpp
-  MCAtom.cpp
   MCCodeEmitter.cpp
   MCCodeGenInfo.cpp
   MCContext.cpp
@@ -17,7 +16,6 @@ add_llvm_library(LLVMMC
   MCELF.cpp
   MCELFObjectTargetWriter.cpp
   MCELFStreamer.cpp
-  MCFunction.cpp
   MCExpr.cpp
   MCExternalSymbolizer.cpp
   MCInst.cpp
@@ -27,13 +25,9 @@ add_llvm_library(LLVMMC
   MCLinkerOptimizationHint.cpp
   MCMachOStreamer.cpp
   MCMachObjectTargetWriter.cpp
-  MCModule.cpp
-  MCModuleYAML.cpp
   MCNullStreamer.cpp
   MCObjectFileInfo.cpp
-  MCObjectDisassembler.cpp
   MCObjectStreamer.cpp
-  MCObjectSymbolizer.cpp
   MCObjectWriter.cpp
   MCRegisterInfo.cpp
   MCRelocationInfo.cpp
@@ -54,5 +48,6 @@ add_llvm_library(LLVMMC
   WinCOFFStreamer.cpp
   )
 
+add_subdirectory(MCAnalysis)
 add_subdirectory(MCParser)
 add_subdirectory(MCDisassembler)
index f35dbe4d5d350b6382c33ec5a775cedc8483117f..da9995d6c579b6b6edd4751e8312a895e2c5f43f 100644 (file)
@@ -16,7 +16,7 @@
 ;===------------------------------------------------------------------------===;
 
 [common]
-subdirectories = MCDisassembler MCParser
+subdirectories = MCAnalysis MCDisassembler MCParser
 
 [component_0]
 type = Library
diff --git a/lib/MC/MCAnalysis/CMakeLists.txt b/lib/MC/MCAnalysis/CMakeLists.txt
new file mode 100644 (file)
index 0000000..81eae2d
--- /dev/null
@@ -0,0 +1,8 @@
+add_llvm_library(LLVMMCAnalysis
+ MCAtom.cpp
+ MCFunction.cpp
+ MCModule.cpp
+ MCModuleYAML.cpp
+ MCObjectDisassembler.cpp
+ MCObjectSymbolizer.cpp
+)
diff --git a/lib/MC/MCAnalysis/LLVMBuild.txt b/lib/MC/MCAnalysis/LLVMBuild.txt
new file mode 100644 (file)
index 0000000..1b58fec
--- /dev/null
@@ -0,0 +1,5 @@
+[component_0]
+type = Library
+name = MCAnalysis
+parent = Libraries
+required_libraries = MC Object Support
similarity index 97%
rename from lib/MC/MCAtom.cpp
rename to lib/MC/MCAnalysis/MCAtom.cpp
index bc353cdcf65d4bf239c866b749a43e7566a18867..82056eed1ea9e217472f633a83e4710b873593a0 100644 (file)
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/MC/MCAtom.h"
-#include "llvm/MC/MCModule.h"
+#include "llvm/MC/MCAnalysis/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCModule.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <iterator>
 
similarity index 94%
rename from lib/MC/MCFunction.cpp
rename to lib/MC/MCAnalysis/MCFunction.cpp
index 1ddc2505f071f562e5195814cd1ea2d98ff0e676..4e09d1a52dacc8b2d073f3dc2dc7b7cf4dab0e9b 100644 (file)
@@ -7,9 +7,9 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/MC/MCFunction.h"
-#include "llvm/MC/MCAtom.h"
-#include "llvm/MC/MCModule.h"
+#include "llvm/MC/MCAnalysis/MCFunction.h"
+#include "llvm/MC/MCAnalysis/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCModule.h"
 #include <algorithm>
 
 using namespace llvm;
similarity index 97%
rename from lib/MC/MCModule.cpp
rename to lib/MC/MCAnalysis/MCModule.cpp
index 3ed735689d748ac784222df7b63d8eff705b0063..7512299c9e0a04221299e3e7c33a1cbf6b855297 100644 (file)
@@ -7,10 +7,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/MC/MCAnalysis/MCModule.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/MC/MCModule.h"
-#include "llvm/MC/MCAtom.h"
-#include "llvm/MC/MCFunction.h"
+#include "llvm/MC/MCAnalysis/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCFunction.h"
 #include <algorithm>
 
 using namespace llvm;
similarity index 99%
rename from lib/MC/MCModuleYAML.cpp
rename to lib/MC/MCAnalysis/MCModuleYAML.cpp
index f6b7431eb3bf0376a07f97d491b36b0709b7f5e8..c51c62e928d6798324cf22b2c7908405eb687408 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/MC/MCModuleYAML.h"
+#include "llvm/MC/MCAnalysis/MCModuleYAML.h"
 #include "llvm/ADT/StringMap.h"
-#include "llvm/MC/MCAtom.h"
-#include "llvm/MC/MCFunction.h"
+#include "llvm/MC/MCAnalysis/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCFunction.h"
 #include "llvm/MC/MCInstrInfo.h"
 #include "llvm/MC/MCRegisterInfo.h"
 #include "llvm/Object/YAML.h"
similarity index 99%
rename from lib/MC/MCObjectDisassembler.cpp
rename to lib/MC/MCAnalysis/MCObjectDisassembler.cpp
index 8a258cb0909720a91a67333912cdedfe5d335361..0f789ff040ff3015f58d1734f18d923681d7883f 100644 (file)
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
-#include "llvm/MC/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCFunction.h"
+#include "llvm/MC/MCAnalysis/MCModule.h"
 #include "llvm/MC/MCDisassembler.h"
-#include "llvm/MC/MCFunction.h"
 #include "llvm/MC/MCInstrAnalysis.h"
-#include "llvm/MC/MCModule.h"
 #include "llvm/MC/MCObjectSymbolizer.h"
 #include "llvm/Object/MachO.h"
 #include "llvm/Object/ObjectFile.h"
index 413cb9bb1f0d4e3216ba8fe0716b5048b89f1f81..d63602bd0189caecac6349f991848201545f1dce 100644 (file)
@@ -2,6 +2,7 @@ set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
   DebugInfo
   MC
+  MCAnalysis
   Object
   Support
   )
index d16c501a6cca1a55bab93b69c5c8781142ac349d..d9c09b60034a02d904a78898a3d74ada7fa07e70 100644 (file)
@@ -19,4 +19,4 @@
 type = Tool
 name = llvm-objdump
 parent = Tools
-required_libraries = DebugInfo MC MCDisassembler MCParser Object all-targets
+required_libraries = DebugInfo MC MCAnalysis MCDisassembler MCParser Object all-targets
index d98691b4b044f27b79ebf069e238bd8a00f6d366..309bf2369a82ef44d6943d73af7615e0b9efa248 100644 (file)
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/Triple.h"
+#include "llvm/MC/MCAnalysis/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCFunction.h"
+#include "llvm/MC/MCAnalysis/MCModule.h"
+#include "llvm/MC/MCAnalysis/MCModuleYAML.h"
 #include "llvm/MC/MCAsmInfo.h"
-#include "llvm/MC/MCAtom.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCDisassembler.h"
-#include "llvm/MC/MCFunction.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCInstPrinter.h"
 #include "llvm/MC/MCInstrAnalysis.h"
 #include "llvm/MC/MCInstrInfo.h"
-#include "llvm/MC/MCModule.h"
-#include "llvm/MC/MCModuleYAML.h"
 #include "llvm/MC/MCObjectDisassembler.h"
 #include "llvm/MC/MCObjectFileInfo.h"
 #include "llvm/MC/MCObjectSymbolizer.h"
index 0e4782c83f40ccd752c9422bf43fdcb9523f88f1..496056ecf59058810dbace2210b6a582dc1bbfbc 100644 (file)
@@ -1,11 +1,7 @@
 set(LLVM_LINK_COMPONENTS
-  MC
-  )
-
-set(MCSources
-  MCAtomTest.cpp
+  MCAnalysis
   )
 
 add_llvm_unittest(MCTests
-  ${MCSources}
+  MCAtomTest.cpp
   )
index 17b056cd2dea7b9a5572cbcd93b3f9442636e1b7..16228b521f425060dc6a6237bab030181ab36803 100644 (file)
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/MC/MCAtom.h"
-#include "llvm/MC/MCModule.h"
+#include "llvm/MC/MCAnalysis/MCAtom.h"
+#include "llvm/MC/MCAnalysis/MCModule.h"
 #include "gtest/gtest.h"
 
 namespace llvm {
index 4c25697d28dc0c0ba7749ee30746ffd242c40d39..07a608e65a34b559fbb6f3d6eafc970cdc81dcd0 100644 (file)
@@ -9,7 +9,7 @@
 
 LEVEL = ../..
 TESTNAME = MC
-LINK_COMPONENTS := MC
+LINK_COMPONENTS := MCAnalysis
 
 include $(LEVEL)/Makefile.config
 include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest