File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,11 +234,22 @@ class PrintASTNode extends TPrintASTNode {
234234 private Function getEnclosingFunction ( ) { result = getParent * ( ) .( FunctionNode ) .getFunction ( ) }
235235}
236236
237+ private class PrintableElementBase extends ElementBase {
238+ PrintableElementBase ( ) {
239+ not this instanceof Locatable
240+ or
241+ shouldPrintFunction ( getEnclosingFunction ( this .( Locatable ) ) )
242+ }
243+
244+ pragma [ noinline]
245+ string getAPrimaryQlClass0 ( ) { result = getAPrimaryQlClass ( ) }
246+ }
247+
237248/**
238249 * Retrieves the canonical QL class(es) for entity `el`
239250 */
240- private string qlClass ( ElementBase el ) {
241- result = "[" + concat ( el .getAPrimaryQlClass ( ) , "," ) + "] "
251+ private string qlClass ( PrintableElementBase el ) {
252+ result = "[" + concat ( el .getAPrimaryQlClass0 ( ) , "," ) + "] "
242253 // Alternative implementation -- do not delete. It is useful for QL class discovery.
243254 //result = "["+ concat(el.getAQlClass(), ",") + "] "
244255}
You can’t perform that action at this time.
0 commit comments