Move CFG building code to a new lib/MC/MCAnalysis library.

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
This commit is contained in:
Rafael Espindola 2014-07-02 19:49:34 +00:00
parent a42211335a
commit cca08872b0
20 changed files with 41 additions and 36 deletions

View 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 {

View 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)

View File

@ -16,7 +16,7 @@
;===------------------------------------------------------------------------===;
[common]
subdirectories = MCDisassembler MCParser
subdirectories = MCAnalysis MCDisassembler MCParser
[component_0]
type = Library

View File

@ -0,0 +1,8 @@
add_llvm_library(LLVMMCAnalysis
MCAtom.cpp
MCFunction.cpp
MCModule.cpp
MCModuleYAML.cpp
MCObjectDisassembler.cpp
MCObjectSymbolizer.cpp
)

View File

@ -0,0 +1,5 @@
[component_0]
type = Library
name = MCAnalysis
parent = Libraries
required_libraries = MC Object Support

View 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>

View 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;

View 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;

View File

@ -11,10 +11,10 @@
//
//===----------------------------------------------------------------------===//
#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"

View File

@ -13,11 +13,11 @@
#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"

View File

@ -2,6 +2,7 @@ set(LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
DebugInfo
MC
MCAnalysis
Object
Support
)

View 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

View File

@ -20,17 +20,17 @@
#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"

View File

@ -1,11 +1,7 @@
set(LLVM_LINK_COMPONENTS
MC
)
set(MCSources
MCAtomTest.cpp
MCAnalysis
)
add_llvm_unittest(MCTests
${MCSources}
MCAtomTest.cpp
)

View 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 {

View 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