Skip to content

Commit

Permalink
Move parts of llvm-symbolizer tool into LLVMSymbolize library.
Browse files Browse the repository at this point in the history
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

llvm-svn: 251316
  • Loading branch information
vonosmas committed Oct 26, 2015
1 parent 22fd3b1 commit 57f8837
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 16 deletions.
@@ -1,4 +1,4 @@
//===-- LLVMSymbolize.h ----------------------------------------- C++ -----===//
//===-- Symbolize.h --------------------------------------------- C++ -----===//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -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"
Expand All @@ -24,12 +24,10 @@
#include <string>

namespace llvm {

typedef DILineInfoSpecifier::FunctionNameKind FunctionNameKind;
using namespace object;

namespace symbolize {

using namespace object;
using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
class ModuleInfo;

class LLVMSymbolizer {
Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/DebugInfo/CMakeLists.txt
@@ -1,4 +1,3 @@

add_subdirectory(DWARF)
add_subdirectory(PDB)

add_subdirectory(Symbolize)
2 changes: 1 addition & 1 deletion llvm/lib/DebugInfo/LLVMBuild.txt
Expand Up @@ -16,7 +16,7 @@
;===------------------------------------------------------------------------===;

[common]
subdirectories = DWARF PDB
subdirectories = DWARF PDB Symbolize

[component_0]
type = Group
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/DebugInfo/Makefile
Expand Up @@ -10,6 +10,6 @@ LEVEL = ../..

include $(LEVEL)/Makefile.config

PARALLEL_DIRS := DWARF PDB
PARALLEL_DIRS := DWARF PDB Symbolize

include $(LEVEL)/Makefile.common
include $(LEVEL)/Makefile.common
6 changes: 6 additions & 0 deletions llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
@@ -0,0 +1,6 @@
add_llvm_library(LLVMSymbolize
Symbolize.cpp

ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/Symbolize
)
22 changes: 22 additions & 0 deletions llvm/lib/DebugInfo/Symbolize/LLVMBuild.txt
@@ -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
15 changes: 15 additions & 0 deletions llvm/lib/DebugInfo/Symbolize/Makefile
@@ -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

Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-symbolizer/CMakeLists.txt
Expand Up @@ -8,9 +8,9 @@ set(LLVM_LINK_COMPONENTS
DebugInfoPDB
Object
Support
Symbolize
)

add_llvm_tool(llvm-symbolizer
LLVMSymbolize.cpp
llvm-symbolizer.cpp
)
2 changes: 1 addition & 1 deletion llvm/tools/llvm-symbolizer/Makefile
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
Expand Up @@ -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"
Expand Down

0 comments on commit 57f8837

Please sign in to comment.