Coverage Report

Created: 2018-09-23 22:08

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/StringSet.h
Line
Count
Source
1
//===- StringSet.h - The LLVM Compiler Driver -------------------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open
6
// Source License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
//  StringSet - A set-like wrapper for the StringMap.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_ADT_STRINGSET_H
15
#define LLVM_ADT_STRINGSET_H
16
17
#include "llvm/ADT/StringMap.h"
18
#include "llvm/ADT/StringRef.h"
19
#include "llvm/Support/Allocator.h"
20
#include <cassert>
21
#include <initializer_list>
22
#include <utility>
23
24
namespace llvm {
25
26
  /// StringSet - A wrapper for StringMap that provides set-like functionality.
27
  template <class AllocatorTy = MallocAllocator>
28
  class StringSet : public StringMap<char, AllocatorTy> {
29
    using base = StringMap<char, AllocatorTy>;
30
31
  public:
32
1.17M
    StringSet() = default;
llvm::StringSet<llvm::MallocAllocator>::StringSet()
Line
Count
Source
32
1.13M
    StringSet() = default;
llvm::StringSet<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul> >::StringSet()
Line
Count
Source
32
40.6k
    StringSet() = default;
33
3.53k
    StringSet(std::initializer_list<StringRef> S) {
34
3.53k
      for (StringRef X : S)
35
45.3k
        insert(X);
36
3.53k
    }
37
38
244M
    std::pair<typename base::iterator, bool> insert(StringRef Key) {
39
244M
      assert(!Key.empty());
40
244M
      return base::insert(std::make_pair(Key, '\0'));
41
244M
    }
llvm::StringSet<llvm::MallocAllocator>::insert(llvm::StringRef)
Line
Count
Source
38
244M
    std::pair<typename base::iterator, bool> insert(StringRef Key) {
39
244M
      assert(!Key.empty());
40
244M
      return base::insert(std::make_pair(Key, '\0'));
41
244M
    }
llvm::StringSet<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul> >::insert(llvm::StringRef)
Line
Count
Source
38
160
    std::pair<typename base::iterator, bool> insert(StringRef Key) {
39
160
      assert(!Key.empty());
40
160
      return base::insert(std::make_pair(Key, '\0'));
41
160
    }
42
43
    template <typename InputIt>
44
2.56k
    void insert(const InputIt &Begin, const InputIt &End) {
45
2.57k
      for (auto It = Begin; It != End; 
++It11
)
46
11
        base::insert(std::make_pair(*It, '\0'));
47
2.56k
    }
48
  };
49
50
} // end namespace llvm
51
52
#endif // LLVM_ADT_STRINGSET_H