-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathelements.ql
More file actions
33 lines (31 loc) · 966 Bytes
/
elements.ql
File metadata and controls
33 lines (31 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import cpp
import semmle.code.cpp.Print
string describe(Element e) {
e instanceof Function and
result = "function " + getIdentityString(e)
or
result =
"function declaration entry for " +
getIdentityString(e.(FunctionDeclarationEntry).getFunction())
or
result = "parameter for " + getIdentityString(e.(Parameter).getFunction())
or
result =
"parameter declaration entry for " +
getIdentityString(e.(ParameterDeclarationEntry).getFunctionDeclarationEntry().getFunction())
or
exists(Element template |
e.isFromTemplateInstantiation(template) and
result = "isFromTemplateInstantiation(" + template.toString() + ")"
)
or
exists(Element template |
e.isFromUninstantiatedTemplate(template) and
result = "isFromUninstantiatedTemplate(" + template.toString() + ")"
)
}
from Element e
where
e.getLocation().getFile().getBaseName() != "" and
not e instanceof Folder
select e, strictconcat(describe(e), ", ")