C++: add calling convention specifier class

This commit is contained in:
idrissrio
2025-03-28 16:31:01 +01:00
parent a8b19d2b21
commit f83f14bab2
2 changed files with 17 additions and 0 deletions

View File

@@ -97,6 +97,18 @@ class AccessSpecifier extends Specifier {
override string getAPrimaryQlClass() { result = "AccessSpecifier" }
}
/**
* A C/C++ calling convention specifier: `cdecl`, `fastcall`, `stdcall`, `thiscall`,
* `vectorcall`, or `clrcall`.
*/
class CallingConventionSpecifier extends Specifier {
CallingConventionSpecifier() {
this.hasName(["cdecl", "fastcall", "stdcall", "thiscall", "vectorcall", "clrcall"])
}
override string getAPrimaryQlClass() { result = "CallingConventionSpecifier" }
}
/**
* An attribute introduced by GNU's `__attribute__((name))` syntax,
* Microsoft's `__declspec(name)` syntax, Microsoft's `[name]` syntax, the

View File

@@ -0,0 +1,5 @@
import cpp
from FunctionDeclarationEntry func, CallingConventionSpecifier ccs
where ccs.hasName(func.getASpecifier())
select func, func.getASpecifier()