Skip to content

Commit cbb1cb5

Browse files
committed
Conditionalize dump functions
1 parent 64f364d commit cbb1cb5

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Sources/LLVM/IRType.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ public extension IRType {
3131
}
3232

3333
/// Dumps a representation of this type to stderr.
34+
#if !NDEBUG || LLVM_ENABLE_DUMP
3435
public func dump() {
3536
LLVMDumpType(asLLVM())
3637
}
38+
#endif
3739
}
3840

3941
internal func convertType(_ type: LLVMTypeRef) -> IRType {

Sources/LLVM/IRValue.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ public extension IRValue {
6868
LLVMReplaceAllUsesWith(asLLVM(), value.asLLVM())
6969
}
7070

71+
#if !NDEBUG || LLVM_ENABLE_DUMP
7172
/// Dumps a representation of this value to stderr.
7273
public func dump() {
7374
LLVMDumpValue(asLLVM())
7475
}
76+
#endif
7577
}
7678

7779
extension LLVMValueRef: IRValue {

Sources/LLVM/Module.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,12 @@ public final class Module: CustomStringConvertible {
180180
}
181181
}
182182

183+
#if !NDEBUG || LLVM_ENABLE_DUMP
183184
/// Dump a representation of this module to stderr.
184185
public func dump() {
185186
LLVMDumpModule(llvm)
186187
}
188+
#endif
187189

188190
/// The full text IR of this module
189191
public var description: String {

0 commit comments

Comments
 (0)