Changeset 2c37f34 for src/SynTree
- Timestamp:
- Jun 22, 2017, 10:26:03 AM (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:
- f1a10a7
- Parents:
- e9a3b20b
- Location:
- src/SynTree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Constant.cc
re9a3b20b r2c37f34 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Jun 21 16:44:48201713 // Update Count : 2 711 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Jun 22 10:11:00 2017 13 // Update Count : 28 14 14 // 15 15 … … 29 29 30 30 Constant::~Constant() { delete type; } 31 32 Constant Constant::from_bool( bool b ) { 33 return Constant( new BasicType( Type::Qualifiers(), BasicType::Bool ), b ? "1" : "0" , (unsigned long long int)b ); 34 } 31 35 32 36 Constant Constant::from_int( int i ) { -
src/SynTree/Constant.h
re9a3b20b r2c37f34 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Jun 21 16:44:48201713 // Update Count : 1 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Jun 22 10:13:00 2017 13 // Update Count : 15 14 14 // 15 15 … … 33 33 void set_value( std::string newValue ) { rep = newValue; } 34 34 35 /// generates a boolean constant of the given bool 36 static Constant from_bool( bool b ); 35 37 /// generates an integer constant of the given int 36 38 static Constant from_int( int i );
Note: See TracChangeset
for help on using the changeset viewer.