Skip to content

Commit f098279

Browse files
committed
[CPP-340] Remove colons and extraenous QLDoc comments; add a few more classes.
1 parent c906560 commit f098279

32 files changed

+6392
-6575
lines changed

cpp/ql/src/semmle/code/cpp/Class.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Class extends UserType {
1515
isClass(underlyingElement(this))
1616
}
1717

18-
/** Canonical QL class corresponding to this element. */
1918
override string getCanonicalQLClass() { result = "Class" }
2019

2120
/** Gets a child declaration of this class. */
@@ -824,7 +823,7 @@ class LocalClass extends Class {
824823
LocalClass() {
825824
isLocal()
826825
}
827-
/** Canonical QL class corresponding to this element. */
826+
828827
override string getCanonicalQLClass() { result = "LocalClass" }
829828

830829
override Function getEnclosingAccessHolder() {
@@ -840,7 +839,6 @@ class NestedClass extends Class {
840839
this.isMember()
841840
}
842841

843-
/** Canonical QL class corresponding to this element. */
844842
override string getCanonicalQLClass() { result = "NestedClass" }
845843

846844
/** Holds if this member is private. */
@@ -988,7 +986,6 @@ class VirtualBaseClass extends Class {
988986
exists(VirtualClassDerivation cd | cd.getBaseClass() = this)
989987
}
990988

991-
/** Canonical QL class corresponding to this element. */
992989
override string getCanonicalQLClass() { result = "VirtualBaseClass" }
993990

994991
/** A virtual class derivation of which this class is the base. */
@@ -1015,7 +1012,6 @@ class ProxyClass extends UserType {
10151012
usertypes(underlyingElement(this),_,9)
10161013
}
10171014

1018-
/** Canonical QL class corresponding to this element. */
10191015
override string getCanonicalQLClass() { result = "ProxyClass" }
10201016

10211017
/** Gets the location of the proxy class. */

cpp/ql/src/semmle/code/cpp/Enum.qll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class Enum extends UserType, IntegralOrEnumType {
99
EnumConstant getAnEnumConstant() { result.getDeclaringEnum() = this }
1010
EnumConstant getEnumConstant(int index) { enumconstants(unresolveElement(result),underlyingElement(this),index,_,_,_) }
1111

12-
/** Canonical QL class corresponding to this element. */
1312
override string getCanonicalQLClass() { result = "Enum" }
1413

1514
/**
@@ -53,7 +52,7 @@ class LocalEnum extends Enum {
5352
LocalEnum() {
5453
isLocal()
5554
}
56-
/** Canonical QL class corresponding to this element. */
55+
5756
override string getCanonicalQLClass() { result = "LocalEnum" }
5857
}
5958

@@ -66,7 +65,6 @@ class NestedEnum extends Enum {
6665
this.isMember()
6766
}
6867

69-
/** Canonical QL class corresponding to this element. */
7068
override string getCanonicalQLClass() { result = "NestedEnum" }
7169

7270
/** Holds if this member is private. */
@@ -89,7 +87,7 @@ class ScopedEnum extends Enum {
8987
ScopedEnum() {
9088
usertypes(underlyingElement(this),_,13)
9189
}
92-
/** Canonical QL class corresponding to this element. */
90+
9391
override string getCanonicalQLClass() { result = "ScopedEnum" }
9492
}
9593

@@ -106,7 +104,6 @@ class EnumConstant extends Declaration, @enumconstant {
106104
*/
107105
Enum getDeclaringEnum() { enumconstants(underlyingElement(this),unresolveElement(result),_,_,_,_) }
108106

109-
/** Canonical QL class corresponding to this element. */
110107
override string getCanonicalQLClass() { result = "EnumConstant" }
111108

112109
override Class getDeclaringType() {

cpp/ql/src/semmle/code/cpp/Function.qll

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ class FunctionDeclarationEntry extends DeclarationEntry, @fun_decl {
503503
/** Gets the function which is being declared or defined. */
504504
override Function getDeclaration() { result = getFunction() }
505505

506+
override string getCanonicalQLClass() { result = "FunctionDeclarationEntry" }
507+
506508
/** Gets the function which is being declared or defined. */
507509
Function getFunction() { fun_decls(underlyingElement(this),unresolveElement(result),_,_,_) }
508510

@@ -707,7 +709,7 @@ class TopLevelFunction extends Function {
707709
TopLevelFunction() {
708710
not this.isMember()
709711
}
710-
/** Canonical QL class corresponding to this element. */
712+
711713
override string getCanonicalQLClass() { result = "TopLevelFunction" }
712714
}
713715

@@ -720,7 +722,6 @@ class MemberFunction extends Function {
720722
this.isMember()
721723
}
722724

723-
/** Canonical QL class corresponding to this element. */
724725
override string getCanonicalQLClass() { result = "MemberFunction" }
725726

726727
/**
@@ -774,7 +775,6 @@ class VirtualFunction extends MemberFunction {
774775
this.hasSpecifier("virtual") or purefunctions(underlyingElement(this))
775776
}
776777

777-
/** Canonical QL class corresponding to this element. */
778778
override string getCanonicalQLClass() { result = "VirtualFunction" }
779779

780780
/** Holds if this virtual function is pure. */
@@ -794,7 +794,6 @@ class PureVirtualFunction extends VirtualFunction {
794794

795795
PureVirtualFunction() { purefunctions(underlyingElement(this)) }
796796

797-
/** Canonical QL class corresponding to this element. */
798797
override string getCanonicalQLClass() { result = "PureVirtualFunction" }
799798
}
800799

@@ -807,7 +806,6 @@ class ConstMemberFunction extends MemberFunction {
807806

808807
ConstMemberFunction() { this.hasSpecifier("const") }
809808

810-
/** Canonical QL class corresponding to this element. */
811809
override string getCanonicalQLClass() { result = "ConstMemberFunction" }
812810
}
813811

@@ -818,7 +816,6 @@ class Constructor extends MemberFunction {
818816

819817
Constructor() { functions(underlyingElement(this),_,2) }
820818

821-
/** Canonical QL class corresponding to this element. */
822819
override string getCanonicalQLClass() { result = "Constructor" }
823820

824821
/**
@@ -866,7 +863,6 @@ class ConversionConstructor extends Constructor, ImplicitConversionFunction {
866863
and not(this instanceof CopyConstructor)
867864
}
868865

869-
/** Canonical QL class corresponding to this element. */
870866
override string getCanonicalQLClass() { result = "ConversionConstructor" }
871867

872868
/** Gets the type this `ConversionConstructor` takes as input. */
@@ -924,7 +920,6 @@ class CopyConstructor extends Constructor {
924920
not exists(getATemplateArgument())
925921
}
926922

927-
/** Canonical QL class corresponding to this element. */
928923
override string getCanonicalQLClass() { result = "CopyConstructor" }
929924

930925
/**
@@ -975,7 +970,6 @@ class MoveConstructor extends Constructor {
975970
not exists(getATemplateArgument())
976971
}
977972

978-
/** Canonical QL class corresponding to this element. */
979973
override string getCanonicalQLClass() { result = "MoveConstructor" }
980974

981975
/**
@@ -1010,7 +1004,6 @@ class NoArgConstructor extends Constructor {
10101004
class Destructor extends MemberFunction {
10111005
Destructor() { functions(underlyingElement(this),_,3) }
10121006

1013-
/** Canonical QL class corresponding to this element. */
10141007
override string getCanonicalQLClass() { result = "Destructor" }
10151008

10161009
/**
@@ -1038,6 +1031,8 @@ class ConversionOperator extends MemberFunction, ImplicitConversionFunction {
10381031

10391032
ConversionOperator() { functions(underlyingElement(this),_,4) }
10401033

1034+
override string getCanonicalQLClass() { result = "ConversionOperator" }
1035+
10411036
override Type getSourceType() { result = this.getDeclaringType() }
10421037
override Type getDestType() { result = this.getType() }
10431038

@@ -1050,6 +1045,7 @@ class Operator extends Function {
10501045

10511046
Operator() { functions(underlyingElement(this),_,5) }
10521047

1048+
override string getCanonicalQLClass() { result = "Operator" }
10531049
}
10541050

10551051
/**
@@ -1072,7 +1068,7 @@ class CopyAssignmentOperator extends Operator {
10721068
not exists(this.getParameter(1)) and
10731069
not exists(getATemplateArgument())
10741070
}
1075-
/** Canonical QL class corresponding to this element. */
1071+
10761072
override string getCanonicalQLClass() { result = "CopyAssignmentOperator" }
10771073
}
10781074

@@ -1093,7 +1089,7 @@ class MoveAssignmentOperator extends Operator {
10931089
not exists(this.getParameter(1)) and
10941090
not exists(getATemplateArgument())
10951091
}
1096-
/** Canonical QL class corresponding to this element. */
1092+
10971093
override string getCanonicalQLClass() { result = "MoveAssignmentOperator" }
10981094
}
10991095

@@ -1115,7 +1111,6 @@ class MoveAssignmentOperator extends Operator {
11151111
class TemplateFunction extends Function {
11161112
TemplateFunction() { is_function_template(underlyingElement(this)) and exists(getATemplateArgument()) }
11171113

1118-
/** Canonical QL class corresponding to this element. */
11191114
override string getCanonicalQLClass() { result = "TemplateFunction" }
11201115
/**
11211116
* Gets a compiler-generated instantiation of this function template.
@@ -1148,7 +1143,6 @@ class FunctionTemplateInstantiation extends Function {
11481143
tf.getAnInstantiation() = this
11491144
}
11501145

1151-
/** Canonical QL class corresponding to this element. */
11521146
override string getCanonicalQLClass() { result = "FunctionTemplateInstantiation" }
11531147

11541148
/**
@@ -1187,7 +1181,6 @@ class FunctionTemplateSpecialization extends Function {
11871181
this.isSpecialization()
11881182
}
11891183

1190-
/** Canonical QL class corresponding to this element. */
11911184
override string getCanonicalQLClass() { result = "FunctionTemplateSpecialization" }
11921185

11931186
/**

cpp/ql/src/semmle/code/cpp/Initializer.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import semmle.code.cpp.controlflow.ControlFlowGraph
66
class Initializer extends ControlFlowNode, @initialiser {
77
override Location getLocation() { initialisers(underlyingElement(this),_,_,result) }
88

9-
/** Canonical QL class corresponding to this element. */
109
override string getCanonicalQLClass() { result = "Initializer" }
1110

1211
/** Holds if this initializer is explicit in the source. */

cpp/ql/src/semmle/code/cpp/Parameter.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class Parameter extends LocalScopeVariable, @parameter {
3333
result = "p#" + this.getIndex().toString())
3434
}
3535

36-
/** Canonical QL class corresponding to this element. */
3736
override string getCanonicalQLClass() { result = "Parameter" }
3837

3938
/**

cpp/ql/src/semmle/code/cpp/PrintAST.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ class PrintASTNode extends TPrintASTNode {
153153
/**
154154
* Retrieves the canonical QL class for entity `el`
155155
*/
156-
private string qlClass(ElementBase el) { result = "[" + el.getCanonicalQLClass() + "]: " }
156+
private string qlClass(ElementBase el) { result = "[" + concat(el.getCanonicalQLClass(), ",") + "] " }
157157

158158
// Do not delete this - it is useful for QL class discovery
159-
//private string qlClass(ElementBase el) { result = "["+ concat(el.getAQlClass(), ",") + "]: " }
159+
//private string qlClass(ElementBase el) { result = "["+ concat(el.getAQlClass(), ",") + "] " }
160160
/**
161161
* A node representing an AST node.
162162
*/

cpp/ql/src/semmle/code/cpp/Struct.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class Struct extends Class {
88

99
Struct() { usertypes(underlyingElement(this),_,1) or usertypes(underlyingElement(this),_,3) }
1010

11-
/** Canonical QL class corresponding to this element. */
1211
override string getCanonicalQLClass() { result = "Struct" }
1312

1413
override string explain() { result = "struct " + this.getName() }
@@ -23,7 +22,7 @@ class LocalStruct extends Struct {
2322
LocalStruct() {
2423
isLocal()
2524
}
26-
/** Canonical QL class corresponding to this element. */
25+
2726
override string getCanonicalQLClass() { result = "LocalStruct" }
2827
}
2928

@@ -35,7 +34,6 @@ class NestedStruct extends Struct {
3534
this.isMember()
3635
}
3736

38-
/** Canonical QL class corresponding to this element. */
3937
override string getCanonicalQLClass() { result = "NestedStruct" }
4038

4139
/** Holds if this member is private. */

0 commit comments

Comments
 (0)