NFC: use enum SymbolData as flags

To make it easier to add flags when adding new options in SymbolData.

Example:
I want to add a flag to disable inline record for https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2915828.
Change-Id: Ifc5da27c01efa0b0bc21cfcf769d4e6d604a63c6
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2984198
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Zequan Wu 2021-06-30 12:27:45 -07:00 committed by Joshua Peraza
parent 04a9ffbe59
commit 68735f74e7
9 changed files with 35 additions and 16 deletions

View file

@ -266,7 +266,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) {
stream << "INFO CODE_ID " << code_id_ << "\n";
}
if (symbol_data != ONLY_CFI) {
if (symbol_data & SYMBOLS_AND_FILES) {
AssignSourceIds();
// Write out files.
@ -324,7 +324,7 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) {
}
}
if (symbol_data != NO_CFI) {
if (symbol_data & CFI) {
// Write out 'STACK CFI INIT' and 'STACK CFI' records.
vector<StackFrameEntry*>::const_iterator frame_it;
for (frame_it = stack_frame_entries_.begin();