Internals: Omit selfPointer from ConstPool references

AstVarRefs to constant pool values are special and they have no use for
the selfPointer. Removing it simplifies future downstream code.
This commit is contained in:
Geza Lore 2021-07-22 13:33:00 +01:00
parent e3dd70c373
commit 42d918c163

View File

@ -217,6 +217,9 @@ private:
if (varp->isFuncLocal()) {
// Reference to function locals need no self pointer
nodep->selfPointer("");
} else if (scopep->modp() == v3Global.rootp()->constPoolp()->modp()) {
// Reference to constant pool value need no self pointer
nodep->selfPointer("");
} else if (VN_IS(scopep->modp(), Class)) {
// Direct reference to class members are from within the class itself, references from
// outside the class must go via AstMemberSel