Coverage Report

Created: 2019-02-15 18:59

/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
// 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
10.7M
  bool exprNeedsCleanups() const { return ExprNeedsCleanups; }
25
26
127k
  bool cleanupsHaveSideEffects() const { return CleanupsHaveSideEffects; }
27
28
241k
  void setExprNeedsCleanups(bool SideEffects) {
29
241k
    ExprNeedsCleanups = true;
30
241k
    CleanupsHaveSideEffects |= SideEffects;
31
241k
  }
32
33
49.3M
  void reset() {
34
49.3M
    ExprNeedsCleanups = false;
35
49.3M
    CleanupsHaveSideEffects = false;
36
49.3M
  }
37
38
5.91M
  void mergeFrom(CleanupInfo Rhs) {
39
5.91M
    ExprNeedsCleanups |= Rhs.ExprNeedsCleanups;
40
5.91M
    CleanupsHaveSideEffects |= Rhs.CleanupsHaveSideEffects;
41
5.91M
  }
42
};
43
44
} // end namespace clang
45
46
#endif