Coverage Report

Created: 2020-09-19 12:23

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