| 1 | #include "clang/Analysis/Scalable/TUSummary/TUSummaryBuilder.h" |
|---|---|
| 2 | #include "clang/Analysis/Scalable/Model/EntityId.h" |
| 3 | #include "clang/Analysis/Scalable/TUSummary/EntitySummary.h" |
| 4 | #include "clang/Analysis/Scalable/TUSummary/TUSummary.h" |
| 5 | #include <memory> |
| 6 | #include <utility> |
| 7 | |
| 8 | using namespace clang; |
| 9 | using namespace ssaf; |
| 10 | |
| 11 | EntityId TUSummaryBuilder::addEntity(const EntityName &E) { |
| 12 | return Summary.IdTable.getId(Name: E); |
| 13 | } |
| 14 | |
| 15 | std::pair<EntitySummary *, bool> |
| 16 | TUSummaryBuilder::addSummaryImpl(EntityId Entity, |
| 17 | std::unique_ptr<EntitySummary> &&Data) { |
| 18 | auto &EntitySummaries = Summary.Data[Data->getSummaryName()]; |
| 19 | auto [It, Inserted] = EntitySummaries.try_emplace(k: Entity, args: std::move(Data)); |
| 20 | return {It->second.get(), Inserted}; |
| 21 | } |
| 22 |