Coverage Report

Created: 2018-09-23 03:40

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/Sema/CleanupInfo.h
Line
Count
Source
1
//===--- CleanupInfo.cpp - Cleanup Control in Sema ------------------------===//
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
//  This file implements a set of operations on whether generating an
11
//  ExprWithCleanups in a full expression.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_CLANG_SEMA_CLEANUP_INFO_H
16
#define LLVM_CLANG_SEMA_CLEANUP_INFO_H
17
18
namespace clang {
19
20
class CleanupInfo {
21
  bool ExprNeedsCleanups = false;
22
  bool CleanupsHaveSideEffects = false;
23
24
public:
25
10.6M
  bool exprNeedsCleanups() const { return ExprNeedsCleanups; }
26
27
122k
  bool cleanupsHaveSideEffects() const { return CleanupsHaveSideEffects; }
28
29
231k
  void setExprNeedsCleanups(bool SideEffects) {
30
231k
    ExprNeedsCleanups = true;
31
231k
    CleanupsHaveSideEffects |= SideEffects;
32
231k
  }
33
34
45.1M
  void reset() {
35
45.1M
    ExprNeedsCleanups = false;
36
45.1M
    CleanupsHaveSideEffects = false;
37
45.1M
  }
38
39
2.64M
  void mergeFrom(CleanupInfo Rhs) {
40
2.64M
    ExprNeedsCleanups |= Rhs.ExprNeedsCleanups;
41
2.64M
    CleanupsHaveSideEffects |= Rhs.CleanupsHaveSideEffects;
42
2.64M
  }
43
};
44
45
} // end namespace clang
46
47
#endif