Move DwarfGenerator.cpp to unittests
authorDaniel Jasper <djasper@google.com>
Thu, 8 Dec 2016 12:45:29 +0000 (12:45 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 8 Dec 2016 12:45:29 +0000 (12:45 +0000)
So far it creates a test helper and so it should be moved there. It also
create a layering cycle between CodeGen and CodeGen/AsmPrinter, which
should be avoided.

Review: https://reviews.llvm.org/D27570
llvm-svn: 289044

llvm/lib/CodeGen/CMakeLists.txt
llvm/unittests/DebugInfo/DWARF/CMakeLists.txt
llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp [moved from llvm/lib/CodeGen/DwarfGenerator.cpp with 98% similarity]
llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h [moved from llvm/lib/CodeGen/DwarfGenerator.h with 97% similarity]

index 22ee8e9..398ea88 100644 (file)
@@ -17,7 +17,6 @@ add_llvm_library(LLVMCodeGen
   DetectDeadLanes.cpp
   DFAPacketizer.cpp
   DwarfEHPrepare.cpp
-  DwarfGenerator.cpp
   EarlyIfConversion.cpp
   EdgeBundles.cpp
   ExecutionDepsFix.cpp
index b01a907..cfebba0 100644 (file)
@@ -10,6 +10,7 @@ set(LLVM_LINK_COMPONENTS
   )
 
 set(DebugInfoSources
+  DwarfGenerator.cpp
   DWARFDebugInfoTest.cpp
   DWARFFormValueTest.cpp
   )
index 47709ff..f2a1a14 100644 (file)
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "../lib/CodeGen/DwarfGenerator.h"
+#include "DwarfGenerator.h"
 #include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h"
similarity index 98%
rename from llvm/lib/CodeGen/DwarfGenerator.cpp
rename to llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
index 1e8e661..06fa121 100644 (file)
@@ -1,4 +1,4 @@
-//===--- lib/CodeGen/DwarfGenerator.cpp -------------------------*- C++ -*-===//
+//===--- unittests/DebugInfo/DWARF/DwarfGenerator.cpp -----------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "../lib/CodeGen/AsmPrinter/DwarfStringPool.h"
 #include "DwarfGenerator.h"
-#include "AsmPrinter/DwarfStringPool.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/DIE.h"
similarity index 97%
rename from llvm/lib/CodeGen/DwarfGenerator.h
rename to llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h
index 223e54b..245630e 100644 (file)
@@ -1,4 +1,4 @@
-//===--- lib/CodeGen/DwarfGenerator.h ---------------------------*- C++ -*-===//
+//===--- unittests/DebugInfo/DWARF/DwarfGenerator.h -------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFGENERATOR_H
-#define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFGENERATOR_H
+#ifndef LLVM_UNITTESTS_DEBUG_INFO_DWARF_DWARFGENERATOR_H
+#define LLVM_UNITTESTS_DEBUG_INFO_DWARF_DWARFGENERATOR_H
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/CodeGen/DIE.h"
@@ -228,4 +228,4 @@ public:
 
 } // end namespace llvm
 
-#endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFGENERATOR_H
+#endif // LLVM_UNITTESTS_DEBUG_INFO_DWARF_DWARFGENERATOR_H