[clang] fix translation of `UserDefinedLiteral`

Summary: User-defined literals are really just function calls.

Reviewed By: sblackshear

Differential Revision: D7813464

fbshipit-source-id: c9302b9
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent d882626d25
commit d92e82b379

@ -3103,7 +3103,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
arraySubscriptExpr_trans trans_state expr_info stmt_list arraySubscriptExpr_trans trans_state expr_info stmt_list
| BinaryOperator (stmt_info, stmt_list, expr_info, binop_info) -> | BinaryOperator (stmt_info, stmt_list, expr_info, binop_info) ->
binaryOperator_trans_with_cond trans_state stmt_info stmt_list expr_info binop_info binaryOperator_trans_with_cond trans_state stmt_info stmt_list expr_info binop_info
| CallExpr (stmt_info, stmt_list, ei) -> | CallExpr (stmt_info, stmt_list, ei) | UserDefinedLiteral (stmt_info, stmt_list, ei) ->
callExpr_trans trans_state stmt_info stmt_list ei callExpr_trans trans_state stmt_info stmt_list ei
| CXXMemberCallExpr (stmt_info, stmt_list, ei) -> | CXXMemberCallExpr (stmt_info, stmt_list, ei) ->
cxxMemberCallExpr_trans trans_state stmt_info stmt_list ei cxxMemberCallExpr_trans trans_state stmt_info stmt_list ei
@ -3306,9 +3306,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
sub-expressions *) sub-expressions *)
| ObjCAvailabilityCheckExpr (_, _, expr_info, _) -> | ObjCAvailabilityCheckExpr (_, _, expr_info, _) ->
trans_into_undefined_expr trans_state expr_info trans_into_undefined_expr trans_state expr_info
| ExtVectorElementExpr (_, stmts, _) | ExtVectorElementExpr (_, stmts, _) | ShuffleVectorExpr (_, stmts, _) ->
| ShuffleVectorExpr (_, stmts, _)
| UserDefinedLiteral (_, stmts, _) ->
skip_unimplemented trans_state stmts skip_unimplemented trans_state stmts
(* Infer somehow ended up in templated non instantiated code - right now (* Infer somehow ended up in templated non instantiated code - right now
it's not supported and failure in those cases is expected. *) it's not supported and failure in those cases is expected. *)

@ -7,7 +7,7 @@ digraph cfg {
"foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_2" [label="2: Exit foo \n " color=yellow style=filled] "foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_2" [label="2: Exit foo \n " color=yellow style=filled]
"foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_3" [label="3: Return Stmt \n *&return:int=-1 [line 12, column 13]\n " shape="box"] "foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_3" [label="3: Return Stmt \n n$0=_fun_operator\"\"_literal(0:unsigned long long) [line 12, column 20]\n *&return:int=n$0 [line 12, column 13]\n " shape="box"]
"foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_3" -> "foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_2" ; "foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_3" -> "foo#972162870672026475.86d7db357d6a36081d09067fb38ce85e_2" ;

Loading…
Cancel
Save