Move ObjectYAML code to a new library.

It is only ever used by obj2yaml and yaml2obj. No point in linking it
everywhere.

llvm-svn: 262368
This commit is contained in:
Rafael Espindola 2016-03-01 19:15:06 +00:00
parent 8a37a988e6
commit ebd9193b57
20 changed files with 43 additions and 21 deletions

View File

@ -11,11 +11,11 @@
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_OBJECT_COFFYAML_H
#define LLVM_OBJECT_COFFYAML_H
#ifndef LLVM_OBJECTYAML_COFFYAML_H
#define LLVM_OBJECTYAML_COFFYAML_H
#include "llvm/ADT/Optional.h"
#include "llvm/MC/YAML.h"
#include "llvm/ObjectYAML/YAML.h"
#include "llvm/Support/COFF.h"
namespace llvm {

View File

@ -13,10 +13,10 @@
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_OBJECT_ELFYAML_H
#define LLVM_OBJECT_ELFYAML_H
#ifndef LLVM_OBJECTYAML_ELFYAML_H
#define LLVM_OBJECTYAML_ELFYAML_H
#include "llvm/MC/YAML.h"
#include "llvm/ObjectYAML/YAML.h"
#include "llvm/Support/ELF.h"
namespace llvm {

View File

@ -1,5 +1,14 @@
#ifndef LLVM_MC_YAML_H
#define LLVM_MC_YAML_H
//===- YAML.h ---------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_OBJECTYAML_YAML_H
#define LLVM_OBJECTYAML_YAML_H
#include "llvm/Support/YAMLTraits.h"

View File

@ -10,6 +10,7 @@ add_subdirectory(Analysis)
add_subdirectory(LTO)
add_subdirectory(MC)
add_subdirectory(Object)
add_subdirectory(ObjectYAML)
add_subdirectory(Option)
add_subdirectory(DebugInfo)
add_subdirectory(ExecutionEngine)

View File

@ -48,7 +48,6 @@ add_llvm_library(LLVMMC
SubtargetFeature.cpp
WinCOFFObjectWriter.cpp
WinCOFFStreamer.cpp
YAML.cpp
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/MC

View File

@ -3,10 +3,8 @@ add_llvm_library(LLVMObject
ArchiveWriter.cpp
Binary.cpp
COFFObjectFile.cpp
COFFYAML.cpp
ELF.cpp
ELFObjectFile.cpp
ELFYAML.cpp
Error.cpp
IRObjectFile.cpp
MachOObjectFile.cpp

View File

@ -0,0 +1,5 @@
add_llvm_library(LLVMObjectYAML
YAML.cpp
COFFYAML.cpp
ELFYAML.cpp
)

View File

@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/Object/COFFYAML.h"
#include "llvm/ObjectYAML/COFFYAML.h"
#define ECase(X) IO.enumCase(Value, #X, COFF::X);
namespace llvm {

View File

@ -11,7 +11,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/Object/ELFYAML.h"
#include "llvm/ObjectYAML/ELFYAML.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/MipsABIFlags.h"

View File

@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/MC/YAML.h"
#include "llvm/ObjectYAML/YAML.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cctype>

View File

@ -1,5 +1,6 @@
set(LLVM_LINK_COMPONENTS
Object
ObjectYAML
Support
)

View File

@ -9,7 +9,7 @@
#include "obj2yaml.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/COFFYAML.h"
#include "llvm/ObjectYAML/COFFYAML.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/YAMLTraits.h"

View File

@ -11,7 +11,7 @@
#include "obj2yaml.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ELFYAML.h"
#include "llvm/ObjectYAML/ELFYAML.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/YAMLTraits.h"

View File

@ -1,6 +1,7 @@
set(LLVM_LINK_COMPONENTS
MC
Object
ObjectYAML
Support
)

View File

@ -19,7 +19,7 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/COFFYAML.h"
#include "llvm/ObjectYAML/COFFYAML.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"

View File

@ -16,7 +16,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/MC/StringTableBuilder.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ELFYAML.h"
#include "llvm/ObjectYAML/ELFYAML.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/YAMLTraits.h"

View File

@ -23,6 +23,7 @@ add_subdirectory(LineEditor)
add_subdirectory(Linker)
add_subdirectory(MC)
add_subdirectory(MI)
add_subdirectory(ObjectYAML)
add_subdirectory(Option)
add_subdirectory(ProfileData)
add_subdirectory(Support)

View File

@ -10,5 +10,4 @@ add_llvm_unittest(MCTests
DwarfLineTables.cpp
StringTableBuilderTest.cpp
TargetRegistry.cpp
YAMLTest.cpp
)

View File

@ -0,0 +1,8 @@
set(LLVM_LINK_COMPONENTS
ObjectYAML
)
add_llvm_unittest(ObjectYAMLTests
YAMLTest.cpp
)

View File

@ -1,4 +1,4 @@
//===- llvm/unittest/Object/YAMLTest.cpp - Tests for Object YAML ----------===//
//===- YAMLTest.cpp - Tests for Object YAML -------------------------------===//
//
// The LLVM Compiler Infrastructure
//
@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/MC/YAML.h"
#include "llvm/ObjectYAML/YAML.h"
#include "llvm/Support/YAMLTraits.h"
#include "gtest/gtest.h"