OSDN Git Service

Move parts of llvm-symbolizer tool into LLVMSymbolize library.
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 26 Oct 2015 17:56:12 +0000 (17:56 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 26 Oct 2015 17:56:12 +0000 (17:56 +0000)
Summary: See http://lists.llvm.org/pipermail/llvm-dev/2015-October/091624.html

Reviewers: echristo

Subscribers: llvm-commits, aizatsky

Differential Revision: http://reviews.llvm.org/D13998

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

include/llvm/DebugInfo/Symbolize/Symbolize.h [moved from tools/llvm-symbolizer/LLVMSymbolize.h with 95% similarity]
lib/DebugInfo/CMakeLists.txt
lib/DebugInfo/LLVMBuild.txt
lib/DebugInfo/Makefile
lib/DebugInfo/Symbolize/CMakeLists.txt [new file with mode: 0644]
lib/DebugInfo/Symbolize/LLVMBuild.txt [new file with mode: 0644]
lib/DebugInfo/Symbolize/Makefile [new file with mode: 0644]
lib/DebugInfo/Symbolize/Symbolize.cpp [moved from tools/llvm-symbolizer/LLVMSymbolize.cpp with 99% similarity]
tools/llvm-symbolizer/CMakeLists.txt
tools/llvm-symbolizer/Makefile
tools/llvm-symbolizer/llvm-symbolizer.cpp

similarity index 95%
rename from tools/llvm-symbolizer/LLVMSymbolize.h
rename to include/llvm/DebugInfo/Symbolize/Symbolize.h
index 17df56e..c58c51b 100644 (file)
@@ -1,4 +1,4 @@
-//===-- LLVMSymbolize.h ----------------------------------------- C++ -----===//
+//===-- Symbolize.h --------------------------------------------- C++ -----===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -10,8 +10,8 @@
 // Header for LLVM symbolization library.
 //
 //===----------------------------------------------------------------------===//
-#ifndef LLVM_TOOLS_LLVM_SYMBOLIZER_LLVMSYMBOLIZE_H
-#define LLVM_TOOLS_LLVM_SYMBOLIZER_LLVMSYMBOLIZE_H
+#ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
+#define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/DebugInfo/DIContext.h"
 #include <string>
 
 namespace llvm {
-
-typedef DILineInfoSpecifier::FunctionNameKind FunctionNameKind;
-using namespace object;
-
 namespace symbolize {
 
+using namespace object;
+using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
 class ModuleInfo;
 
 class LLVMSymbolizer {
index 645d92f..86f0efe 100644 (file)
@@ -1,4 +1,3 @@
-
 add_subdirectory(DWARF)
 add_subdirectory(PDB)
-
+add_subdirectory(Symbolize)
index 7a8e8ba..fbffe3a 100644 (file)
@@ -16,7 +16,7 @@
 ;===------------------------------------------------------------------------===;
 
 [common]
-subdirectories = DWARF PDB
+subdirectories = DWARF PDB Symbolize
 
 [component_0]
 type = Group
index 27a5e1f..20e9495 100644 (file)
@@ -10,6 +10,6 @@ LEVEL = ../..
 
 include $(LEVEL)/Makefile.config
 
-PARALLEL_DIRS := DWARF PDB
+PARALLEL_DIRS := DWARF PDB Symbolize
 
-include $(LEVEL)/Makefile.common
\ No newline at end of file
+include $(LEVEL)/Makefile.common
diff --git a/lib/DebugInfo/Symbolize/CMakeLists.txt b/lib/DebugInfo/Symbolize/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0e43eaa
--- /dev/null
@@ -0,0 +1,6 @@
+add_llvm_library(LLVMSymbolize
+  Symbolize.cpp
+
+  ADDITIONAL_HEADER_DIRS
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/Symbolize
+  )
diff --git a/lib/DebugInfo/Symbolize/LLVMBuild.txt b/lib/DebugInfo/Symbolize/LLVMBuild.txt
new file mode 100644 (file)
index 0000000..f9ec6b3
--- /dev/null
@@ -0,0 +1,22 @@
+;===- ./lib/DebugInfo/Symbolize/LLVMBuild.txt ------------------*- Conf -*--===;
+;
+;                     The LLVM Compiler Infrastructure
+;
+; This file is distributed under the University of Illinois Open Source
+; License. See LICENSE.TXT for details.
+;
+;===------------------------------------------------------------------------===;
+;
+; This is an LLVMBuild description file for the components in this subdirectory.
+;
+; For more information on the LLVMBuild system, please see:
+;
+;   http://llvm.org/docs/LLVMBuild.html
+;
+;===------------------------------------------------------------------------===;
+
+[component_0]
+type = Library
+name = Symbolize
+parent = DebugInfo
+required_libraries = DebugInfoDWARF DebugInfoPDB Object Support
diff --git a/lib/DebugInfo/Symbolize/Makefile b/lib/DebugInfo/Symbolize/Makefile
new file mode 100644 (file)
index 0000000..17aac93
--- /dev/null
@@ -0,0 +1,15 @@
+##===- lib/DebugInfo/Symbolize/Makefile --------------------*- Makefile -*-===##
+#
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../..
+LIBRARYNAME = LLVMSymbolize
+BUILD_ARCHIVE := 1
+
+include $(LEVEL)/Makefile.common
+
similarity index 99%
rename from tools/llvm-symbolizer/LLVMSymbolize.cpp
rename to lib/DebugInfo/Symbolize/Symbolize.cpp
index 51bb965..ffe3747 100644 (file)
@@ -11,7 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "LLVMSymbolize.h"
+#include "llvm/DebugInfo/Symbolize/Symbolize.h"
+
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Config/config.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
@@ -45,6 +46,7 @@
 namespace llvm {
 namespace symbolize {
 
+// FIXME: Move this to llvm-symbolizer tool.
 static bool error(std::error_code ec) {
   if (!ec)
     return false;
index 5df3b17..b04c45f 100644 (file)
@@ -8,9 +8,9 @@ set(LLVM_LINK_COMPONENTS
   DebugInfoPDB
   Object
   Support
+  Symbolize
   )
 
 add_llvm_tool(llvm-symbolizer
-  LLVMSymbolize.cpp
   llvm-symbolizer.cpp
   )
index de75bef..8272d61 100644 (file)
@@ -9,7 +9,7 @@
 
 LEVEL := ../..
 TOOLNAME := llvm-symbolizer
-LINK_COMPONENTS := DebugInfoDWARF DebugInfoPDB Object
+LINK_COMPONENTS := DebugInfoDWARF DebugInfoPDB Object Support Symbolize
 
 # This tool has no plugins, optimize startup time.
 TOOL_NO_EXPORTS := 1
index e773f04..5784e6b 100644 (file)
@@ -15,8 +15,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "LLVMSymbolize.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/DebugInfo/Symbolize/Symbolize.h"
 #include "llvm/Support/COM.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"