Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/Support/SaveAndRestore.h
Line
Count
Source
1
//===-- SaveAndRestore.h - Utility  -------------------------------*- C++ -*-=//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
///
9
/// \file
10
/// This file provides utility classes that use RAII to save and restore
11
/// values.
12
///
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_SUPPORT_SAVEANDRESTORE_H
16
#define LLVM_SUPPORT_SAVEANDRESTORE_H
17
18
namespace llvm {
19
20
/// A utility class that uses RAII to save and restore the value of a variable.
21
template <typename T> struct SaveAndRestore {
22
10.2M
  SaveAndRestore(T &X) : X(X), OldValue(X) {}
llvm::SaveAndRestore<char const*>::SaveAndRestore(char const*&)
Line
Count
Source
22
4.16M
  SaveAndRestore(T &X) : X(X), OldValue(X) {}
llvm::SaveAndRestore<bool>::SaveAndRestore(bool&)
Line
Count
Source
22
5.11M
  SaveAndRestore(T &X) : X(X), OldValue(X) {}
Unexecuted instantiation: llvm::SaveAndRestore<int>::SaveAndRestore(int&)
llvm::SaveAndRestore<llvm::Instruction*>::SaveAndRestore(llvm::Instruction*&)
Line
Count
Source
22
31.9k
  SaveAndRestore(T &X) : X(X), OldValue(X) {}
CFG.cpp:llvm::SaveAndRestore<(anonymous namespace)::LocalScope::const_iterator>::SaveAndRestore((anonymous namespace)::LocalScope::const_iterator&)
Line
Count
Source
22
303k
  SaveAndRestore(T &X) : X(X), OldValue(X) {}
CFG.cpp:llvm::SaveAndRestore<(anonymous namespace)::BlockScopePosPair>::SaveAndRestore((anonymous namespace)::BlockScopePosPair&)
Line
Count
Source
22
160k
  SaveAndRestore(T &X) : X(X), OldValue(X) {}
llvm::SaveAndRestore<clang::CFGBlock*>::SaveAndRestore(clang::CFGBlock*&)
Line
Count
Source
22
456k
  SaveAndRestore(T &X) : X(X), OldValue(X) {}
23
34.2M
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
34.2M
    X = NewValue;
25
34.2M
  }
llvm::SaveAndRestore<bool>::SaveAndRestore(bool&, bool const&)
Line
Count
Source
23
33.8M
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
33.8M
    X = NewValue;
25
33.8M
  }
Unexecuted instantiation: llvm::SaveAndRestore<llvm::PrettyStackTraceEntry*>::SaveAndRestore(llvm::PrettyStackTraceEntry*&, llvm::PrettyStackTraceEntry* const&)
llvm::SaveAndRestore<clang::SourceLocation>::SaveAndRestore(clang::SourceLocation&, clang::SourceLocation const&)
Line
Count
Source
23
5.90k
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
5.90k
    X = NewValue;
25
5.90k
  }
llvm::SaveAndRestore<clang::Decl*>::SaveAndRestore(clang::Decl*&, clang::Decl* const&)
Line
Count
Source
23
4.13k
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
4.13k
    X = NewValue;
25
4.13k
  }
llvm::SaveAndRestore<clang::ento::NodeBuilderContext const*>::SaveAndRestore(clang::ento::NodeBuilderContext const*&, clang::ento::NodeBuilderContext const* const&)
Line
Count
Source
23
97.0k
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
97.0k
    X = NewValue;
25
97.0k
  }
llvm::SaveAndRestore<unsigned int>::SaveAndRestore(unsigned int&, unsigned int const&)
Line
Count
Source
23
37.1k
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
37.1k
    X = NewValue;
25
37.1k
  }
llvm::SaveAndRestore<clang::CFGBlock*>::SaveAndRestore(clang::CFGBlock*&, clang::CFGBlock* const&)
Line
Count
Source
23
241
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
241
    X = NewValue;
25
241
  }
llvm::SaveAndRestore<clang::Expr::EvalResult*>::SaveAndRestore(clang::Expr::EvalResult*&, clang::Expr::EvalResult* const&)
Line
Count
Source
23
6.58k
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
6.58k
    X = NewValue;
25
6.58k
  }
llvm::SaveAndRestore<llvm::LLParser::PerFunctionState*>::SaveAndRestore(llvm::LLParser::PerFunctionState*&, llvm::LLParser::PerFunctionState* const&)
Line
Count
Source
23
297k
  SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) {
24
297k
    X = NewValue;
25
297k
  }
26
44.4M
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<bool>::~SaveAndRestore()
Line
Count
Source
26
38.9M
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<char const*>::~SaveAndRestore()
Line
Count
Source
26
4.16M
  ~SaveAndRestore() { X = OldValue; }
Unexecuted instantiation: llvm::SaveAndRestore<llvm::PrettyStackTraceEntry*>::~SaveAndRestore()
Unexecuted instantiation: llvm::SaveAndRestore<int>::~SaveAndRestore()
llvm::SaveAndRestore<llvm::Instruction*>::~SaveAndRestore()
Line
Count
Source
26
31.9k
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<clang::SourceLocation>::~SaveAndRestore()
Line
Count
Source
26
5.90k
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<clang::Decl*>::~SaveAndRestore()
Line
Count
Source
26
4.13k
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<clang::ento::NodeBuilderContext const*>::~SaveAndRestore()
Line
Count
Source
26
97.0k
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<unsigned int>::~SaveAndRestore()
Line
Count
Source
26
37.1k
  ~SaveAndRestore() { X = OldValue; }
CFG.cpp:llvm::SaveAndRestore<(anonymous namespace)::LocalScope::const_iterator>::~SaveAndRestore()
Line
Count
Source
26
303k
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<clang::CFGBlock*>::~SaveAndRestore()
Line
Count
Source
26
456k
  ~SaveAndRestore() { X = OldValue; }
CFG.cpp:llvm::SaveAndRestore<(anonymous namespace)::BlockScopePosPair>::~SaveAndRestore()
Line
Count
Source
26
160k
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<clang::Expr::EvalResult*>::~SaveAndRestore()
Line
Count
Source
26
6.58k
  ~SaveAndRestore() { X = OldValue; }
llvm::SaveAndRestore<llvm::LLParser::PerFunctionState*>::~SaveAndRestore()
Line
Count
Source
26
297k
  ~SaveAndRestore() { X = OldValue; }
27
294k
  T get() { return OldValue; }
Unexecuted instantiation: llvm::SaveAndRestore<llvm::PrettyStackTraceEntry*>::get()
CFG.cpp:llvm::SaveAndRestore<(anonymous namespace)::LocalScope::const_iterator>::get()
Line
Count
Source
27
266k
  T get() { return OldValue; }
llvm::SaveAndRestore<clang::CFGBlock*>::get()
Line
Count
Source
27
1.80k
  T get() { return OldValue; }
llvm::SaveAndRestore<bool>::get()
Line
Count
Source
27
25.8k
  T get() { return OldValue; }
28
29
private:
30
  T &X;
31
  T OldValue;
32
};
33
34
} // namespace llvm
35
36
#endif