Skip to content

[local] Change some for-loops in analyzeStaticInitializer to use llvm… #15494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gottesmm
Copy link
Contributor

…::none_of.

Noticed this while trying to understand the code in global opt that uses this. I
also did a little style cleanup in the function.

NFC.

…::none_of.

Noticed this while trying to understand the code in global opt that uses this. I
also did a little style cleanup in the function.

NFC.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

1 similar comment
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@davezarzycki
Copy link
Contributor

Is it possible to avoid the negation via llvm::all_of? For example, this reads better:

return llvm::all_of(SI->getAllOperands(), [&](Operand &Op) -> bool {
  return analyzeStaticInitializer(Op.get(), Insts);
});

@gottesmm
Copy link
Contributor Author

@davezarzycki Sure. I will do it in a follow up.

@gottesmm gottesmm merged commit 08c7391 into swiftlang:master Mar 26, 2018
@gottesmm gottesmm deleted the pr-79d85b691ed01cfb676f6c8b080a741813952923 branch March 26, 2018 17:42
@gottesmm
Copy link
Contributor Author

@davezarzycki #15515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants