Skip to content

Commit

Permalink
Move coverage related code into a separate library.
Browse files Browse the repository at this point in the history
Differential Revision: http://reviews.llvm.org/D19333

llvm-svn: 268089
  • Loading branch information
Easwaran Raman committed Apr 29, 2016
1 parent 2fe9304 commit dc70712
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/Support/raw_ostream.h"

namespace llvm {
Expand Down
5 changes: 2 additions & 3 deletions llvm/lib/ProfileData/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ add_llvm_library(LLVMProfileData
InstrProf.cpp
InstrProfReader.cpp
InstrProfWriter.cpp
CoverageMapping.cpp
CoverageMappingWriter.cpp
CoverageMappingReader.cpp
ProfileSummary.cpp
SampleProf.cpp
SampleProfReader.cpp
Expand All @@ -16,3 +13,5 @@ add_llvm_library(LLVMProfileData
DEPENDS
intrinsics_gen
)

add_subdirectory(Coverage)
11 changes: 11 additions & 0 deletions llvm/lib/ProfileData/Coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_llvm_library(LLVMCoverage
CoverageMapping.cpp
CoverageMappingWriter.cpp
CoverageMappingReader.cpp

ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/ProfileData/Coverage

DEPENDS
intrinsics_gen
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
//
//===----------------------------------------------------------------------===//

#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ProfileData/CoverageMappingReader.h"
#include "llvm/ProfileData/Coverage/CoverageMappingReader.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

#include "llvm/ProfileData/CoverageMappingReader.h"
#include "llvm/ProfileData/Coverage/CoverageMappingReader.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/Object/MachOUniversal.h"
#include "llvm/Object/ObjectFile.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

#include "llvm/ProfileData/CoverageMappingWriter.h"
#include "llvm/ProfileData/Coverage/CoverageMappingWriter.h"
#include "llvm/Support/LEB128.h"

using namespace llvm;
Expand Down
23 changes: 23 additions & 0 deletions llvm/lib/ProfileData/Coverage/LLVMBuild.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
;===- ./lib/ProfileData/Coverage/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 = Coverage
parent = ProfileData
required_libraries = Core Object ProfileData Support

5 changes: 4 additions & 1 deletion llvm/lib/ProfileData/LLVMBuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
;
;===------------------------------------------------------------------------===;

[common]
subdirectories = Coverage

[component_0]
type = Library
name = ProfileData
parent = Libraries
required_libraries = Core Support Object
required_libraries = Core Support
2 changes: 1 addition & 1 deletion llvm/tools/llvm-cov/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_LINK_COMPONENTS core support object profiledata)
set(LLVM_LINK_COMPONENTS core support object coverage profiledata)

add_llvm_tool(llvm-cov
llvm-cov.cpp
Expand Down
4 changes: 2 additions & 2 deletions llvm/tools/llvm-cov/CodeCoverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
//
//===----------------------------------------------------------------------===//

#include "RenderingSupport.h"
#include "CoverageFilters.h"
#include "CoverageReport.h"
#include "CoverageViewOptions.h"
#include "RenderingSupport.h"
#include "SourceCoverageView.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-cov/CoverageFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef LLVM_COV_COVERAGEFILTERS_H
#define LLVM_COV_COVERAGEFILTERS_H

#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include <memory>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-cov/CoverageSummaryInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef LLVM_COV_COVERAGESUMMARYINFO_H
#define LLVM_COV_COVERAGESUMMARYINFO_H

#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/Support/raw_ostream.h"

namespace llvm {
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-cov/LLVMBuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
type = Tool
name = llvm-cov
parent = Tools
required_libraries = ProfileData Support Instrumentation
required_libraries = Coverage Support Instrumentation
2 changes: 1 addition & 1 deletion llvm/tools/llvm-cov/SourceCoverageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define LLVM_COV_SOURCECOVERAGEVIEW_H

#include "CoverageViewOptions.h"
#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/Support/MemoryBuffer.h"
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions llvm/unittests/ProfileData/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(LLVM_LINK_COMPONENTS
Core
Coverage
ProfileData
Support
)
Expand Down
6 changes: 3 additions & 3 deletions llvm/unittests/ProfileData/CoverageMappingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
//
//===----------------------------------------------------------------------===//

#include "llvm/ProfileData/CoverageMapping.h"
#include "llvm/ProfileData/CoverageMappingReader.h"
#include "llvm/ProfileData/CoverageMappingWriter.h"
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/ProfileData/Coverage/CoverageMappingReader.h"
#include "llvm/ProfileData/Coverage/CoverageMappingWriter.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/ProfileData/InstrProfWriter.h"
#include "llvm/Support/raw_ostream.h"
Expand Down

0 comments on commit dc70712

Please sign in to comment.