mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SourceManager: add functions that compare SourceLocs and SourceRanges
Swift SVN r6994
This commit is contained in:
@@ -63,6 +63,23 @@ public:
|
|||||||
unsigned getHashbangBufferID() const {
|
unsigned getHashbangBufferID() const {
|
||||||
return HashbangBufferID;
|
return HashbangBufferID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns true if \c LHS is before \c RHS in the source buffer.
|
||||||
|
bool isBeforeInBuffer(SourceLoc LHS, SourceLoc RHS) const {
|
||||||
|
return LHS.Value.getPointer() < RHS.Value.getPointer();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns true if range \c R contains the location \c Loc.
|
||||||
|
bool rangeContainsLoc(SourceRange R, SourceLoc Loc) const {
|
||||||
|
return Loc == R.Start || Loc == R.End ||
|
||||||
|
(isBeforeInBuffer(R.Start, Loc) && isBeforeInBuffer(Loc, R.End));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns true if range \c Enclosing contains the range \c Inner.
|
||||||
|
bool rangeContains(SourceRange Enclosing, SourceRange Inner) const {
|
||||||
|
return rangeContainsLoc(Enclosing, Inner.Start) &&
|
||||||
|
rangeContainsLoc(Enclosing, Inner.End);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace swift
|
} // namespace swift
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "swift/Basic/SourceManager.h"
|
||||||
#include "swift/AST/NameLookup.h"
|
#include "swift/AST/NameLookup.h"
|
||||||
#include "swift/AST/AST.h"
|
#include "swift/AST/AST.h"
|
||||||
#include "swift/AST/ASTVisitor.h"
|
#include "swift/AST/ASTVisitor.h"
|
||||||
@@ -269,15 +269,16 @@ static void lookupTypeMembers(Type BaseType, VisibleDeclConsumer &Consumer,
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct FindLocalVal : public StmtVisitor<FindLocalVal> {
|
struct FindLocalVal : public StmtVisitor<FindLocalVal> {
|
||||||
|
const SourceManager &SM;
|
||||||
SourceLoc Loc;
|
SourceLoc Loc;
|
||||||
VisibleDeclConsumer &Consumer;
|
VisibleDeclConsumer &Consumer;
|
||||||
|
|
||||||
FindLocalVal(SourceLoc Loc, VisibleDeclConsumer &Consumer)
|
FindLocalVal(const SourceManager &SM, SourceLoc Loc,
|
||||||
: Loc(Loc), Consumer(Consumer) {}
|
VisibleDeclConsumer &Consumer)
|
||||||
|
: SM(SM), Loc(Loc), Consumer(Consumer) {}
|
||||||
|
|
||||||
bool IntersectsRange(SourceRange R) {
|
bool IntersectsRange(SourceRange R) {
|
||||||
return R.Start.Value.getPointer() <= Loc.Value.getPointer() &&
|
return SM.rangeContainsLoc(R, Loc);
|
||||||
R.End.Value.getPointer() >= Loc.Value.getPointer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkValueDecl(ValueDecl *D) {
|
void checkValueDecl(ValueDecl *D) {
|
||||||
@@ -397,6 +398,7 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
|
|||||||
const DeclContext *DC,
|
const DeclContext *DC,
|
||||||
SourceLoc Loc) {
|
SourceLoc Loc) {
|
||||||
const Module &M = *DC->getParentModule();
|
const Module &M = *DC->getParentModule();
|
||||||
|
const SourceManager &SM = DC->getASTContext().SourceMgr;
|
||||||
|
|
||||||
// If we are inside of a method, check to see if there are any ivars in scope,
|
// If we are inside of a method, check to see if there are any ivars in scope,
|
||||||
// and if so, whether this is a reference to one of them.
|
// and if so, whether this is a reference to one of them.
|
||||||
@@ -407,14 +409,14 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
|
|||||||
Type ExtendedType;
|
Type ExtendedType;
|
||||||
if (auto FE = dyn_cast<FuncExpr>(DC)) {
|
if (auto FE = dyn_cast<FuncExpr>(DC)) {
|
||||||
for (auto *P : FE->getArgParamPatterns())
|
for (auto *P : FE->getArgParamPatterns())
|
||||||
FindLocalVal(Loc, Consumer).checkPattern(P);
|
FindLocalVal(SM, Loc, Consumer).checkPattern(P);
|
||||||
|
|
||||||
// Look for local variables; normally, the parser resolves these
|
// Look for local variables; normally, the parser resolves these
|
||||||
// for us, but it can't do the right thing inside local types.
|
// for us, but it can't do the right thing inside local types.
|
||||||
// FIXME: when we can parse and typecheck the function body partially for
|
// FIXME: when we can parse and typecheck the function body partially for
|
||||||
// code completion, FE->getBody() check can be removed.
|
// code completion, FE->getBody() check can be removed.
|
||||||
if (Loc.isValid() && FE->getBody()) {
|
if (Loc.isValid() && FE->getBody()) {
|
||||||
FindLocalVal(Loc, Consumer).visit(FE->getBody());
|
FindLocalVal(SM, Loc, Consumer).visit(FE->getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
FuncDecl *FD = FE->getDecl();
|
FuncDecl *FD = FE->getDecl();
|
||||||
@@ -433,7 +435,7 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
|
|||||||
GenericParams = FD->getGenericParams();
|
GenericParams = FD->getGenericParams();
|
||||||
} else if (auto CE = dyn_cast<PipeClosureExpr>(DC)) {
|
} else if (auto CE = dyn_cast<PipeClosureExpr>(DC)) {
|
||||||
if (Loc.isValid()) {
|
if (Loc.isValid()) {
|
||||||
FindLocalVal(Loc, Consumer).visit(CE->getBody());
|
FindLocalVal(SM, Loc, Consumer).visit(CE->getBody());
|
||||||
}
|
}
|
||||||
} else if (auto ED = dyn_cast<ExtensionDecl>(DC)) {
|
} else if (auto ED = dyn_cast<ExtensionDecl>(DC)) {
|
||||||
ExtendedType = ED->getExtendedType();
|
ExtendedType = ED->getExtendedType();
|
||||||
@@ -447,7 +449,7 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
|
|||||||
// Look for local variables; normally, the parser resolves these
|
// Look for local variables; normally, the parser resolves these
|
||||||
// for us, but it can't do the right thing inside local types.
|
// for us, but it can't do the right thing inside local types.
|
||||||
if (Loc.isValid()) {
|
if (Loc.isValid()) {
|
||||||
FindLocalVal(Loc, Consumer).visit(CD->getBody());
|
FindLocalVal(SM, Loc, Consumer).visit(CD->getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseDecl = CD->getImplicitThisDecl();
|
BaseDecl = CD->getImplicitThisDecl();
|
||||||
@@ -461,7 +463,7 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
|
|||||||
// Look for local variables; normally, the parser resolves these
|
// Look for local variables; normally, the parser resolves these
|
||||||
// for us, but it can't do the right thing inside local types.
|
// for us, but it can't do the right thing inside local types.
|
||||||
if (Loc.isValid()) {
|
if (Loc.isValid()) {
|
||||||
FindLocalVal(Loc, Consumer).visit(CD->getBody());
|
FindLocalVal(SM, Loc, Consumer).visit(CD->getBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseDecl = DD->getImplicitThisDecl();
|
BaseDecl = DD->getImplicitThisDecl();
|
||||||
@@ -480,7 +482,7 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
|
|||||||
|
|
||||||
// Check the generic parameters for something with the given name.
|
// Check the generic parameters for something with the given name.
|
||||||
if (GenericParams) {
|
if (GenericParams) {
|
||||||
FindLocalVal(Loc, Consumer).checkGenericParams(GenericParams);
|
FindLocalVal(SM, Loc, Consumer).checkGenericParams(GenericParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
DC = DC->getParent();
|
DC = DC->getParent();
|
||||||
@@ -491,7 +493,7 @@ void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
|
|||||||
// Look for local variables in top-level code; normally, the parser
|
// Look for local variables in top-level code; normally, the parser
|
||||||
// resolves these for us, but it can't do the right thing for
|
// resolves these for us, but it can't do the right thing for
|
||||||
// local types.
|
// local types.
|
||||||
FindLocalVal(Loc, Consumer).checkTranslationUnit(TU);
|
FindLocalVal(SM, Loc, Consumer).checkTranslationUnit(TU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "swift/Basic/SourceManager.h"
|
||||||
#include "swift/AST/NameLookup.h"
|
#include "swift/AST/NameLookup.h"
|
||||||
#include "swift/AST/AST.h"
|
#include "swift/AST/AST.h"
|
||||||
#include "swift/AST/ASTVisitor.h"
|
#include "swift/AST/ASTVisitor.h"
|
||||||
@@ -136,16 +136,16 @@ void swift::removeShadowedDecls(SmallVectorImpl<ValueDecl*> &decls,
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct FindLocalVal : public StmtVisitor<FindLocalVal> {
|
struct FindLocalVal : public StmtVisitor<FindLocalVal> {
|
||||||
|
const SourceManager &SM;
|
||||||
SourceLoc Loc;
|
SourceLoc Loc;
|
||||||
Identifier Name;
|
Identifier Name;
|
||||||
ValueDecl *MatchingValue;
|
ValueDecl *MatchingValue;
|
||||||
|
|
||||||
FindLocalVal(SourceLoc Loc, Identifier Name)
|
FindLocalVal(const SourceManager &SM, SourceLoc Loc, Identifier Name)
|
||||||
: Loc(Loc), Name(Name), MatchingValue(nullptr) {}
|
: SM(SM), Loc(Loc), Name(Name), MatchingValue(nullptr) {}
|
||||||
|
|
||||||
bool IntersectsRange(SourceRange R) {
|
bool IntersectsRange(SourceRange R) {
|
||||||
return R.Start.Value.getPointer() <= Loc.Value.getPointer() &&
|
return SM.rangeContainsLoc(R, Loc);
|
||||||
R.End.Value.getPointer() >= Loc.Value.getPointer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkValueDecl(ValueDecl *D) {
|
void checkValueDecl(ValueDecl *D) {
|
||||||
@@ -273,6 +273,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
typedef UnqualifiedLookupResult Result;
|
typedef UnqualifiedLookupResult Result;
|
||||||
|
|
||||||
Module &M = *DC->getParentModule();
|
Module &M = *DC->getParentModule();
|
||||||
|
const SourceManager &SM = DC->getASTContext().SourceMgr;
|
||||||
|
|
||||||
// Never perform local lookup for operators.
|
// Never perform local lookup for operators.
|
||||||
if (Name.isOperator())
|
if (Name.isOperator())
|
||||||
@@ -291,7 +292,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
// FIXME: when we can parse and typecheck the function body partially for
|
// FIXME: when we can parse and typecheck the function body partially for
|
||||||
// code completion, FE->getBody() check can be removed.
|
// code completion, FE->getBody() check can be removed.
|
||||||
if (Loc.isValid() && FE->getBody()) {
|
if (Loc.isValid() && FE->getBody()) {
|
||||||
FindLocalVal localVal(Loc, Name);
|
FindLocalVal localVal(SM, Loc, Name);
|
||||||
localVal.visit(FE->getBody());
|
localVal.visit(FE->getBody());
|
||||||
if (!localVal.MatchingValue) {
|
if (!localVal.MatchingValue) {
|
||||||
for (Pattern *P : FE->getBodyParamPatterns())
|
for (Pattern *P : FE->getBodyParamPatterns())
|
||||||
@@ -324,7 +325,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
// Look for local variables; normally, the parser resolves these
|
// Look for local variables; normally, the parser resolves these
|
||||||
// for us, but it can't do the right thing inside local types.
|
// for us, but it can't do the right thing inside local types.
|
||||||
if (Loc.isValid()) {
|
if (Loc.isValid()) {
|
||||||
FindLocalVal localVal(Loc, Name);
|
FindLocalVal localVal(SM, Loc, Name);
|
||||||
localVal.visit(CE->getBody());
|
localVal.visit(CE->getBody());
|
||||||
if (!localVal.MatchingValue) {
|
if (!localVal.MatchingValue) {
|
||||||
localVal.checkPattern(CE->getParams());
|
localVal.checkPattern(CE->getParams());
|
||||||
@@ -346,7 +347,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
// Look for local variables; normally, the parser resolves these
|
// Look for local variables; normally, the parser resolves these
|
||||||
// for us, but it can't do the right thing inside local types.
|
// for us, but it can't do the right thing inside local types.
|
||||||
if (Loc.isValid()) {
|
if (Loc.isValid()) {
|
||||||
FindLocalVal localVal(Loc, Name);
|
FindLocalVal localVal(SM, Loc, Name);
|
||||||
localVal.visit(CD->getBody());
|
localVal.visit(CD->getBody());
|
||||||
if (!localVal.MatchingValue)
|
if (!localVal.MatchingValue)
|
||||||
localVal.checkPattern(CD->getArguments());
|
localVal.checkPattern(CD->getArguments());
|
||||||
@@ -367,7 +368,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
// Look for local variables; normally, the parser resolves these
|
// Look for local variables; normally, the parser resolves these
|
||||||
// for us, but it can't do the right thing inside local types.
|
// for us, but it can't do the right thing inside local types.
|
||||||
if (Loc.isValid()) {
|
if (Loc.isValid()) {
|
||||||
FindLocalVal localVal(Loc, Name);
|
FindLocalVal localVal(SM, Loc, Name);
|
||||||
localVal.visit(CD->getBody());
|
localVal.visit(CD->getBody());
|
||||||
if (!localVal.MatchingValue)
|
if (!localVal.MatchingValue)
|
||||||
localVal.checkPattern(CD->getArguments());
|
localVal.checkPattern(CD->getArguments());
|
||||||
@@ -388,7 +389,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
|
|
||||||
// Check the generic parameters for something with the given name.
|
// Check the generic parameters for something with the given name.
|
||||||
if (GenericParams) {
|
if (GenericParams) {
|
||||||
FindLocalVal localVal(Loc, Name);
|
FindLocalVal localVal(SM, Loc, Name);
|
||||||
localVal.checkGenericParams(GenericParams);
|
localVal.checkGenericParams(GenericParams);
|
||||||
|
|
||||||
if (localVal.MatchingValue) {
|
if (localVal.MatchingValue) {
|
||||||
@@ -463,7 +464,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
->getInstanceType()->getAnyNominal()
|
->getInstanceType()->getAnyNominal()
|
||||||
: ExtendedType->getAnyNominal();
|
: ExtendedType->getAnyNominal();
|
||||||
if (nominal && nominal->getGenericParams()) {
|
if (nominal && nominal->getGenericParams()) {
|
||||||
FindLocalVal localVal(Loc, Name);
|
FindLocalVal localVal(SM, Loc, Name);
|
||||||
localVal.checkGenericParams(nominal->getGenericParams());
|
localVal.checkGenericParams(nominal->getGenericParams());
|
||||||
|
|
||||||
if (localVal.MatchingValue) {
|
if (localVal.MatchingValue) {
|
||||||
@@ -481,7 +482,7 @@ UnqualifiedLookup::UnqualifiedLookup(Identifier Name, DeclContext *DC,
|
|||||||
// Look for local variables in top-level code; normally, the parser
|
// Look for local variables in top-level code; normally, the parser
|
||||||
// resolves these for us, but it can't do the right thing for
|
// resolves these for us, but it can't do the right thing for
|
||||||
// local types.
|
// local types.
|
||||||
FindLocalVal localVal(Loc, Name);
|
FindLocalVal localVal(SM, Loc, Name);
|
||||||
localVal.checkTranslationUnit(TU);
|
localVal.checkTranslationUnit(TU);
|
||||||
if (localVal.MatchingValue) {
|
if (localVal.MatchingValue) {
|
||||||
Results.push_back(Result::getLocalDecl(localVal.MatchingValue));
|
Results.push_back(Result::getLocalDecl(localVal.MatchingValue));
|
||||||
|
|||||||
@@ -973,9 +973,7 @@ namespace {
|
|||||||
llvm_unreachable("impossible parent node");
|
llvm_unreachable("impossible parent node");
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: This is a very ugly way to check inclusion.
|
if (!Ctx.SourceMgr.rangeContains(Enclosing, Current)) {
|
||||||
if (Enclosing.Start.Value.getPointer() > Current.Start.Value.getPointer()
|
|
||||||
|| Enclosing.End.Value.getPointer() < Current.End.Value.getPointer()){
|
|
||||||
Out << "child source range not contained within its parent: ";
|
Out << "child source range not contained within its parent: ";
|
||||||
printEntity();
|
printEntity();
|
||||||
Out << "\n parent range: ";
|
Out << "\n parent range: ";
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "swift/IDE/SyntaxColoring.h"
|
#include "swift/IDE/SyntaxColoring.h"
|
||||||
|
#include "swift/AST/ASTContext.h"
|
||||||
#include "swift/AST/ASTWalker.h"
|
#include "swift/AST/ASTWalker.h"
|
||||||
#include "swift/AST/Decl.h"
|
#include "swift/AST/Decl.h"
|
||||||
#include "swift/AST/Module.h"
|
#include "swift/AST/Module.h"
|
||||||
@@ -65,8 +66,7 @@ SyntaxColoringContext::SyntaxColoringContext(SourceManager &SM,
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert(Tok.getLoc().isValid());
|
assert(Tok.getLoc().isValid());
|
||||||
assert(Nodes.empty() ||
|
assert(Nodes.empty() || SM.isBeforeInBuffer(Nodes.back().Loc, Tok.getLoc()));
|
||||||
Nodes.back().Loc.Value.getPointer()<Tok.getLoc().Value.getPointer());
|
|
||||||
Nodes.emplace_back(Kind, Tok.getLoc(), Tok.getLength());
|
Nodes.emplace_back(Kind, Tok.getLoc(), Tok.getLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,12 +80,14 @@ SyntaxColoringContext::~SyntaxColoringContext() {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class ColorASTWalker : public ASTWalker {
|
class ColorASTWalker : public ASTWalker {
|
||||||
|
const SourceManager &SM;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SyntaxColorWalker &SCWalker;
|
SyntaxColorWalker &SCWalker;
|
||||||
ArrayRef<SyntaxNode> TokenNodes;
|
ArrayRef<SyntaxNode> TokenNodes;
|
||||||
|
|
||||||
ColorASTWalker(SyntaxColorWalker &SCWalker)
|
ColorASTWalker(const SourceManager &SM, SyntaxColorWalker &SCWalker)
|
||||||
: SCWalker(SCWalker) { }
|
: SM(SM), SCWalker(SCWalker) { }
|
||||||
|
|
||||||
void visitTranslationUnit(TranslationUnit &TU, ArrayRef<SyntaxNode> Tokens);
|
void visitTranslationUnit(TranslationUnit &TU, ArrayRef<SyntaxNode> Tokens);
|
||||||
|
|
||||||
@@ -100,7 +102,7 @@ private:
|
|||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
bool SyntaxColoringContext::walk(SyntaxColorWalker &Walker) {
|
bool SyntaxColoringContext::walk(SyntaxColorWalker &Walker) {
|
||||||
ColorASTWalker ASTWalk(Walker);
|
ColorASTWalker ASTWalk(TU.Ctx.SourceMgr, Walker);
|
||||||
ASTWalk.visitTranslationUnit(TU, Impl.TokenNodes);
|
ASTWalk.visitTranslationUnit(TU, Impl.TokenNodes);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -132,8 +134,7 @@ bool ColorASTWalker::passTokenNodesUntil(SourceLoc Loc, bool Inclusive) {
|
|||||||
unsigned I = 0;
|
unsigned I = 0;
|
||||||
for (unsigned E = TokenNodes.size(); I != E; ++I) {
|
for (unsigned E = TokenNodes.size(); I != E; ++I) {
|
||||||
SourceLoc TokLoc = TokenNodes[I].Loc;
|
SourceLoc TokLoc = TokenNodes[I].Loc;
|
||||||
if (TokLoc.Value.getPointer() > Loc.Value.getPointer() ||
|
if (SM.isBeforeInBuffer(Loc, TokLoc) || (!Inclusive && TokLoc == Loc)) {
|
||||||
(!Inclusive && TokLoc.Value.getPointer() == Loc.Value.getPointer())) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!passNode(TokenNodes[I]))
|
if (!passNode(TokenNodes[I]))
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "ConstraintSystem.h"
|
#include "ConstraintSystem.h"
|
||||||
#include "TypeChecker.h"
|
#include "TypeChecker.h"
|
||||||
|
#include "swift/Basic/SourceManager.h"
|
||||||
#include "swift/AST/ASTContext.h"
|
#include "swift/AST/ASTContext.h"
|
||||||
#include "swift/AST/Decl.h"
|
#include "swift/AST/Decl.h"
|
||||||
#include "swift/AST/NameLookup.h"
|
#include "swift/AST/NameLookup.h"
|
||||||
@@ -1053,8 +1054,8 @@ static void suggestExplicitConformance(TypeChecker &tc,
|
|||||||
// FIXME: < on character pointers is a horrible hack.
|
// FIXME: < on character pointers is a horrible hack.
|
||||||
assert(owner != witnessOwner && "Owners cannot match here.");
|
assert(owner != witnessOwner && "Owners cannot match here.");
|
||||||
|
|
||||||
if (witnessOwner->getLoc().Value.getPointer() <
|
if (tc.Context.SourceMgr.isBeforeInBuffer(witnessOwner->getLoc(),
|
||||||
owner->getLoc().Value.getPointer())
|
owner->getLoc()))
|
||||||
owner = witnessOwner;
|
owner = witnessOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user