[clang] translate TypeAliasDecl

Reviewed By: da319, jvillard

Differential Revision: D6319409

fbshipit-source-id: 124261f
master
Sam Blackshear 7 years ago committed by Facebook Github Bot
parent e7d9223597
commit eb0a457b02

@ -2274,7 +2274,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
| (RecordDecl _) :: _ -> | (RecordDecl _) :: _ ->
(* Case for struct *) (* Case for struct *)
collect_all_decl trans_state decl_list succ_nodes stmt_info collect_all_decl trans_state decl_list succ_nodes stmt_info
| (TypedefDecl _ | UsingDecl _ | UsingDirectiveDecl _) :: _ -> | (TypedefDecl _ | TypeAliasDecl _ | UsingDecl _ | UsingDirectiveDecl _) :: _ ->
empty_res_trans empty_res_trans
| decl :: _ -> | decl :: _ ->
CFrontend_config.unimplemented "In DeclStmt found an unknown declaration type %s" CFrontend_config.unimplemented "In DeclStmt found an unknown declaration type %s"

@ -289,6 +289,7 @@ codetoanalyze/cpp/shared/methods/virtual_methods.cpp, tri_area, 5, DIVIDE_BY_ZER
codetoanalyze/cpp/shared/methods/virtual_methods.cpp, tri_not_virtual_area, 5, DIVIDE_BY_ZERO, [start of procedure tri_not_virtual_area(),start of procedure Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Triangle_Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,start of procedure set_values,return from a call to Polygon_set_values,start of procedure area,return from a call to Polygon_area] codetoanalyze/cpp/shared/methods/virtual_methods.cpp, tri_not_virtual_area, 5, DIVIDE_BY_ZERO, [start of procedure tri_not_virtual_area(),start of procedure Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Triangle_Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,start of procedure set_values,return from a call to Polygon_set_values,start of procedure area,return from a call to Polygon_area]
codetoanalyze/cpp/shared/namespace/function.cpp, div0_namespace_resolution, 0, DIVIDE_BY_ZERO, [start of procedure div0_namespace_resolution(),start of procedure f1::get(),return from a call to f1::get,start of procedure f2::get(),return from a call to f2::get] codetoanalyze/cpp/shared/namespace/function.cpp, div0_namespace_resolution, 0, DIVIDE_BY_ZERO, [start of procedure div0_namespace_resolution(),start of procedure f1::get(),return from a call to f1::get,start of procedure f2::get(),return from a call to f2::get]
codetoanalyze/cpp/shared/namespace/function.cpp, div0_using, 2, DIVIDE_BY_ZERO, [start of procedure div0_using(),start of procedure f1::get0(),return from a call to f1::get0] codetoanalyze/cpp/shared/namespace/function.cpp, div0_using, 2, DIVIDE_BY_ZERO, [start of procedure div0_using(),start of procedure f1::get0(),return from a call to f1::get0]
codetoanalyze/cpp/shared/namespace/function.cpp, type_alias_div0, 3, DIVIDE_BY_ZERO, [start of procedure type_alias_div0()]
codetoanalyze/cpp/shared/namespace/function.cpp, using_div0, 2, DIVIDE_BY_ZERO, [start of procedure using_div0(),start of procedure ret_zero,return from a call to f3::C_ret_zero] codetoanalyze/cpp/shared/namespace/function.cpp, using_div0, 2, DIVIDE_BY_ZERO, [start of procedure using_div0(),start of procedure ret_zero,return from a call to f3::C_ret_zero]
codetoanalyze/cpp/shared/namespace/global_variable.cpp, div0_namepace_res, 3, DIVIDE_BY_ZERO, [start of procedure div0_namepace_res()] codetoanalyze/cpp/shared/namespace/global_variable.cpp, div0_namepace_res, 3, DIVIDE_BY_ZERO, [start of procedure div0_namepace_res()]
codetoanalyze/cpp/shared/namespace/global_variable.cpp, div0_static_field, 3, DIVIDE_BY_ZERO, [start of procedure div0_static_field()] codetoanalyze/cpp/shared/namespace/global_variable.cpp, div0_static_field, 3, DIVIDE_BY_ZERO, [start of procedure div0_static_field()]

@ -34,3 +34,9 @@ int using_div0() {
using f3::C; using f3::C;
return 1 / C::ret_zero(); return 1 / C::ret_zero();
} }
int type_alias_div0() {
using my_int = int;
my_int x = 0;
return 1 / x;
}

@ -66,6 +66,21 @@ digraph iCFG {
"using_div0#15267107907897398237.0f32134dc9668df527885e12e16348fe_3" -> "using_div0#15267107907897398237.0f32134dc9668df527885e12e16348fe_2" ; "using_div0#15267107907897398237.0f32134dc9668df527885e12e16348fe_3" -> "using_div0#15267107907897398237.0f32134dc9668df527885e12e16348fe_2" ;
"type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_1" [label="1: Start type_alias_div0\nFormals: \nLocals: x:int \n DECLARE_LOCALS(&return,&x); [line 38, column 1]\n " color=yellow style=filled]
"type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_1" -> "type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_4" ;
"type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_2" [label="2: Exit type_alias_div0 \n " color=yellow style=filled]
"type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_3" [label="3: Return Stmt \n n$0=*&x:int [line 41, column 14]\n *&return:int=(1 / n$0) [line 41, column 3]\n " shape="box"]
"type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_3" -> "type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_2" ;
"type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_4" [label="4: DeclStmt \n *&x:int=0 [line 40, column 3]\n " shape="box"]
"type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_4" -> "type_alias_div0#11064282270104671255.675c026241b82e6430f7456d997b57b4_3" ;
"ret_zero#C#f3#(14815103288805165028).4dbfdc84a3e84f15300709ed03f3f5c1_1" [label="1: Start f3::C_ret_zero\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 29, column 3]\n " color=yellow style=filled] "ret_zero#C#f3#(14815103288805165028).4dbfdc84a3e84f15300709ed03f3f5c1_1" [label="1: Start f3::C_ret_zero\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 29, column 3]\n " color=yellow style=filled]

Loading…
Cancel
Save