Skip to content

Commit 740a2dd

Browse files
committed
[ConstraintSystem] NFC: Inline ConstraintLocator::directlyAt implementation into the header
1 parent 326b371 commit 740a2dd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/Sema/ConstraintLocator.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,6 @@ bool ConstraintLocator::isForOptionalTry() const {
247247
return directlyAt<OptionalTryExpr>();
248248
}
249249

250-
template <typename E> bool ConstraintLocator::directlyAt() const {
251-
return isExpr<E>(getAnchor()) && getPath().empty();
252-
}
253-
254250
GenericTypeParamType *ConstraintLocator::getGenericParameter() const {
255251
// Check whether we have a path that terminates at a generic parameter.
256252
return isForGenericParameter() ?

lib/Sema/ConstraintLocator.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ class ConstraintLocator : public llvm::FoldingSetNode {
381381
bool isForOptionalTry() const;
382382

383383
/// Determine whether this locator points directly to a given expression.
384-
template <typename E> bool directlyAt() const;
384+
template <typename E> bool directlyAt() const {
385+
if (auto *expr = getAnchor().dyn_cast<Expr *>())
386+
return isa<E>(expr) && getPath().empty();
387+
return false;
388+
}
385389

386390
/// Attempts to cast the first path element of the locator to a specific
387391
/// \c LocatorPathElt subclass, returning \c None if either unsuccessful or

0 commit comments

Comments
 (0)