Changeset ddb80bd for src/SynTree/Expression.cc
- Timestamp:
- Dec 22, 2017, 4:16:53 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- fc9153d
- Parents:
- fdd0509
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
rfdd0509 rddb80bd 83 83 } 84 84 85 long long int ConstantExpr::intValue() const { 86 if ( BasicType * basicType = dynamic_cast< BasicType * >( result ) ) { 87 if ( basicType->isInteger() ) { 88 return get_constant()->get_ival(); 89 } 90 } else if ( dynamic_cast< OneType * >( result ) ) { 91 return 1; 92 } else if ( dynamic_cast< ZeroType * >( result ) ) { 93 return 0; 94 } 95 throw SemanticError( "Constant expression of non-integral type ", this ); 96 } 97 85 98 VariableExpr::VariableExpr( DeclarationWithType *_var ) : Expression(), var( _var ) { 86 99 assert( var );
Note: See TracChangeset
for help on using the changeset viewer.