Skip to content

Commit 10f962f

Browse files
committed
C++: Rename 'PseudoDeclarationEntry' to 'IRDeclarationEntry'.
1 parent ed3fff0 commit 10f962f

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedDeclarationEntry.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ private import TranslatedInitialization
1313
* Gets the `TranslatedDeclarationEntry` that represents the declaration
1414
* `entry`.
1515
*/
16-
TranslatedDeclarationEntry getTranslatedDeclarationEntry(PseudoDeclarationEntry entry) {
17-
result.getPseudoDeclarationEntry() = entry
16+
TranslatedDeclarationEntry getTranslatedDeclarationEntry(IRDeclarationEntry entry) {
17+
result.getIRDeclarationEntry() = entry
1818
}
1919

2020
/**
@@ -24,7 +24,7 @@ TranslatedDeclarationEntry getTranslatedDeclarationEntry(PseudoDeclarationEntry
2424
* functions do not have a `TranslatedDeclarationEntry`.
2525
*/
2626
abstract class TranslatedDeclarationEntry extends TranslatedElement, TTranslatedDeclarationEntry {
27-
PseudoDeclarationEntry entry;
27+
IRDeclarationEntry entry;
2828

2929
TranslatedDeclarationEntry() { this = TTranslatedDeclarationEntry(entry) }
3030

@@ -35,7 +35,7 @@ abstract class TranslatedDeclarationEntry extends TranslatedElement, TTranslated
3535
)
3636
}
3737

38-
PseudoDeclarationEntry getPseudoDeclarationEntry() { result = entry }
38+
IRDeclarationEntry getIRDeclarationEntry() { result = entry }
3939

4040
final override string toString() { result = entry.toString() }
4141

@@ -218,7 +218,7 @@ class TranslatedStaticLocalVariableDeclarationEntry extends TranslatedDeclaratio
218218
*/
219219
class TranslatedStaticLocalVariableInitialization extends TranslatedElement,
220220
TranslatedLocalVariableDeclaration, TTranslatedStaticLocalVariableInitialization {
221-
PseudoVariableDeclarationEntry entry;
221+
IRVariableDeclarationEntry entry;
222222
StaticLocalVariable var;
223223

224224
TranslatedStaticLocalVariableInitialization() {

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ predicate hasTranslatedSyntheticTemporaryObject(Expr expr) {
443443
* necessary for automatic local variables, or for static local variables with dynamic
444444
* initialization.
445445
*/
446-
private predicate translateDeclarationEntry(PseudoDeclarationEntry entry) {
446+
private predicate translateDeclarationEntry(IRDeclarationEntry entry) {
447447
exists(DeclStmt declStmt, LocalVariable var |
448448
translateStmt(declStmt) and
449449
declStmt = entry.getStmt() and
@@ -458,8 +458,8 @@ private predicate translateDeclarationEntry(PseudoDeclarationEntry entry) {
458458
)
459459
}
460460

461-
private module PseudoDeclarationEntries {
462-
private newtype TPseudoDeclarationEntry =
461+
private module IRDeclarationEntries {
462+
private newtype TIRDeclarationEntry =
463463
TPresentDeclarationEntry(DeclarationEntry entry) or
464464
TMissingDeclarationEntry(DeclStmt stmt, Declaration d, int index) {
465465
not exists(stmt.getDeclarationEntry(index)) and
@@ -472,31 +472,31 @@ private module PseudoDeclarationEntries {
472472
* This class exists to work around the fact that `DeclStmt`s in
473473
* template instantiations do not have `DeclarationEntry`s.
474474
*
475-
* So instead, the IR works with `PseudoDeclarationEntry`s that synthesize
476-
* missing `DeclarationEntry`s when there is no result for `DeclStmt::getDeclarationEntry`.
475+
* So instead, the IR works with `IRDeclarationEntry`s that synthesize missing
476+
* `DeclarationEntry`s when there is no result for `DeclStmt::getDeclarationEntry`.
477477
*/
478-
abstract class PseudoDeclarationEntry extends TPseudoDeclarationEntry {
479-
/** Gets a string representation of this `PseudoDeclarationEntry`. */
478+
abstract class IRDeclarationEntry extends TIRDeclarationEntry {
479+
/** Gets a string representation of this `IRDeclarationEntry`. */
480480
abstract string toString();
481481

482-
/** Gets the `DeclStmt` that this `PseudoDeclarationEntry` belongs to. */
482+
/** Gets the `DeclStmt` that this `IRDeclarationEntry` belongs to. */
483483
abstract DeclStmt getStmt();
484484

485-
/** Gets the `Declaration` declared by this `PseudoDeclarationEntry`. */
485+
/** Gets the `Declaration` declared by this `IRDeclarationEntry`. */
486486
abstract Declaration getDeclaration();
487487

488-
/** Gets the AST represented by this `PseudoDeclarationEntry`. */
488+
/** Gets the AST represented by this `IRDeclarationEntry`. */
489489
abstract Locatable getAst();
490490

491491
/**
492-
* Holds if this `PseudoDeclarationEntry` is the `index`'th entry
492+
* Holds if this `IRDeclarationEntry` is the `index`'th entry
493493
* declared by the enclosing `DeclStmt`.
494494
*/
495495
abstract predicate hasIndex(int index);
496496
}
497497

498-
/** A `PseudoDeclarationEntry` for an existing `DeclarationEntry`. */
499-
private class PresentDeclarationEntry extends PseudoDeclarationEntry, TPresentDeclarationEntry {
498+
/** A `IRDeclarationEntry` for an existing `DeclarationEntry`. */
499+
private class PresentDeclarationEntry extends IRDeclarationEntry, TPresentDeclarationEntry {
500500
DeclarationEntry entry;
501501

502502
PresentDeclarationEntry() { this = TPresentDeclarationEntry(entry) }
@@ -516,7 +516,7 @@ private module PseudoDeclarationEntries {
516516
* A synthesized `DeclarationEntry` that is created when a `DeclStmt` is missing a
517517
* result for `DeclStmt::getDeclarationEntry`
518518
*/
519-
private class MissingDeclarationEntry extends PseudoDeclarationEntry, TMissingDeclarationEntry {
519+
private class MissingDeclarationEntry extends IRDeclarationEntry, TMissingDeclarationEntry {
520520
DeclStmt stmt;
521521
Declaration d;
522522
int index;
@@ -534,11 +534,11 @@ private module PseudoDeclarationEntries {
534534
override predicate hasIndex(int idx) { idx = index }
535535
}
536536

537-
/** A `PseudoDeclarationEntry` that represents an entry for a `Variable`. */
538-
class PseudoVariableDeclarationEntry instanceof PseudoDeclarationEntry {
537+
/** A `IRDeclarationEntry` that represents an entry for a `Variable`. */
538+
class IRVariableDeclarationEntry instanceof IRDeclarationEntry {
539539
Variable v;
540540

541-
PseudoVariableDeclarationEntry() { super.getDeclaration() = v }
541+
IRVariableDeclarationEntry() { super.getDeclaration() = v }
542542

543543
Variable getDeclaration() { result = v }
544544

@@ -550,7 +550,7 @@ private module PseudoDeclarationEntries {
550550
}
551551
}
552552

553-
import PseudoDeclarationEntries
553+
import IRDeclarationEntries
554554

555555
newtype TTranslatedElement =
556556
// An expression that is not being consumed as a condition
@@ -707,10 +707,10 @@ newtype TTranslatedElement =
707707
)
708708
} or
709709
// A local declaration
710-
TTranslatedDeclarationEntry(PseudoDeclarationEntry entry) { translateDeclarationEntry(entry) } or
710+
TTranslatedDeclarationEntry(IRDeclarationEntry entry) { translateDeclarationEntry(entry) } or
711711
// The dynamic initialization of a static local variable. This is a separate object from the
712712
// declaration entry.
713-
TTranslatedStaticLocalVariableInitialization(PseudoDeclarationEntry entry) {
713+
TTranslatedStaticLocalVariableInitialization(IRDeclarationEntry entry) {
714714
translateDeclarationEntry(entry) and
715715
entry.getDeclaration() instanceof StaticLocalVariable
716716
} or

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ class TranslatedDeclStmt extends TranslatedStmt {
7676

7777
private int getChildCount() { result = count(getDeclarationEntry(_)) }
7878

79-
PseudoDeclarationEntry getPseudoDeclarationEntry(int index) {
79+
IRDeclarationEntry getIRDeclarationEntry(int index) {
8080
result.hasIndex(index) and
8181
result.getStmt() = stmt
8282
}
8383

84-
PseudoDeclarationEntry getAPseudoDeclarationEntry() { result = this.getPseudoDeclarationEntry(_) }
84+
IRDeclarationEntry getAnIRDeclarationEntry() { result = this.getIRDeclarationEntry(_) }
8585

8686
/**
8787
* Gets the `TranslatedDeclarationEntry` child at zero-based index `index`. Since not all
@@ -92,7 +92,7 @@ class TranslatedDeclStmt extends TranslatedStmt {
9292
private TranslatedDeclarationEntry getDeclarationEntry(int index) {
9393
result =
9494
rank[index + 1](TranslatedDeclarationEntry entry, int originalIndex |
95-
entry = getTranslatedDeclarationEntry(this.getPseudoDeclarationEntry(originalIndex))
95+
entry = getTranslatedDeclarationEntry(this.getIRDeclarationEntry(originalIndex))
9696
|
9797
entry order by originalIndex
9898
)
@@ -654,16 +654,16 @@ class TranslatedRangeBasedForStmt extends TranslatedStmt, ConditionContext {
654654
}
655655

656656
private TranslatedDeclStmt getRangeVariableDeclStmt() {
657-
exists(PseudoVariableDeclarationEntry entry |
657+
exists(IRVariableDeclarationEntry entry |
658658
entry.getDeclaration() = stmt.getRangeVariable() and
659-
result.getAPseudoDeclarationEntry() = entry
659+
result.getAnIRDeclarationEntry() = entry
660660
)
661661
}
662662

663663
private TranslatedDeclStmt getBeginEndVariableDeclStmt() {
664-
exists(PseudoVariableDeclarationEntry entry |
664+
exists(IRVariableDeclarationEntry entry |
665665
entry.getStmt() = stmt.getBeginEndDeclaration() and
666-
result.getAPseudoDeclarationEntry() = entry
666+
result.getAnIRDeclarationEntry() = entry
667667
)
668668
}
669669

@@ -678,9 +678,9 @@ class TranslatedRangeBasedForStmt extends TranslatedStmt, ConditionContext {
678678
}
679679

680680
private TranslatedDeclStmt getVariableDeclStmt() {
681-
exists(PseudoVariableDeclarationEntry entry |
681+
exists(IRVariableDeclarationEntry entry |
682682
entry.getDeclaration() = stmt.getVariable() and
683-
result.getAPseudoDeclarationEntry() = entry
683+
result.getAnIRDeclarationEntry() = entry
684684
)
685685
}
686686

0 commit comments

Comments
 (0)