summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-03-02 14:12:17 +0000
committerHaojian Wu <hokein@google.com>2016-03-02 14:12:17 +0000
commit7d08ba274959e110dfd4929cd2318a26083e6185 (patch)
treee64a1098f2c12211ded0ad91be42e4646c4d26e4 /clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
parent8f3381ed315604ff3a7853f22587d9115dd95a58 (diff)
downloadbcm5719-llvm-7d08ba274959e110dfd4929cd2318a26083e6185.tar.gz
bcm5719-llvm-7d08ba274959e110dfd4929cd2318a26083e6185.zip
[clang-tidy] Fix an assertion failure of "SLocEntry::getExpansion()" when IncludeInserter handles macro header file.
Summary: Also Fixes PR24749. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17805 llvm-svn: 262484
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
index 8f4bee6ad90..d128c691110 100644
--- a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
+++ b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "IncludeInserter.h"
+#include "clang/Lex/Token.h"
namespace clang {
namespace tidy {
@@ -19,14 +20,14 @@ public:
// Implements PPCallbacks::InclusionDerective(). Records the names and source
// locations of the inclusions in the main source file being processed.
void InclusionDirective(SourceLocation HashLocation,
- const Token & /*include_token*/,
+ const Token & IncludeToken,
StringRef FileNameRef, bool IsAngled,
CharSourceRange FileNameRange,
const FileEntry * /*IncludedFile*/,
StringRef /*SearchPath*/, StringRef /*RelativePath*/,
const Module * /*ImportedModule*/) override {
Inserter->AddInclude(FileNameRef, IsAngled, HashLocation,
- FileNameRange.getEnd());
+ IncludeToken.getEndLoc());
}
private:
OpenPOWER on IntegriCloud