@@ -620,10 +620,11 @@ void Dyld::ScanForLibraries(bool searchSystemLibraries /* = false*/) {
620
620
621
621
LLVM_DEBUG (dbgs () << " Dyld::ScanForLibraries: system="
622
622
<< (searchSystemLibraries ? " true" : " false" ) << " \n " );
623
+ #ifndef NDEBUG
623
624
for (const DynamicLibraryManager::SearchPathInfo& Info : searchPaths)
624
625
LLVM_DEBUG (dbgs () << " >>>" << Info.Path << " , "
625
626
<< (Info.IsUser ? " user\n " : " system\n " ));
626
-
627
+ # endif
627
628
llvm::SmallSet<const BasePath*, 32 > ScannedPaths;
628
629
629
630
for (const DynamicLibraryManager::SearchPathInfo& Info : searchPaths) {
@@ -769,11 +770,12 @@ void Dyld::ScanForLibraries(bool searchSystemLibraries /* = false*/) {
769
770
<< RPathToStr (RPath) << " \n " );
770
771
LLVM_DEBUG (dbgs () << " Dyld::ScanForLibraries: RUNPATH="
771
772
<< RPathToStr (RunPath) << " \n " );
773
+ #ifndef NDEBUG
772
774
int x = 0 ;
773
775
for (StringRef dep : Deps)
774
776
LLVM_DEBUG (dbgs () << " Dyld::ScanForLibraries: Deps[" << x++
775
777
<< " ]=" << dep.str () << " \n " );
776
-
778
+ # endif
777
779
// Heuristics for workaround performance problems:
778
780
// (H1) If RPATH and RUNPATH == "" -> skip handling Deps
779
781
if (RPath.empty () && RunPath.empty ()) {
@@ -965,10 +967,11 @@ void Dyld::BuildBloomFilter(LibraryPath* Lib,
965
967
}
966
968
967
969
LLVM_DEBUG (dbgs () << " Dyld::BuildBloomFilter: Symbols:\n " );
970
+ #ifndef NDEBUG
968
971
for (auto it : symbols)
969
972
LLVM_DEBUG (dbgs () << " Dyld::BuildBloomFilter"
970
973
<< " - " << it << " \n " );
971
-
974
+ # endif
972
975
// Generate BloomFilter
973
976
for (const auto & S : symbols) {
974
977
if (m_UseHashTable)
@@ -1036,7 +1039,11 @@ bool Dyld::ContainsSymbol(const LibraryPath* Lib, StringRef mangledName,
1036
1039
}
1037
1040
1038
1041
auto ForeachSymbol =
1042
+ #ifndef NDEBUG
1039
1043
[&library_filename](
1044
+ #else
1045
+ [](
1046
+ #endif
1040
1047
llvm::iterator_range<llvm::object::symbol_iterator> range,
1041
1048
unsigned IgnoreSymbolFlags, llvm::StringRef mangledName) -> bool {
1042
1049
for (const llvm::object::SymbolRef& S : range) {
@@ -1157,6 +1164,7 @@ bool Dyld::ShouldPermanentlyIgnore(StringRef FileName) const {
1157
1164
void Dyld::dumpDebugInfo () const {
1158
1165
#define DEBUG_TYPE " Dyld:"
1159
1166
LLVM_DEBUG (dbgs () << " ---\n " );
1167
+ #ifndef NDEBUG
1160
1168
size_t x = 0 ;
1161
1169
for (auto const & item : m_BasePaths.m_Paths ) {
1162
1170
LLVM_DEBUG (dbgs () << " Dyld: - m_BasePaths[" << x++ << " ]:" << &item << " : "
@@ -1174,6 +1182,7 @@ void Dyld::dumpDebugInfo() const {
1174
1182
<< " : " << item->m_Path << " , " << item->m_LibName
1175
1183
<< " \n " );
1176
1184
}
1185
+ #endif
1177
1186
#undef DEBUG_TYPE
1178
1187
}
1179
1188
@@ -1213,12 +1222,13 @@ std::string Dyld::searchLibrariesForSymbol(StringRef mangledName,
1213
1222
// from our lists of not-yet-loaded libs.
1214
1223
1215
1224
LLVM_DEBUG (dbgs () << " Dyld::ResolveSymbol: m_QueriedLibraries:\n " );
1225
+ #ifndef NDEBUG
1216
1226
size_t x = 0 ;
1217
1227
for (auto item : m_QueriedLibraries.GetLibraries ()) {
1218
1228
LLVM_DEBUG (dbgs () << " Dyld::ResolveSymbol - [" << x++ << " ]:" << &item
1219
1229
<< " : " << item->GetFullName () << " \n " );
1220
1230
}
1221
-
1231
+ # endif
1222
1232
for (const LibraryPath* P : m_QueriedLibraries.GetLibraries ()) {
1223
1233
const std::string LibName = P->GetFullName ();
1224
1234
if (!m_DynamicLibraryManager.isLibraryLoaded (LibName))
0 commit comments