Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3095,15 +3095,17 @@ void ASTContext::setBlockVarCopyInit(const VarDecl*VD, Expr *CopyExpr,
// CppVerify contract side table accessors.
FunctionContractInfo &
ASTContext::getOrCreateFunctionContract(const FunctionDecl *FD) {
auto &Info = FunctionContracts[FD];
assert(FD && "Passed null params");
const FunctionDecl *Key = FD->getCanonicalDecl();
auto &Info = FunctionContracts[Key];
Comment thread
SwayamInSync marked this conversation as resolved.
if (!Info)
Comment thread
SwayamInSync marked this conversation as resolved.
Info = new (*this) FunctionContractInfo();
return *Info;
}

const FunctionContractInfo *
ASTContext::getFunctionContract(const FunctionDecl *FD) const {
auto I = FunctionContracts.find(FD);
auto I = FunctionContracts.find(FD->getCanonicalDecl());
return I != FunctionContracts.end() ? I->second : nullptr;
}

Expand Down