diff --git a/include/llvm/Object/COFFYAML.h b/include/llvm/ObjectYAML/COFFYAML.h similarity index 98% rename from include/llvm/Object/COFFYAML.h rename to include/llvm/ObjectYAML/COFFYAML.h index 12a25223bd3..ea1de163cba 100644 --- a/include/llvm/Object/COFFYAML.h +++ b/include/llvm/ObjectYAML/COFFYAML.h @@ -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 { diff --git a/include/llvm/Object/ELFYAML.h b/include/llvm/ObjectYAML/ELFYAML.h similarity index 98% rename from include/llvm/Object/ELFYAML.h rename to include/llvm/ObjectYAML/ELFYAML.h index df0aa500c8a..81a4ec28c94 100644 --- a/include/llvm/Object/ELFYAML.h +++ b/include/llvm/ObjectYAML/ELFYAML.h @@ -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 { diff --git a/include/llvm/MC/YAML.h b/include/llvm/ObjectYAML/YAML.h similarity index 88% rename from include/llvm/MC/YAML.h rename to include/llvm/ObjectYAML/YAML.h index 383cdc6785f..7f6836809b6 100644 --- a/include/llvm/MC/YAML.h +++ b/include/llvm/ObjectYAML/YAML.h @@ -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" diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index d00c10f5802..9449421ef7a 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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) diff --git a/lib/MC/CMakeLists.txt b/lib/MC/CMakeLists.txt index a04f16c6ea7..698dc9fa0b2 100644 --- a/lib/MC/CMakeLists.txt +++ b/lib/MC/CMakeLists.txt @@ -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 diff --git a/lib/Object/CMakeLists.txt b/lib/Object/CMakeLists.txt index 2ac2ee51dc2..7993e751ec3 100644 --- a/lib/Object/CMakeLists.txt +++ b/lib/Object/CMakeLists.txt @@ -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 diff --git a/lib/ObjectYAML/CMakeLists.txt b/lib/ObjectYAML/CMakeLists.txt new file mode 100644 index 00000000000..9ebe1e30ad0 --- /dev/null +++ b/lib/ObjectYAML/CMakeLists.txt @@ -0,0 +1,5 @@ +add_llvm_library(LLVMObjectYAML + YAML.cpp + COFFYAML.cpp + ELFYAML.cpp + ) diff --git a/lib/Object/COFFYAML.cpp b/lib/ObjectYAML/COFFYAML.cpp similarity index 99% rename from lib/Object/COFFYAML.cpp rename to lib/ObjectYAML/COFFYAML.cpp index 4c1fca19bf1..0aa13628028 100644 --- a/lib/Object/COFFYAML.cpp +++ b/lib/ObjectYAML/COFFYAML.cpp @@ -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 { diff --git a/lib/Object/ELFYAML.cpp b/lib/ObjectYAML/ELFYAML.cpp similarity index 99% rename from lib/Object/ELFYAML.cpp rename to lib/ObjectYAML/ELFYAML.cpp index 856fd636cc1..06db57a1788 100644 --- a/lib/Object/ELFYAML.cpp +++ b/lib/ObjectYAML/ELFYAML.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Object/ELFYAML.h" +#include "llvm/ObjectYAML/ELFYAML.h" #include "llvm/Support/Casting.h" #include "llvm/Support/MipsABIFlags.h" diff --git a/lib/MC/YAML.cpp b/lib/ObjectYAML/YAML.cpp similarity index 98% rename from lib/MC/YAML.cpp rename to lib/ObjectYAML/YAML.cpp index 45db5c302ee..75cf1fbccc8 100644 --- a/lib/MC/YAML.cpp +++ b/lib/ObjectYAML/YAML.cpp @@ -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 diff --git a/tools/obj2yaml/CMakeLists.txt b/tools/obj2yaml/CMakeLists.txt index 3cdac5c7487..9d8c32f9e42 100644 --- a/tools/obj2yaml/CMakeLists.txt +++ b/tools/obj2yaml/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Object + ObjectYAML Support ) diff --git a/tools/obj2yaml/coff2yaml.cpp b/tools/obj2yaml/coff2yaml.cpp index f675bfe4e61..343ed12cf14 100644 --- a/tools/obj2yaml/coff2yaml.cpp +++ b/tools/obj2yaml/coff2yaml.cpp @@ -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" diff --git a/tools/obj2yaml/elf2yaml.cpp b/tools/obj2yaml/elf2yaml.cpp index f2b01380734..e05f428e16a 100644 --- a/tools/obj2yaml/elf2yaml.cpp +++ b/tools/obj2yaml/elf2yaml.cpp @@ -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" diff --git a/tools/yaml2obj/CMakeLists.txt b/tools/yaml2obj/CMakeLists.txt index 52e9df4d766..ac3fd7765c6 100644 --- a/tools/yaml2obj/CMakeLists.txt +++ b/tools/yaml2obj/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS MC Object + ObjectYAML Support ) diff --git a/tools/yaml2obj/yaml2coff.cpp b/tools/yaml2obj/yaml2coff.cpp index 9a0c92f2e6f..44535077e08 100644 --- a/tools/yaml2obj/yaml2coff.cpp +++ b/tools/yaml2obj/yaml2coff.cpp @@ -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" diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index 2839afe9096..a2ae5e2e756 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -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" diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 48a573ac5bc..49a9b31b60d 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -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) diff --git a/unittests/MC/CMakeLists.txt b/unittests/MC/CMakeLists.txt index 7c39f439823..c760c0267a9 100644 --- a/unittests/MC/CMakeLists.txt +++ b/unittests/MC/CMakeLists.txt @@ -10,5 +10,4 @@ add_llvm_unittest(MCTests DwarfLineTables.cpp StringTableBuilderTest.cpp TargetRegistry.cpp - YAMLTest.cpp ) diff --git a/unittests/ObjectYAML/CMakeLists.txt b/unittests/ObjectYAML/CMakeLists.txt new file mode 100644 index 00000000000..baed10b8730 --- /dev/null +++ b/unittests/ObjectYAML/CMakeLists.txt @@ -0,0 +1,8 @@ +set(LLVM_LINK_COMPONENTS + ObjectYAML + ) + +add_llvm_unittest(ObjectYAMLTests + YAMLTest.cpp + ) + diff --git a/unittests/MC/YAMLTest.cpp b/unittests/ObjectYAML/YAMLTest.cpp similarity index 87% rename from unittests/MC/YAMLTest.cpp rename to unittests/ObjectYAML/YAMLTest.cpp index 09709ad73fc..606e160d19a 100644 --- a/unittests/MC/YAMLTest.cpp +++ b/unittests/ObjectYAML/YAMLTest.cpp @@ -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"