Jacob Dufault
8 years ago
22 changed files with 538 additions and 189 deletions
@ -0,0 +1,35 @@ |
|||
struct Foo; |
|||
|
|||
void foo(Foo* f, Foo*); |
|||
void foo(Foo* f, Foo*) {} |
|||
|
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Foo", |
|||
"short_name": "Foo", |
|||
"qualified_name": "Foo", |
|||
"declaration": "tests/usage/type_usage_declare_param_prototype.cc:1:8", |
|||
"uses": ["tests/usage/type_usage_declare_param_prototype.cc:3:15", "tests/usage/type_usage_declare_param_prototype.cc:3:22", "tests/usage/type_usage_declare_param_prototype.cc:4:15", "tests/usage/type_usage_declare_param_prototype.cc:4:22"] |
|||
}], |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#*$@S@Foo#S0_#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"declaration": "tests/usage/type_usage_declare_param_prototype.cc:3:6", |
|||
"definition": "tests/usage/type_usage_declare_param_prototype.cc:4:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:type_usage_declare_param_prototype.cc@49@F@foo#*$@S@Foo#S0_#@f", |
|||
"short_name": "f", |
|||
"qualified_name": "f", |
|||
"declaration": "tests/usage/type_usage_declare_param_prototype.cc:4:15", |
|||
"initializations": ["tests/usage/type_usage_declare_param_prototype.cc:4:15"], |
|||
"variable_type": 0 |
|||
}] |
|||
} |
|||
*/ |
@ -0,0 +1,78 @@ |
|||
struct Type {}; |
|||
|
|||
void foo(Type& a0, const Type& a1) { |
|||
Type a2; |
|||
Type* a3; |
|||
const Type* a4; |
|||
const Type const* a5; |
|||
} |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Type", |
|||
"short_name": "Type", |
|||
"qualified_name": "Type", |
|||
"definition": "tests/usage/type_usage_declare_qualifiers.cc:1:8", |
|||
"uses": ["tests/usage/type_usage_declare_qualifiers.cc:3:16", "tests/usage/type_usage_declare_qualifiers.cc:3:32", "tests/usage/type_usage_declare_qualifiers.cc:4:8", "tests/usage/type_usage_declare_qualifiers.cc:5:9", "tests/usage/type_usage_declare_qualifiers.cc:6:15", "tests/usage/type_usage_declare_qualifiers.cc:7:21"] |
|||
}], |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#&$@S@Type#&1S1_#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/type_usage_declare_qualifiers.cc:3:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:type_usage_declare_qualifiers.cc@28@F@foo#&$@S@Type#&1S1_#@a0", |
|||
"short_name": "a0", |
|||
"qualified_name": "a0", |
|||
"declaration": "tests/usage/type_usage_declare_qualifiers.cc:3:16", |
|||
"initializations": ["tests/usage/type_usage_declare_qualifiers.cc:3:16"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:type_usage_declare_qualifiers.cc@38@F@foo#&$@S@Type#&1S1_#@a1", |
|||
"short_name": "a1", |
|||
"qualified_name": "a1", |
|||
"declaration": "tests/usage/type_usage_declare_qualifiers.cc:3:32", |
|||
"initializations": ["tests/usage/type_usage_declare_qualifiers.cc:3:32"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 2, |
|||
"usr": "c:type_usage_declare_qualifiers.cc@59@F@foo#&$@S@Type#&1S1_#@a2", |
|||
"short_name": "a2", |
|||
"qualified_name": "a2", |
|||
"declaration": "tests/usage/type_usage_declare_qualifiers.cc:4:8", |
|||
"initializations": ["tests/usage/type_usage_declare_qualifiers.cc:4:8"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 3, |
|||
"usr": "c:type_usage_declare_qualifiers.cc@71@F@foo#&$@S@Type#&1S1_#@a3", |
|||
"short_name": "a3", |
|||
"qualified_name": "a3", |
|||
"declaration": "tests/usage/type_usage_declare_qualifiers.cc:5:9", |
|||
"initializations": ["tests/usage/type_usage_declare_qualifiers.cc:5:9"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 4, |
|||
"usr": "c:type_usage_declare_qualifiers.cc@84@F@foo#&$@S@Type#&1S1_#@a4", |
|||
"short_name": "a4", |
|||
"qualified_name": "a4", |
|||
"declaration": "tests/usage/type_usage_declare_qualifiers.cc:6:15", |
|||
"initializations": ["tests/usage/type_usage_declare_qualifiers.cc:6:15"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 5, |
|||
"usr": "c:type_usage_declare_qualifiers.cc@103@F@foo#&$@S@Type#&1S1_#@a5", |
|||
"short_name": "a5", |
|||
"qualified_name": "a5", |
|||
"declaration": "tests/usage/type_usage_declare_qualifiers.cc:7:21", |
|||
"initializations": ["tests/usage/type_usage_declare_qualifiers.cc:7:21"], |
|||
"variable_type": 0 |
|||
}] |
|||
} |
|||
|
|||
*/ |
@ -1,8 +1,25 @@ |
|||
struct Type; |
|||
static Type t; |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"types": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Type", |
|||
"short_name": "Type", |
|||
"qualified_name": "Type", |
|||
"declaration": "tests/usage/type_usage_declare_static.cc:1:8", |
|||
"uses": ["tests/usage/type_usage_declare_static.cc:2:13"] |
|||
}], |
|||
"functions": [], |
|||
"variables": [] |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:type_usage_declare_static.cc@t", |
|||
"short_name": "t", |
|||
"qualified_name": "t", |
|||
"declaration": "tests/usage/type_usage_declare_static.cc:2:13", |
|||
"initializations": ["tests/usage/type_usage_declare_static.cc:2:13"], |
|||
"variable_type": 0 |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +0,0 @@ |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
} |
|||
*/ |
@ -1,8 +0,0 @@ |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
} |
|||
*/ |
@ -1,8 +0,0 @@ |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
} |
|||
*/ |
@ -1,35 +0,0 @@ |
|||
struct Foo; |
|||
void foo(Foo* f); |
|||
|
|||
void foo(Foo* f) {} |
|||
|
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Foo", |
|||
"short_name": "Foo", |
|||
"qualified_name": "Foo", |
|||
"declaration": "tests/usage/type_usage_on_prototype_parameter.cc:1:8", |
|||
"uses": ["tests/usage/type_usage_on_prototype_parameter.cc:2:15", "tests/usage/type_usage_on_prototype_parameter.cc:4:15"] |
|||
}], |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#*$@S@Foo#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"declaration": "tests/usage/type_usage_on_prototype_parameter.cc:2:6", |
|||
"definition": "tests/usage/type_usage_on_prototype_parameter.cc:4:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:type_usage_on_prototype_parameter.cc@43@F@foo#*$@S@Foo#@f", |
|||
"short_name": "f", |
|||
"qualified_name": "f", |
|||
"declaration": "tests/usage/type_usage_on_prototype_parameter.cc:4:15", |
|||
"initializations": ["tests/usage/type_usage_on_prototype_parameter.cc:4:15"], |
|||
"variable_type": 0 |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +0,0 @@ |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
} |
|||
*/ |
@ -1,77 +0,0 @@ |
|||
struct Type {}; |
|||
|
|||
void foo(Type& a0, const Type& a1) { |
|||
Type a2; |
|||
Type* a3; |
|||
const Type* a4; |
|||
const Type const* a5; |
|||
} |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Type", |
|||
"short_name": "Type", |
|||
"qualified_name": "Type", |
|||
"definition": "tests/usage/type_usage_qualifiers.cc:1:8", |
|||
"uses": ["tests/usage/type_usage_qualifiers.cc:3:16", "tests/usage/type_usage_qualifiers.cc:3:32", "tests/usage/type_usage_qualifiers.cc:4:8", "tests/usage/type_usage_qualifiers.cc:5:9", "tests/usage/type_usage_qualifiers.cc:6:15", "tests/usage/type_usage_qualifiers.cc:7:21"] |
|||
}], |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#&$@S@Type#&1S1_#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/type_usage_qualifiers.cc:3:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:type_usage_qualifiers.cc@28@F@foo#&$@S@Type#&1S1_#@a0", |
|||
"short_name": "a0", |
|||
"qualified_name": "a0", |
|||
"declaration": "tests/usage/type_usage_qualifiers.cc:3:16", |
|||
"initializations": ["tests/usage/type_usage_qualifiers.cc:3:16"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:type_usage_qualifiers.cc@38@F@foo#&$@S@Type#&1S1_#@a1", |
|||
"short_name": "a1", |
|||
"qualified_name": "a1", |
|||
"declaration": "tests/usage/type_usage_qualifiers.cc:3:32", |
|||
"initializations": ["tests/usage/type_usage_qualifiers.cc:3:32"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 2, |
|||
"usr": "c:type_usage_qualifiers.cc@59@F@foo#&$@S@Type#&1S1_#@a2", |
|||
"short_name": "a2", |
|||
"qualified_name": "a2", |
|||
"declaration": "tests/usage/type_usage_qualifiers.cc:4:8", |
|||
"initializations": ["tests/usage/type_usage_qualifiers.cc:4:8"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 3, |
|||
"usr": "c:type_usage_qualifiers.cc@71@F@foo#&$@S@Type#&1S1_#@a3", |
|||
"short_name": "a3", |
|||
"qualified_name": "a3", |
|||
"declaration": "tests/usage/type_usage_qualifiers.cc:5:9", |
|||
"initializations": ["tests/usage/type_usage_qualifiers.cc:5:9"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 4, |
|||
"usr": "c:type_usage_qualifiers.cc@84@F@foo#&$@S@Type#&1S1_#@a4", |
|||
"short_name": "a4", |
|||
"qualified_name": "a4", |
|||
"declaration": "tests/usage/type_usage_qualifiers.cc:6:15", |
|||
"initializations": ["tests/usage/type_usage_qualifiers.cc:6:15"], |
|||
"variable_type": 0 |
|||
}, { |
|||
"id": 5, |
|||
"usr": "c:type_usage_qualifiers.cc@103@F@foo#&$@S@Type#&1S1_#@a5", |
|||
"short_name": "a5", |
|||
"qualified_name": "a5", |
|||
"declaration": "tests/usage/type_usage_qualifiers.cc:7:21", |
|||
"initializations": ["tests/usage/type_usage_qualifiers.cc:7:21"], |
|||
"variable_type": 0 |
|||
}] |
|||
} |
|||
*/ |
@ -1,9 +1,73 @@ |
|||
// TODO: Verify using and typedef are treated as separate types for usage info.
|
|||
struct Foo; |
|||
using Foo1 = Foo; |
|||
typedef Foo Foo2; |
|||
using Foo3 = Foo1; |
|||
|
|||
void accept(Foo*); |
|||
void accept1(Foo1*); |
|||
void accept2(Foo2*); |
|||
void accept3(Foo3*); |
|||
|
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"types": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Foo", |
|||
"short_name": "Foo", |
|||
"qualified_name": "Foo", |
|||
"declaration": "tests/usage/type_usage_typedef_and_using.cc:1:8", |
|||
"uses": ["tests/usage/type_usage_typedef_and_using.cc:6:17"] |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:@Foo1", |
|||
"short_name": "Foo1", |
|||
"qualified_name": "Foo1", |
|||
"definition": "tests/usage/type_usage_typedef_and_using.cc:2:7", |
|||
"alias_of": 0, |
|||
"uses": ["tests/usage/type_usage_typedef_and_using.cc:7:19"] |
|||
}, { |
|||
"id": 2, |
|||
"usr": "c:type_usage_typedef_and_using.cc@T@Foo2", |
|||
"short_name": "Foo2", |
|||
"qualified_name": "Foo2", |
|||
"definition": "tests/usage/type_usage_typedef_and_using.cc:3:13", |
|||
"alias_of": 0, |
|||
"uses": ["tests/usage/type_usage_typedef_and_using.cc:8:19"] |
|||
}, { |
|||
"id": 3, |
|||
"usr": "c:@Foo3", |
|||
"short_name": "Foo3", |
|||
"qualified_name": "Foo3", |
|||
"definition": "tests/usage/type_usage_typedef_and_using.cc:4:7", |
|||
"alias_of": 1, |
|||
"uses": ["tests/usage/type_usage_typedef_and_using.cc:9:19"] |
|||
}], |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@accept#*$@S@Foo#", |
|||
"short_name": "accept", |
|||
"qualified_name": "accept", |
|||
"declaration": "tests/usage/type_usage_typedef_and_using.cc:6:6" |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:@F@accept1#*$@S@Foo#", |
|||
"short_name": "accept1", |
|||
"qualified_name": "accept1", |
|||
"declaration": "tests/usage/type_usage_typedef_and_using.cc:7:6" |
|||
}, { |
|||
"id": 2, |
|||
"usr": "c:@F@accept2#*$@S@Foo#", |
|||
"short_name": "accept2", |
|||
"qualified_name": "accept2", |
|||
"declaration": "tests/usage/type_usage_typedef_and_using.cc:8:6" |
|||
}, { |
|||
"id": 3, |
|||
"usr": "c:@F@accept3#*$@S@Foo#", |
|||
"short_name": "accept3", |
|||
"qualified_name": "accept3", |
|||
"declaration": "tests/usage/type_usage_typedef_and_using.cc:9:6" |
|||
}], |
|||
"variables": [] |
|||
} |
|||
*/ |
@ -0,0 +1,40 @@ |
|||
void called() {} |
|||
|
|||
void caller() { |
|||
auto x = &called; |
|||
x(); |
|||
|
|||
called(); |
|||
} |
|||
|
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@called#", |
|||
"short_name": "called", |
|||
"qualified_name": "called", |
|||
"definition": "tests/usage/var_usage_call_function.cc:1:6", |
|||
"callers": ["1@tests/usage/var_usage_call_function.cc:4:13", "1@tests/usage/var_usage_call_function.cc:7:3"], |
|||
"uses": ["tests/usage/var_usage_call_function.cc:4:13", "tests/usage/var_usage_call_function.cc:7:3"] |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:@F@caller#", |
|||
"short_name": "caller", |
|||
"qualified_name": "caller", |
|||
"definition": "tests/usage/var_usage_call_function.cc:3:6", |
|||
"callees": ["0@tests/usage/var_usage_call_function.cc:4:13", "0@tests/usage/var_usage_call_function.cc:7:3"] |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:var_usage_call_function.cc@39@F@caller#@x", |
|||
"short_name": "x", |
|||
"qualified_name": "x", |
|||
"declaration": "tests/usage/var_usage_call_function.cc:4:8", |
|||
"initializations": ["tests/usage/var_usage_call_function.cc:4:8"], |
|||
"uses": ["tests/usage/var_usage_call_function.cc:5:3"] |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +1,85 @@ |
|||
class Foo { |
|||
public: |
|||
int x; |
|||
int y; |
|||
}; |
|||
|
|||
void accept(int); |
|||
void accept(int*); |
|||
|
|||
void foo() { |
|||
Foo f; |
|||
f.x = 3; |
|||
f.x += 5; |
|||
accept(f.x); |
|||
accept(f.x + 20); |
|||
accept(&f.x); |
|||
accept(f.y); |
|||
} |
|||
|
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"types": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Foo", |
|||
"short_name": "Foo", |
|||
"qualified_name": "Foo", |
|||
"definition": "tests/usage/var_usage_class_member.cc:1:7", |
|||
"vars": [0, 1], |
|||
"uses": ["tests/usage/var_usage_class_member.cc:11:7"] |
|||
}], |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@accept#I#", |
|||
"short_name": "accept", |
|||
"qualified_name": "accept", |
|||
"declaration": "tests/usage/var_usage_class_member.cc:7:6", |
|||
"callers": ["2@tests/usage/var_usage_class_member.cc:14:3", "2@tests/usage/var_usage_class_member.cc:15:3", "2@tests/usage/var_usage_class_member.cc:17:3"], |
|||
"uses": ["tests/usage/var_usage_class_member.cc:14:3", "tests/usage/var_usage_class_member.cc:15:3", "tests/usage/var_usage_class_member.cc:17:3"] |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:@F@accept#*I#", |
|||
"short_name": "accept", |
|||
"qualified_name": "accept", |
|||
"declaration": "tests/usage/var_usage_class_member.cc:8:6", |
|||
"callers": ["2@tests/usage/var_usage_class_member.cc:16:3"], |
|||
"uses": ["tests/usage/var_usage_class_member.cc:16:3"] |
|||
}, { |
|||
"id": 2, |
|||
"usr": "c:@F@foo#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/var_usage_class_member.cc:10:6", |
|||
"callees": ["0@tests/usage/var_usage_class_member.cc:14:3", "0@tests/usage/var_usage_class_member.cc:15:3", "1@tests/usage/var_usage_class_member.cc:16:3", "0@tests/usage/var_usage_class_member.cc:17:3"] |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:@S@Foo@FI@x", |
|||
"short_name": "x", |
|||
"qualified_name": "Foo::x", |
|||
"declaration": "tests/usage/var_usage_class_member.cc:3:7", |
|||
"initializations": ["tests/usage/var_usage_class_member.cc:3:7"], |
|||
"declaring_type": 0, |
|||
"uses": ["tests/usage/var_usage_class_member.cc:12:5", "tests/usage/var_usage_class_member.cc:13:5", "tests/usage/var_usage_class_member.cc:14:12", "tests/usage/var_usage_class_member.cc:15:12", "tests/usage/var_usage_class_member.cc:16:13"] |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:@S@Foo@FI@y", |
|||
"short_name": "y", |
|||
"qualified_name": "Foo::y", |
|||
"declaration": "tests/usage/var_usage_class_member.cc:4:7", |
|||
"initializations": ["tests/usage/var_usage_class_member.cc:4:7"], |
|||
"declaring_type": 0, |
|||
"uses": ["tests/usage/var_usage_class_member.cc:17:12"] |
|||
}, { |
|||
"id": 2, |
|||
"usr": "c:var_usage_class_member.cc@105@F@foo#@f", |
|||
"short_name": "f", |
|||
"qualified_name": "f", |
|||
"declaration": "tests/usage/var_usage_class_member.cc:11:7", |
|||
"initializations": ["tests/usage/var_usage_class_member.cc:11:7"], |
|||
"variable_type": 0, |
|||
"uses": ["tests/usage/var_usage_class_member.cc:12:3", "tests/usage/var_usage_class_member.cc:13:3", "tests/usage/var_usage_class_member.cc:14:10", "tests/usage/var_usage_class_member.cc:15:10", "tests/usage/var_usage_class_member.cc:16:11", "tests/usage/var_usage_class_member.cc:17:10"] |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +1,26 @@ |
|||
extern int a; |
|||
|
|||
void foo() { |
|||
a = 5; |
|||
} |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/var_usage_extern.cc:3:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:@a", |
|||
"short_name": "a", |
|||
"qualified_name": "a", |
|||
"declaration": "tests/usage/var_usage_extern.cc:1:12", |
|||
"uses": ["tests/usage/var_usage_extern.cc:4:3"] |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +1,25 @@ |
|||
void foo(int a) { |
|||
a += 10; |
|||
} |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#I#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/var_usage_func_parameter.cc:1:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:var_usage_func_parameter.cc@9@F@foo#I#@a", |
|||
"short_name": "a", |
|||
"qualified_name": "a", |
|||
"declaration": "tests/usage/var_usage_func_parameter.cc:1:14", |
|||
"initializations": ["tests/usage/var_usage_func_parameter.cc:1:14"], |
|||
"uses": ["tests/usage/var_usage_func_parameter.cc:2:3"] |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +1,26 @@ |
|||
void foo() { |
|||
int x; |
|||
x = 3; |
|||
} |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/var_usage_local.cc:1:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:var_usage_local.cc@16@F@foo#@x", |
|||
"short_name": "x", |
|||
"qualified_name": "x", |
|||
"declaration": "tests/usage/var_usage_local.cc:2:7", |
|||
"initializations": ["tests/usage/var_usage_local.cc:2:7"], |
|||
"uses": ["tests/usage/var_usage_local.cc:3:3"] |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +0,0 @@ |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
} |
|||
*/ |
@ -1,8 +1,39 @@ |
|||
void foo() { |
|||
int a; |
|||
a = 1; |
|||
{ |
|||
int a; |
|||
a = 2; |
|||
} |
|||
a = 3; |
|||
} |
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/var_usage_shadowed_local.cc:1:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:var_usage_shadowed_local.cc@16@F@foo#@a", |
|||
"short_name": "a", |
|||
"qualified_name": "a", |
|||
"declaration": "tests/usage/var_usage_shadowed_local.cc:2:7", |
|||
"initializations": ["tests/usage/var_usage_shadowed_local.cc:2:7"], |
|||
"uses": ["tests/usage/var_usage_shadowed_local.cc:3:3", "tests/usage/var_usage_shadowed_local.cc:8:3"] |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:var_usage_shadowed_local.cc@43@F@foo#@a", |
|||
"short_name": "a", |
|||
"qualified_name": "a", |
|||
"declaration": "tests/usage/var_usage_shadowed_local.cc:5:9", |
|||
"initializations": ["tests/usage/var_usage_shadowed_local.cc:5:9"], |
|||
"uses": ["tests/usage/var_usage_shadowed_local.cc:6:5"] |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +1,39 @@ |
|||
void foo(int a) { |
|||
a = 1; |
|||
{ |
|||
int a; |
|||
a = 2; |
|||
} |
|||
a = 3; |
|||
} |
|||
|
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#I#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/var_usage_shadowed_parameter.cc:1:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:var_usage_shadowed_parameter.cc@9@F@foo#I#@a", |
|||
"short_name": "a", |
|||
"qualified_name": "a", |
|||
"declaration": "tests/usage/var_usage_shadowed_parameter.cc:1:14", |
|||
"initializations": ["tests/usage/var_usage_shadowed_parameter.cc:1:14"], |
|||
"uses": ["tests/usage/var_usage_shadowed_parameter.cc:2:3", "tests/usage/var_usage_shadowed_parameter.cc:7:3"] |
|||
}, { |
|||
"id": 1, |
|||
"usr": "c:var_usage_shadowed_parameter.cc@38@F@foo#I#@a", |
|||
"short_name": "a", |
|||
"qualified_name": "a", |
|||
"declaration": "tests/usage/var_usage_shadowed_parameter.cc:4:9", |
|||
"initializations": ["tests/usage/var_usage_shadowed_parameter.cc:4:9"], |
|||
"uses": ["tests/usage/var_usage_shadowed_parameter.cc:5:5"] |
|||
}] |
|||
} |
|||
*/ |
@ -1,8 +1,28 @@ |
|||
static int a; |
|||
|
|||
void foo() { |
|||
a = 3; |
|||
} |
|||
|
|||
/*
|
|||
OUTPUT: |
|||
{ |
|||
"types": [], |
|||
"functions": [], |
|||
"variables": [] |
|||
"functions": [{ |
|||
"id": 0, |
|||
"usr": "c:@F@foo#", |
|||
"short_name": "foo", |
|||
"qualified_name": "foo", |
|||
"definition": "tests/usage/var_usage_static.cc:3:6" |
|||
}], |
|||
"variables": [{ |
|||
"id": 0, |
|||
"usr": "c:var_usage_static.cc@a", |
|||
"short_name": "a", |
|||
"qualified_name": "a", |
|||
"declaration": "tests/usage/var_usage_static.cc:1:12", |
|||
"initializations": ["tests/usage/var_usage_static.cc:1:12"], |
|||
"uses": ["tests/usage/var_usage_static.cc:4:3"] |
|||
}] |
|||
} |
|||
*/ |
Loading…
Reference in new issue