Lines Matching defs:Environment
275 class Environment;
289 static ExprEffect NoneWithEnv(Environment* env) {
298 Environment* env() {
299 return reinterpret_cast<Environment*>(effect_ & ~kAllEffects);
307 ExprEffect(int effect, Environment* env)
319 class Environment {
321 Environment() { }
323 static Environment Unreachable() {
324 Environment env;
329 static Environment Merge(const Environment& l,
330 const Environment& r) {
331 return Environment(l, r);
334 Environment ApplyEffect(ExprEffect effect) const {
335 Environment out = effect.hasGC() ? Environment() : Environment(*this);
348 bool Equal(const Environment& env) {
352 Environment Define(const std::string& name) const {
353 return Environment(*this, SymbolToCode(name));
373 std::vector<Environment*>::iterator end = envs_.end();
374 for (std::vector<Environment*>::iterator i = envs_.begin();
399 static Environment* Allocate(const Environment& env) {
400 Environment* allocated_env = new Environment(env);
406 Environment(const Environment& l, const Environment& r)
410 Environment(const Environment& l, int code)
416 static std::vector<Environment* > envs_;
460 Environment* env_;
464 Environment::SymbolTable Environment::symbol_table_;
465 std::vector<Environment* > Environment::envs_;
469 Environment* a_env = a.env();
470 Environment* b_env = b.env();
471 Environment* out = NULL;
473 out = Environment::Allocate(*a_env);
481 Environment* a_env = b.hasGC() ? NULL : a.env();
482 Environment* b_env = b.env();
483 Environment* out = (b_env == NULL) ? a_env : b_env;
485 out = Environment::Allocate(*b_env);
493 Environment* e = env();
495 e = Environment::Allocate(Environment());
526 ExprEffect VisitExpr(clang::Expr* expr, const Environment& env) {
594 ExprEffect Visit##type (clang::type* expr, const Environment& env)
597 ExprEffect Visit##type (clang::type* expr, const Environment& env) { \
640 Environment after_cond = env.ApplyEffect(VisitExpr(expr->getCond(), env));
758 const Environment& env) {
773 const Environment& env) {
775 Environment out_env = env;
786 const Environment& env) {
798 const Environment& env) {
807 ExprEffect VisitArguments(ExprType* call, const Environment& env) {
817 const Environment& env) {
825 const Environment& env) {
854 Environment VisitStmt(clang::Stmt* stmt, const Environment& env) {
892 Environment Visit##type (clang::type* stmt, const Environment& env)
895 Environment Visit##type (clang::type* stmt, const Environment& env) { \
913 Block(const Environment& in,
916 out_(Environment::Unreachable()),
926 void MergeIn(const Environment& env) {
927 Environment old_in = in_;
928 in_ = Environment::Merge(in_, env);
940 const Environment& in() {
944 const Environment& out() {
948 void MergeOut(const Environment& env) {
949 out_ = Environment::Merge(out_, env);
953 Environment a_out = owner_->VisitStmt(a, in());
954 Environment b_out = owner_->VisitStmt(b, a_out);
955 Environment c_out = owner_->VisitStmt(c, b_out);
960 Environment a_out = owner_->VisitStmt(a, in());
961 Environment b_out = owner_->VisitStmt(b, a_out);
977 Environment in_;
978 Environment out_;
987 return Environment::Unreachable();
992 return Environment::Unreachable();
996 Environment out = env;
1033 Environment cond_out = VisitStmt(stmt->getCond(), env);
1034 Environment then_out = VisitStmt(stmt->getThen(), cond_out);
1035 Environment else_out = VisitStmt(stmt->getElse(), cond_out);
1036 return Environment::Merge(then_out, else_out);
1046 Environment in = Environment::Merge(env, block_->in());
1047 Environment after_lhs = VisitStmt(stmt->getLHS(), in);
1052 Environment in = Environment::Merge(env, block_->in());
1058 return Environment::Unreachable();
1103 Environment VisitDecl(clang::Decl* decl, const Environment& env) {
1105 Environment out = var->hasInit() ? VisitStmt(var->getInit(), env) : env;
1118 Environment out = env;
1130 Environment* env) {
1144 Environment env;
1147 Environment::ClearSymbolTable();