Merge "Speed up WriteKeepSet when generate_conditional_proguard_rules is off."

am: a9ee3aaa5f

Change-Id: Id212eb75f3f880e5c9acaa6aae51aab872570133
This commit is contained in:
Brian Duff
2019-11-12 16:08:27 -08:00
committed by android-build-merger

View File

@@ -404,12 +404,15 @@ void WriteKeepSet(const KeepSet& keep_set, OutputStream* out, bool minimal_keep)
for (const auto& entry : keep_set.conditional_class_set_) {
std::set<UsageLocation> locations;
bool can_be_conditional = true;
for (const UsageLocation& location : entry.second) {
can_be_conditional &= CollectLocations(location, keep_set, &locations);
bool can_be_conditional = false;
if (keep_set.conditional_keep_rules_) {
can_be_conditional = true;
for (const UsageLocation& location : entry.second) {
can_be_conditional &= CollectLocations(location, keep_set, &locations);
}
}
if (keep_set.conditional_keep_rules_ && can_be_conditional) {
if (can_be_conditional) {
for (const UsageLocation& location : locations) {
printer.Print("# Referenced at ").Println(location.source.to_string());
printer.Print("-if class **.R$layout { int ")