| 84 | } |
| 85 | |
| 86 | AST_Expression::AST_ExprValue* get_annotation_member_ev( |
| 87 | AST_Annotation_Appl* appl, const char* member_name, AST_Expression::ExprType type) |
| 88 | { |
| 89 | AST_Annotation_Member* member = |
| 90 | dynamic_cast<AST_Annotation_Member*>((*appl)[member_name]); |
| 91 | if (member) { |
| 92 | AST_Expression* e = member->value(); |
| 93 | if (e && e->ev()) { |
| 94 | if (e->ev()->et != type) { |
| 95 | be_util::misc_error_and_abort(std::string("Found unexpected expression type " |
| 96 | "while getting value of member \"") + |
| 97 | member_name + "\" of annotation \"" + |
| 98 | appl->local_name()->get_string() + '"', |
| 99 | appl); |
| 100 | } |
| 101 | return e->ev(); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | be_util::misc_error_and_abort(std::string("Found null pointer while getting value of member \"") + |
| 106 | member_name + "\" of annotation \"" + |
| 107 | appl->local_name()->get_string() + '"', |
| 108 | appl); |
| 109 | return 0; |
| 110 | } |
| 111 | |
| 112 | bool get_bool_annotation_member_value(AST_Annotation_Appl* appl, |
| 113 | const char* member_name) |
no test coverage detected