Remove a temporary variable and just construct a unique_ptr directly using make_unique.
[oota-llvm.git] / tools / llvm-cov / FunctionCoverageMapping.h
1 //===- FunctionCoverageMapping.h - Function coverage mapping record -------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // A structure that stores the coverage mapping record for a single function.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
15 #define LLVM_COV_FUNCTIONCOVERAGEMAPPING_H
16
17 #include <string>
18 #include <vector>
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/ProfileData/CoverageMapping.h"
22
23 namespace llvm {
24
25 /// \brief Stores all the required information
26 /// about code coverage for a single function.
27 struct FunctionCoverageMapping {
28   /// \brief Raw function name.
29   std::string Name;
30   std::vector<std::string> Filenames;
31   std::vector<coverage::CountedRegion> CountedRegions;
32
33   FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames)
34       : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
35 };
36
37 } // namespace llvm
38
39 #endif // LLVM_COV_FUNCTIONCOVERAGEMAPPING_H