17 OS <<
"Decl: " << VD->getNameAsString();
19 OS <<
"Expr: " << E->getStmtClassName();
26 AllOrigins.emplace_back(ID, &D);
27 return AllOrigins.back();
31 AllOrigins.emplace_back(ID, &E);
32 return AllOrigins.back();
37 if (
auto *ParenIgnored = E.
IgnoreParens(); ParenIgnored != &E)
38 return get(*ParenIgnored);
39 auto It = ExprToOriginID.find(&E);
40 if (It != ExprToOriginID.end())
46 if (
const auto *DRE = dyn_cast<DeclRefExpr>(&E))
47 return get(*DRE->getDecl());
55 auto It = DeclToOriginID.find(&D);
59 if (It == DeclToOriginID.end())
66 auto It = ExprToOriginID.find(&E);
67 if (It != ExprToOriginID.end())
72 ExprToOriginID[&E] = NewID;
77 assert(ID.Value < AllOrigins.size());
78 return AllOrigins[ID.Value];
82 auto It = DeclToOriginID.find(&D);
83 if (It != DeclToOriginID.end())
87 DeclToOriginID[&D] = NewID;
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
const Origin & getOrigin(OriginID ID) const
OriginID getOrCreate(const Expr &E)
void dump(OriginID OID, llvm::raw_ostream &OS) const
Origin & addOrigin(OriginID ID, const clang::ValueDecl &D)
OriginID get(const Expr &E)
utils::ID< struct OriginTag > OriginID
An Origin is a symbolic identifier that represents the set of possible loans a pointer-like object co...
const clang::Expr * getExpr() const
const clang::ValueDecl * getDecl() const