Skip to content

[SIL] SIL block names available in NOT-NOT-DEBUG builds. #41507

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

Merged
merged 1 commit into from
Feb 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions include/swift/SIL/SILModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class SILModule {
/// Action to be executed for serializing the SILModule.
ActionCallback SerializeSILAction;

#if NDEBUG
#ifndef NDEBUG
BasicBlockNameMapType basicBlockNames;
#endif

Expand Down Expand Up @@ -456,20 +456,20 @@ class SILModule {
bool isSerialized() const { return serialized; }

void setBasicBlockName(const SILBasicBlock *block, StringRef name) {
#if NDEBUG
#ifndef NDEBUG
basicBlockNames[block] = name.str();
#endif
#endif
}
Optional<StringRef> getBasicBlockName(const SILBasicBlock *block) {
#if NDEBUG
#ifndef NDEBUG
auto Known = basicBlockNames.find(block);
if (Known == basicBlockNames.end())
return None;

return StringRef(Known->second);
#else
#else
return None;
#endif
#endif
}

/// Serialize a SIL module using the configured SerializeSILAction.
Expand Down