summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/utils
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-08-19 21:02:27 +0000
committerDaniel Jasper <djasper@google.com>2015-08-19 21:02:27 +0000
commitd30dc3fc75fdae8221e7880a2ceece3ac12c98d7 (patch)
tree90c84a90d1c7c271aa328211fb3178b3ebc0b9ba /clang-tools-extra/clang-tidy/utils
parentb12248e9cda19a6cebe1ffb233a28912691eba87 (diff)
downloadbcm5719-llvm-d30dc3fc75fdae8221e7880a2ceece3ac12c98d7.tar.gz
bcm5719-llvm-d30dc3fc75fdae8221e7880a2ceece3ac12c98d7.zip
Fix IncludeInserter to allow for more than one added header per file.
Also adapt tests a bit to make it possible to test this. Removed checking the number of errors reported per test. It was never actually checked and doesn't seem particularly relevant to the test itself. llvm-svn: 245500
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils')
-rw-r--r--clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
index e0b977386d8..8f4bee6ad90 100644
--- a/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
+++ b/clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
@@ -49,10 +49,9 @@ IncludeInserter::CreateIncludeInsertion(FileID FileID, StringRef Header,
bool IsAngled) {
// We assume the same Header will never be included both angled and not
// angled.
- if (!InsertedHeaders.insert(std::make_pair(FileID, std::set<std::string>()))
- .second) {
+ if (!InsertedHeaders[FileID].insert(Header).second)
return llvm::None;
- }
+
if (IncludeSorterByFile.find(FileID) == IncludeSorterByFile.end()) {
// This may happen if there have been no preprocessor directives in this
// file.
OpenPOWER on IntegriCloud