Page MenuHomePhabricator

D66690.diff
No OneTemporary

File Metadata

Created
Sat, Dec 7, 12:34 AM

D66690.diff

Index: clang/tools/libclang/Indexing.cpp
===================================================================
--- clang/tools/libclang/Indexing.cpp
+++ clang/tools/libclang/Indexing.cpp
@@ -132,7 +132,7 @@
Set = ParsedRegions;
}
- void update(ArrayRef<PPRegion> Regions) {
+ void update(const PPRegionSetTy& Regions) {
std::lock_guard<std::mutex> MG(Mux);
ParsedRegions.insert(Regions.begin(), Regions.end());
}
@@ -144,7 +144,8 @@
Preprocessor &PP;
PPRegionSetTy ParsedRegions;
- SmallVector<PPRegion, 32> NewParsedRegions;
+ PPRegionSetTy NewParsedRegions;
+
PPRegion LastRegion;
bool LastIsParsed;
@@ -166,9 +167,9 @@
return LastIsParsed;
LastRegion = region;
- LastIsParsed = ParsedRegions.count(region);
+ LastIsParsed = NewParsedRegions.count(region) || ParsedRegions.count(region);
if (!LastIsParsed)
- NewParsedRegions.push_back(region);
+ NewParsedRegions.insert(std::move(region));
return LastIsParsed;
}

Event Timeline