1 //===--- CleanupInfo.cpp - Cleanup Control in Sema ------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements a set of operations on whether generating an
11 // ExprWithCleanups in a full expression.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_SEMA_CLEANUP_INFO_H
16 #define LLVM_CLANG_SEMA_CLEANUP_INFO_H
21 bool ExprNeedsCleanups = false;
22 bool CleanupsHaveSideEffects = false;
25 bool exprNeedsCleanups() const { return ExprNeedsCleanups; }
27 bool cleanupsHaveSideEffects() const { return CleanupsHaveSideEffects; }
29 void setExprNeedsCleanups(bool SideEffects) {
30 ExprNeedsCleanups = true;
31 CleanupsHaveSideEffects |= SideEffects;
35 ExprNeedsCleanups = false;
36 CleanupsHaveSideEffects = false;
39 void mergeFrom(CleanupInfo Rhs) {
40 ExprNeedsCleanups |= Rhs.ExprNeedsCleanups;
41 CleanupsHaveSideEffects |= Rhs.CleanupsHaveSideEffects;
45 } // end namespace clang