summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-05-11 15:33:28 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-05-11 15:33:28 +0000
commit3246fba975e5768458d55a48e7d45e9b3eeab2b6 (patch)
tree552f0a203eccbd0fcb94304412f981134f341273
parent87d05b985299b91f3f4d8906b552e505ac59755b (diff)
downloadbcm5719-llvm-3246fba975e5768458d55a48e7d45e9b3eeab2b6.tar.gz
bcm5719-llvm-3246fba975e5768458d55a48e7d45e9b3eeab2b6.zip
[include-fixer] Also output the location where we found an unknown identifier.
For debugging only, makes it a bit easier when there are queries coming out of headers. llvm-svn: 269194
-rw-r--r--clang-tools-extra/include-fixer/IncludeFixer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang-tools-extra/include-fixer/IncludeFixer.cpp b/clang-tools-extra/include-fixer/IncludeFixer.cpp
index 66729ed0d91..d75eedd0a7c 100644
--- a/clang-tools-extra/include-fixer/IncludeFixer.cpp
+++ b/clang-tools-extra/include-fixer/IncludeFixer.cpp
@@ -95,7 +95,7 @@ public:
bool MaybeDiagnoseMissingCompleteType(clang::SourceLocation Loc,
clang::QualType T) override {
clang::ASTContext &context = getCompilerInstance().getASTContext();
- query(T.getUnqualifiedType().getAsString(context.getPrintingPolicy()));
+ query(T.getUnqualifiedType().getAsString(context.getPrintingPolicy()), Loc);
return false;
}
@@ -141,7 +141,7 @@ public:
QueryString = Typo.getAsString();
}
- return query(QueryString);
+ return query(QueryString, Typo.getLoc());
}
StringRef filename() const { return Filename; }
@@ -226,14 +226,16 @@ public:
private:
/// Query the database for a given identifier.
- clang::TypoCorrection query(StringRef Query) {
+ clang::TypoCorrection query(StringRef Query, SourceLocation Loc) {
assert(!Query.empty() && "Empty query!");
// Save database lookups by not looking up identifiers multiple times.
if (!SeenQueries.insert(Query).second)
return clang::TypoCorrection();
- DEBUG(llvm::dbgs() << "Looking up " << Query << " ... ");
+ DEBUG(llvm::dbgs() << "Looking up '" << Query << "' at ");
+ DEBUG(Loc.print(llvm::dbgs(), getCompilerInstance().getSourceManager()));
+ DEBUG(llvm::dbgs() << " ...");
std::string error_text;
auto SearchReply = XrefsDBMgr.search(Query);
OpenPOWER on IntegriCloud