Changes in src/AST/Expr.cpp [b91bfde:3e5dd913]
- File:
-
- 1 edited
-
src/AST/Expr.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.cpp
rb91bfde r3e5dd913 260 260 } 261 261 262 ConstantExpr * ConstantExpr::from_string( const CodeLocation & loc, const std::string & str ) {263 const Type * charType = new BasicType( BasicType::Char );264 // Adjust the length of the string for the terminator.265 const Expr * strSize = from_ulong( loc, str.size() + 1 );266 const Type * strType = new ArrayType( charType, strSize, FixedLen, StaticDim );267 const std::string strValue = "\"" + str + "\"";268 return new ConstantExpr( loc, strType, strValue, std::nullopt );269 }270 271 262 ConstantExpr * ConstantExpr::null( const CodeLocation & loc, const Type * ptrType ) { 272 263 return new ConstantExpr{
Note:
See TracChangeset
for help on using the changeset viewer.