summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-22 21:52:10 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-22 21:52:10 +0000
commitb8725e2099fa94e487ef6dcc6f47602f319d1202 (patch)
tree9ace94c5035e0cce5536f9e73db29471cd35cedd
parentd2d52d1906b8105b3ad8ef393950be6088bcfc59 (diff)
downloadbcm5719-llvm-b8725e2099fa94e487ef6dcc6f47602f319d1202.tar.gz
bcm5719-llvm-b8725e2099fa94e487ef6dcc6f47602f319d1202.zip
Use SaveAndRestore in 'clang/Analysis/Support/SaveAndRestore.h'
llvm-svn: 76800
-rw-r--r--clang/include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h25
1 files changed, 1 insertions, 24 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h b/clang/include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h
index 0f3a1372a0f..607c9015615 100644
--- a/clang/include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h
+++ b/clang/include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h
@@ -15,32 +15,9 @@
#ifndef LLVM_CLANG_ANALYSIS_GREXPRENGINE_BUILDERS
#define LLVM_CLANG_ANALYSIS_GREXPRENGINE_BUILDERS
#include "clang/Analysis/PathSensitive/GRExprEngine.h"
+#include "clang/Analysis/Support/SaveAndRestore.h"
namespace clang {
-
-
-// SaveAndRestore - A utility class that uses RAII to save and restore
-// the value of a variable.
-template<typename T>
-struct SaveAndRestore {
- SaveAndRestore(T& x) : X(x), old_value(x) {}
- ~SaveAndRestore() { X = old_value; }
- T get() { return old_value; }
-private:
- T& X;
- T old_value;
-};
-
-// SaveOr - Similar to SaveAndRestore. Operates only on bools; the old
-// value of a variable is saved, and during the dstor the old value is
-// or'ed with the new value.
-struct SaveOr {
- SaveOr(bool& x) : X(x), old_value(x) { x = false; }
- ~SaveOr() { X |= old_value; }
-private:
- bool& X;
- const bool old_value;
-};
class GRStmtNodeBuilderRef {
GRExprEngine::NodeSet &Dst;
OpenPOWER on IntegriCloud