- Timestamp:
- Dec 12, 2019, 10:04:15 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- e752e4e
- Parents:
- aca6a54c (diff), 2cd949b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
raca6a54c r2fa5bd2 887 887 auto expr = visitBaseExpr( node, 888 888 new AsmExpr( 889 get<Expression>().accept1(node->inout),889 new std::string(node->inout), 890 890 get<Expression>().accept1(node->constraint), 891 891 get<Expression>().accept1(node->operand) … … 2258 2258 new ast::AsmExpr( 2259 2259 old->location, 2260 GET_ACCEPT_1(inout, Expr),2260 old->inout, 2261 2261 GET_ACCEPT_1(constraint, Expr), 2262 2262 GET_ACCEPT_1(operand, Expr) -
src/AST/Expr.hpp
raca6a54c r2fa5bd2 556 556 class AsmExpr final : public Expr { 557 557 public: 558 ptr<Expr>inout;558 std::string inout; 559 559 ptr<Expr> constraint; 560 560 ptr<Expr> operand; 561 561 562 AsmExpr( const CodeLocation & loc, const Expr *io, const Expr * con, const Expr * op )562 AsmExpr( const CodeLocation & loc, const std::string & io, const Expr * con, const Expr * op ) 563 563 : Expr( loc ), inout( io ), constraint( con ), operand( op ) {} 564 564 -
src/AST/Pass.impl.hpp
raca6a54c r2fa5bd2 1300 1300 maybe_accept( node, &AsmExpr::result ); 1301 1301 } 1302 maybe_accept( node, &AsmExpr::inout );1303 1302 maybe_accept( node, &AsmExpr::constraint ); 1304 1303 maybe_accept( node, &AsmExpr::operand ); -
src/AST/Print.cpp
raca6a54c r2fa5bd2 1011 1011 os << "Asm Expression:" << endl; 1012 1012 ++indent; 1013 if ( node->inout ) node->inout->accept( *this );1013 if ( !node->inout.empty() ) os << "[" << node->inout << "] "; 1014 1014 if ( node->constraint ) node->constraint->accept( *this ); 1015 1015 if ( node->operand ) node->operand->accept( *this ); -
src/CodeGen/CodeGenerator.cc
raca6a54c r2fa5bd2 786 786 787 787 void CodeGenerator::postvisit( AsmExpr * asmExpr ) { 788 if ( asmExpr->get_inout() ) {788 if ( !asmExpr->inout.empty() ) { 789 789 output << "[ "; 790 asmExpr->get_inout()->accept( *visitor );790 output << asmExpr->inout; 791 791 output << " ] "; 792 792 } // if 793 asmExpr-> get_constraint()->accept( *visitor );793 asmExpr->constraint->accept( *visitor ); 794 794 output << " ( "; 795 asmExpr-> get_operand()->accept( *visitor );795 asmExpr->operand->accept( *visitor ); 796 796 output << " )"; 797 797 } -
src/Common/PassVisitor.impl.h
raca6a54c r2fa5bd2 2452 2452 2453 2453 indexerScopedAccept( node->result , *this ); 2454 maybeAccept_impl ( node->inout , *this );2455 2454 maybeAccept_impl ( node->constraint, *this ); 2456 2455 maybeAccept_impl ( node->operand , *this ); … … 2464 2463 2465 2464 indexerScopedAccept( node->result , *this ); 2466 maybeAccept_impl ( node->inout , *this );2467 2465 maybeAccept_impl ( node->constraint, *this ); 2468 2466 maybeAccept_impl ( node->operand , *this ); … … 2477 2475 indexerScopedMutate( node->env , *this ); 2478 2476 indexerScopedMutate( node->result , *this ); 2479 maybeMutate_impl ( node->inout , *this );2480 2477 maybeMutate_impl ( node->constraint, *this ); 2481 2478 maybeMutate_impl ( node->operand , *this ); -
src/Common/SemanticError.cc
raca6a54c r2fa5bd2 149 149 // Helpers 150 150 namespace ErrorHelpers { 151 Colors colors = Colors::Auto; 152 153 static inline bool with_colors() { 154 return colors == Colors::Auto ? isatty( STDERR_FILENO ) : bool(colors); 155 } 156 151 157 const std::string & error_str() { 152 static std::string str = isatty( STDERR_FILENO) ? "\e[31merror:\e[39m " : "error: ";158 static std::string str = with_colors() ? "\e[31merror:\e[39m " : "error: "; 153 159 return str; 154 160 } 155 161 156 162 const std::string & warning_str() { 157 static std::string str = isatty( STDERR_FILENO) ? "\e[95mwarning:\e[39m " : "warning: ";163 static std::string str = with_colors() ? "\e[95mwarning:\e[39m " : "warning: "; 158 164 return str; 159 165 } 160 166 161 167 const std::string & bold_ttycode() { 162 static std::string str = isatty( STDERR_FILENO) ? "\e[1m" : "";168 static std::string str = with_colors() ? "\e[1m" : ""; 163 169 return str; 164 170 } 165 171 166 172 const std::string & reset_font_ttycode() { 167 static std::string str = isatty( STDERR_FILENO) ? "\e[0m" : "";173 static std::string str = with_colors() ? "\e[0m" : ""; 168 174 return str; 169 175 } -
src/Common/SemanticError.h
raca6a54c r2fa5bd2 97 97 // Helpers 98 98 namespace ErrorHelpers { 99 enum class Colors { 100 Never = false, 101 Always = true, 102 Auto, 103 }; 104 105 extern Colors colors; 106 99 107 const std::string & error_str(); 100 108 const std::string & warning_str(); -
src/Concurrency/Keywords.cc
raca6a54c r2fa5bd2 59 59 60 60 Declaration * postmutate( StructDecl * decl ); 61 DeclarationWithType * postmutate( FunctionDecl * decl ); 61 62 62 63 void handle( StructDecl * ); … … 77 78 KeywordCastExpr::Target cast_target; 78 79 79 StructDecl* type_decl = nullptr; 80 StructDecl * type_decl = nullptr; 81 FunctionDecl * dtor_decl = nullptr; 80 82 }; 81 83 … … 97 99 "__thrd", 98 100 "get_thread", 99 "thread keyword requires threads to be in scope, add #include <thread.hfa> ",101 "thread keyword requires threads to be in scope, add #include <thread.hfa>\n", 100 102 true, 101 103 KeywordCastExpr::Thread … … 129 131 "__cor", 130 132 "get_coroutine", 131 "coroutine keyword requires coroutines to be in scope, add #include <coroutine.hfa> ",133 "coroutine keyword requires coroutines to be in scope, add #include <coroutine.hfa>\n", 132 134 true, 133 135 KeywordCastExpr::Coroutine … … 161 163 "__mon", 162 164 "get_monitor", 163 "monitor keyword requires monitors to be in scope, add #include <monitor.hfa> ",165 "monitor keyword requires monitors to be in scope, add #include <monitor.hfa>\n", 164 166 false, 165 167 KeywordCastExpr::Monitor … … 284 286 } 285 287 288 DeclarationWithType * ConcurrentSueKeyword::postmutate( FunctionDecl * decl ) { 289 if( !type_decl ) return decl; 290 if( !CodeGen::isDestructor( decl->name ) ) return decl; 291 292 auto params = decl->type->parameters; 293 if( params.size() != 1 ) return decl; 294 295 auto type = dynamic_cast<ReferenceType*>( params.front()->get_type() ); 296 if( !type ) return decl; 297 298 auto stype = dynamic_cast<StructInstType*>( type->base ); 299 if( !stype ) return decl; 300 if( stype->baseStruct != type_decl ) return decl; 301 302 if( !dtor_decl ) dtor_decl = decl; 303 return decl; 304 } 305 286 306 Expression * ConcurrentSueKeyword::postmutate( KeywordCastExpr * cast ) { 287 307 if ( cast_target == cast->target ) { 288 308 // convert (thread &)t to (thread_desc &)*get_thread(t), etc. 289 309 if( !type_decl ) SemanticError( cast, context_error ); 290 Expression * arg = cast->arg; 291 cast->arg = nullptr; 292 delete cast; 293 return new CastExpr( 294 UntypedExpr::createDeref( 295 new UntypedExpr( new NameExpr( getter_name ), { arg } ) 296 ), 297 new ReferenceType( 298 noQualifiers, 299 new StructInstType( noQualifiers, type_decl ) ) 300 ); 310 if( !dtor_decl ) SemanticError( cast, context_error ); 311 assert( cast->result == nullptr ); 312 cast->set_result( new ReferenceType( noQualifiers, new StructInstType( noQualifiers, type_decl ) ) ); 313 cast->concrete_target.field = field_name; 314 cast->concrete_target.getter = getter_name; 301 315 } 302 316 return cast; … … 308 322 309 323 if( !type_decl ) SemanticError( decl, context_error ); 324 if( !dtor_decl ) SemanticError( decl, context_error ); 310 325 311 326 FunctionDecl * func = forwardDeclare( decl ); -
src/ControlStruct/MLEMutator.cc
raca6a54c r2fa5bd2 231 231 232 232 Statement *MLEMutator::mutateLoop( Statement *bodyLoop, Entry &e ) { 233 // only generate these when needed 234 if( !e.isContUsed() && !e.isBreakUsed() ) return bodyLoop; 235 233 236 // ensure loop body is a block 234 CompoundStmt *newBody; 235 if ( ! (newBody = dynamic_cast<CompoundStmt *>( bodyLoop )) ) { 236 newBody = new CompoundStmt(); 237 newBody->get_kids().push_back( bodyLoop ); 238 } // if 239 240 // only generate these when needed 237 CompoundStmt * newBody = new CompoundStmt(); 238 newBody->get_kids().push_back( bodyLoop ); 241 239 242 240 if ( e.isContUsed() ) { -
src/GenPoly/Lvalue.cc
raca6a54c r2fa5bd2 60 60 } 61 61 62 struct ReferenceConversions final : public WithStmtsToAdd {62 struct ReferenceConversions final : public WithStmtsToAdd, public WithGuards { 63 63 Expression * postmutate( CastExpr * castExpr ); 64 64 Expression * postmutate( AddressExpr * addrExpr ); … … 71 71 72 72 struct FixIntrinsicResult final : public WithGuards { 73 enum { 74 NoSkip, 75 Skip, 76 SkipInProgress 77 } skip = NoSkip; 78 79 void premutate( AsmExpr * ) { GuardValue( skip ); skip = Skip; } 80 void premutate( ApplicationExpr * ) { GuardValue( skip ); skip = (skip == Skip) ? SkipInProgress : NoSkip; } 81 82 73 83 Expression * postmutate( ApplicationExpr * appExpr ); 74 84 void premutate( FunctionDecl * funcDecl ); … … 162 172 163 173 Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) { 164 if ( isIntrinsicReference( appExpr ) ) {174 if ( skip != SkipInProgress && isIntrinsicReference( appExpr ) ) { 165 175 // eliminate reference types from intrinsic applications - now they return lvalues 166 176 ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result ); -
src/Parser/parser.yy
raca6a54c r2fa5bd2 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Aug 4 21:48:23201913 // Update Count : 43 6412 // Last Modified On : Sat Dec 7 10:43:44 2019 13 // Update Count : 4394 14 14 // 15 15 … … 211 211 } // forCtrl 212 212 213 KeywordCastExpr::Target Aggregate2Target( DeclarationNode::Aggregate aggr ) { 214 KeywordCastExpr::Target target; 215 switch ( aggr ) { 216 case DeclarationNode::Coroutine: target = KeywordCastExpr::Coroutine; break; 217 case DeclarationNode::Monitor: target = KeywordCastExpr::Monitor; break; 218 case DeclarationNode::Thread: target = KeywordCastExpr::Thread; break; 219 default: abort(); 220 } // switch 221 return target; 222 } // Aggregate2Target 223 213 224 214 225 bool forall = false, yyy = false; // aggregate have one or more forall qualifiers ? … … 365 376 %type<decl> abstract_parameter_declaration 366 377 367 %type<aggKey> aggregate_key 378 %type<aggKey> aggregate_key aggregate_data aggregate_control 368 379 %type<decl> aggregate_type aggregate_type_nobody 369 380 … … 650 661 | postfix_expression '.' '[' field_name_list ']' // CFA, tuple field selector 651 662 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 663 | postfix_expression '.' aggregate_control 664 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $3 ), $1 ) ); } 652 665 | postfix_expression ARROW identifier 653 666 { $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); } … … 793 806 | '(' type_no_function ')' cast_expression 794 807 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 795 // keyword cast cannot be grouped because of reduction in aggregate_key 796 | '(' GENERATOR '&' ')' cast_expression // CFA 797 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 798 | '(' COROUTINE '&' ')' cast_expression // CFA 799 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 800 | '(' THREAD '&' ')' cast_expression // CFA 801 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Thread, $5 ) ); } 802 | '(' MONITOR '&' ')' cast_expression // CFA 803 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Monitor, $5 ) ); } 808 | '(' aggregate_control '&' ')' cast_expression // CFA 809 { $$ = new ExpressionNode( build_keyword_cast( Aggregate2Target( $2 ), $5 ) ); } 804 810 // VIRTUAL cannot be opt because of look ahead issues 805 811 | '(' VIRTUAL ')' cast_expression // CFA … … 1423 1429 asm_operand: // GCC 1424 1430 string_literal '(' constant_expression ')' 1425 { $$ = new ExpressionNode( new AsmExpr( maybeMoveBuild< Expression >( (ExpressionNode *)nullptr ), $1, maybeMoveBuild< Expression >( $3 ) ) ); }1426 | '[' constant_expression']' string_literal '(' constant_expression ')'1427 { $$ = new ExpressionNode( new AsmExpr( maybeMoveBuild< Expression >( $2 ), $4, maybeMoveBuild< Expression >( $6 ) ) ); }1431 { $$ = new ExpressionNode( new AsmExpr( nullptr, $1, maybeMoveBuild< Expression >( $3 ) ) ); } 1432 | '[' IDENTIFIER ']' string_literal '(' constant_expression ')' 1433 { $$ = new ExpressionNode( new AsmExpr( $2, $4, maybeMoveBuild< Expression >( $6 ) ) ); } 1428 1434 ; 1429 1435 … … 2059 2065 2060 2066 aggregate_key: 2067 aggregate_data 2068 | aggregate_control 2069 ; 2070 2071 aggregate_data: 2061 2072 STRUCT 2062 2073 { yyy = true; $$ = DeclarationNode::Struct; } 2063 2074 | UNION 2064 2075 { yyy = true; $$ = DeclarationNode::Union; } 2065 | EXCEPTION 2076 | EXCEPTION // CFA 2066 2077 { yyy = true; $$ = DeclarationNode::Exception; } 2067 | GENERATOR 2078 ; 2079 2080 aggregate_control: // CFA 2081 GENERATOR 2068 2082 { yyy = true; $$ = DeclarationNode::Coroutine; } 2069 2083 | COROUTINE … … 2096 2110 distInl( $3 ); 2097 2111 } 2112 | INLINE aggregate_control ';' // CFA 2113 { SemanticError( yylloc, "INLINE aggregate control currently unimplemented." ); $$ = nullptr; } 2098 2114 | typedef_declaration ';' // CFA 2099 2115 | cfa_field_declaring_list ';' // CFA, new style field declaration -
src/ResolvExpr/AlternativeFinder.cc
raca6a54c r2fa5bd2 69 69 void postvisit( CastExpr * castExpr ); 70 70 void postvisit( VirtualCastExpr * castExpr ); 71 void postvisit( KeywordCastExpr * castExpr ); 71 72 void postvisit( UntypedMemberExpr * memberExpr ); 72 73 void postvisit( MemberExpr * memberExpr ); … … 1255 1256 } 1256 1257 1258 void AlternativeFinder::Finder::postvisit( KeywordCastExpr * castExpr ) { 1259 assertf( castExpr->get_result(), "Cast target should have been set in Validate." ); 1260 auto ref = dynamic_cast<ReferenceType*>(castExpr->get_result()); 1261 assert(ref); 1262 auto inst = dynamic_cast<StructInstType*>(ref->base); 1263 assert(inst); 1264 auto target = inst->baseStruct; 1265 1266 AlternativeFinder finder( indexer, env ); 1267 1268 auto pick_alternatives = [target, this](AltList & found, bool expect_ref) { 1269 for(auto & alt : found) { 1270 Type * expr = alt.expr->get_result(); 1271 if(expect_ref) { 1272 auto res = dynamic_cast<ReferenceType*>(expr); 1273 if(!res) { continue; } 1274 expr = res->base; 1275 } 1276 1277 if(auto insttype = dynamic_cast<TypeInstType*>(expr)) { 1278 auto td = alt.env.lookup(insttype->name); 1279 if(!td) { continue; } 1280 expr = td->type; 1281 } 1282 1283 if(auto base = dynamic_cast<StructInstType*>(expr)) { 1284 if(base->baseStruct == target) { 1285 alternatives.push_back( 1286 std::move(alt) 1287 ); 1288 } 1289 } 1290 } 1291 }; 1292 1293 try { 1294 // Attempt 1 : turn (thread&)X into (thread_desc&)X.__thrd 1295 // Clone is purely for memory management 1296 std::unique_ptr<Expression> tech1 { new UntypedMemberExpr(new NameExpr(castExpr->concrete_target.field), castExpr->arg->clone()) }; 1297 1298 // don't prune here, since it's guaranteed all alternatives will have the same type 1299 finder.findWithoutPrune( tech1.get() ); 1300 pick_alternatives(finder.alternatives, false); 1301 1302 return; 1303 } catch(SemanticErrorException & ) {} 1304 1305 // Fallback : turn (thread&)X into (thread_desc&)get_thread(X) 1306 std::unique_ptr<Expression> fallback { UntypedExpr::createDeref( new UntypedExpr(new NameExpr(castExpr->concrete_target.getter), { castExpr->arg->clone() })) }; 1307 // don't prune here, since it's guaranteed all alternatives will have the same type 1308 finder.findWithoutPrune( fallback.get() ); 1309 1310 pick_alternatives(finder.alternatives, true); 1311 1312 // Whatever happens here, we have no more fallbacks 1313 } 1314 1257 1315 namespace { 1258 1316 /// Gets name from untyped member expression (member must be NameExpr) -
src/ResolvExpr/Resolver.cc
raca6a54c r2fa5bd2 485 485 visit_children = false; 486 486 findVoidExpression( asmExpr->operand, indexer ); 487 if ( asmExpr->get_inout() ) {488 findVoidExpression( asmExpr->inout, indexer );489 } // if490 487 } 491 488 … … 1365 1362 asmExpr = ast::mutate_field( 1366 1363 asmExpr, &ast::AsmExpr::operand, findVoidExpression( asmExpr->operand, symtab ) ); 1367 1368 if ( asmExpr->inout ) {1369 asmExpr = ast::mutate_field(1370 asmExpr, &ast::AsmExpr::inout, findVoidExpression( asmExpr->inout, symtab ) );1371 }1372 1364 1373 1365 return asmExpr; -
src/SynTree/Expression.cc
raca6a54c r2fa5bd2 527 527 } 528 528 529 AsmExpr::AsmExpr( const AsmExpr & other ) : Expression( other ), inout( maybeClone( other.inout )), constraint( maybeClone( other.constraint ) ), operand( maybeClone( other.operand ) ) {}529 AsmExpr::AsmExpr( const AsmExpr & other ) : Expression( other ), inout( other.inout ), constraint( maybeClone( other.constraint ) ), operand( maybeClone( other.operand ) ) {} 530 530 531 531 532 532 void AsmExpr::print( std::ostream & os, Indenter indent ) const { 533 533 os << "Asm Expression: " << std::endl; 534 if ( inout ) inout->print( os, indent+1 );534 if ( !inout.empty() ) os << "[" << inout << "] "; 535 535 if ( constraint ) constraint->print( os, indent+1 ); 536 536 if ( operand ) operand->print( os, indent+1 ); -
src/SynTree/Expression.h
raca6a54c r2fa5bd2 231 231 enum Target { 232 232 Coroutine, Thread, Monitor, NUMBER_OF_TARGETS 233 } target; 233 }; 234 struct Concrete { 235 std::string field; 236 std::string getter; 237 }; 238 Target target; 239 Concrete concrete_target; 234 240 235 241 KeywordCastExpr( Expression * arg, Target target ); … … 575 581 class AsmExpr : public Expression { 576 582 public: 577 Expression *inout;583 std::string inout; 578 584 Expression * constraint; 579 585 Expression * operand; 580 586 581 AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}587 AsmExpr( const std::string * _inout, Expression * constraint, Expression * operand ) : inout( _inout ? *_inout : "" ), constraint( constraint ), operand( operand ) { delete _inout; } 582 588 AsmExpr( const AsmExpr & other ); 583 virtual ~AsmExpr() { delete inout; delete constraint; delete operand; }; 584 585 Expression * get_inout() const { return inout; } 586 void set_inout( Expression * newValue ) { inout = newValue; } 587 588 Expression * get_constraint() const { return constraint; } 589 void set_constraint( Expression * newValue ) { constraint = newValue; } 590 591 Expression * get_operand() const { return operand; } 592 void set_operand( Expression * newValue ) { operand = newValue; } 589 virtual ~AsmExpr() { delete constraint; delete operand; }; 593 590 594 591 virtual AsmExpr * clone() const override { return new AsmExpr( * this ); } -
src/cfa.make
raca6a54c r2fa5bd2 4 4 LTCFACOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ 5 5 $(LIBTOOLFLAGS) --mode=compile $(CFACC) $(DEFS) \ 6 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(CFAFLAGS) \ 7 $(AM_CFLAGS) $(CFLAGS) 6 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFAFLAGS) $(AM_CFLAGS) $(CFAFLAGS) $(CFLAGS) 8 7 9 8 AM_V_CFA = $(am__v_CFA_@AM_V@) -
src/main.cc
raca6a54c r2fa5bd2 407 407 408 408 409 static const char optstring[] = ": hlLmNnpP:S:twW:D:";409 static const char optstring[] = ":c:ghlLmNnpP:S:twW:D:"; 410 410 411 411 enum { PreludeDir = 128 }; 412 412 static struct option long_opts[] = { 413 { "colors", required_argument, nullptr, 'c' }, 414 { "gdb", no_argument, nullptr, 'g' }, 413 415 { "help", no_argument, nullptr, 'h' }, 414 416 { "libcfa", no_argument, nullptr, 'l' }, … … 422 424 { "statistics", required_argument, nullptr, 'S' }, 423 425 { "tree", no_argument, nullptr, 't' }, 424 { "gdb", no_argument, nullptr, 'g' },425 426 { "", no_argument, nullptr, 0 }, // -w 426 427 { "", no_argument, nullptr, 0 }, // -W … … 430 431 431 432 static const char * description[] = { 432 "print help message", // -h 433 "generate libcfa.c", // -l 434 "generate line marks", // -L 435 "do not replace main", // -m 436 "do not generate line marks", // -N 437 "do not read prelude", // -n 433 "diagnostic color: never, always, or auto.", // -c 434 "wait for gdb to attach", // -g 435 "print help message", // -h 436 "generate libcfa.c", // -l 437 "generate line marks", // -L 438 "do not replace main", // -m 439 "do not generate line marks", // -N 440 "do not read prelude", // -n 438 441 "generate prototypes for prelude functions", // -p 439 "print", 442 "print", // -P 440 443 "<directory> prelude directory for debug/nodebug", // no flag 441 444 "<option-list> enable profiling information:\n counters,heap,time,all,none", // -S 442 "building cfa standard lib", // -t 443 "wait for gdb to attach", // -g 444 "", // -w 445 "", // -W 446 "", // -D 445 "building cfa standard lib", // -t 446 "", // -w 447 "", // -W 448 "", // -D 447 449 }; // description 448 450 … … 512 514 while ( (c = getopt_long( argc, argv, optstring, long_opts, nullptr )) != -1 ) { 513 515 switch ( c ) { 516 case 'c': // diagnostic colors 517 if ( strcmp( optarg, "always" ) == 0 ) { 518 ErrorHelpers::colors = ErrorHelpers::Colors::Always; 519 } else if ( strcmp( optarg, "never" ) == 0 ) { 520 ErrorHelpers::colors = ErrorHelpers::Colors::Never; 521 } else if ( strcmp( optarg, "auto" ) == 0 ) { 522 ErrorHelpers::colors = ErrorHelpers::Colors::Auto; 523 } // if 524 break; 514 525 case 'h': // help message 515 526 usage( argv ); // no return
Note: See TracChangeset
for help on using the changeset viewer.