@@ -219,8 +219,8 @@ bool DylibPathValidator::isSharedLibrary(StringRef Path) {
219219 LLVM_DEBUG (dbgs () << " Checking if path is a shared library: " << Path
220220 << " \n " ;);
221221
222- auto filetype = sys::fs::get_file_type (Path, /* Follow*/ true );
223- if (filetype != sys::fs::file_type::regular_file) {
222+ auto FileType = sys::fs::get_file_type (Path, /* Follow*/ true );
223+ if (FileType != sys::fs::file_type::regular_file) {
224224 LLVM_DEBUG (dbgs () << " File type is not a regular file for path: " << Path
225225 << " \n " ;);
226226 return false ;
@@ -303,13 +303,13 @@ void DylibSubstitutor::configure(StringRef LoaderPath) {
303303std::optional<std::string>
304304SearchPathResolver::resolve (StringRef Stem, const DylibSubstitutor &Subst,
305305 DylibPathValidator &Validator) const {
306- for (const auto &searchPath : Paths) {
307- std::string Base = Subst.substitute (searchPath );
306+ for (const auto &SP : Paths) {
307+ std::string Base = Subst.substitute (SP );
308308
309309 SmallString<512 > FullPath (Base);
310- if (!placeholderPrefix .empty () &&
311- Stem.starts_with_insensitive (placeholderPrefix ))
312- FullPath.append (Stem.drop_front (placeholderPrefix .size ()));
310+ if (!PlaceholderPrefix .empty () &&
311+ Stem.starts_with_insensitive (PlaceholderPrefix ))
312+ FullPath.append (Stem.drop_front (PlaceholderPrefix .size ()));
313313 else
314314 sys::path::append (FullPath, Stem);
315315
@@ -341,24 +341,24 @@ DylibResolverImpl::tryWithExtensions(StringRef LibStem) const {
341341#endif
342342
343343 // Optionally try "lib" prefix if not already there
344- StringRef filename = sys::path::filename (LibStem);
344+ StringRef FileName = sys::path::filename (LibStem);
345345 StringRef Base = sys::path::parent_path (LibStem);
346- if (!filename .starts_with (" lib" )) {
347- SmallString<256 > withPrefix (Base);
348- if (!withPrefix .empty ())
349- sys::path::append (withPrefix , " " ); // ensure separator if needed
350- withPrefix += " lib" ;
351- withPrefix += filename ;
346+ if (!FileName .starts_with (" lib" )) {
347+ SmallString<256 > WithPrefix (Base);
348+ if (!WithPrefix .empty ())
349+ sys::path::append (WithPrefix , " " ); // ensure separator if needed
350+ WithPrefix += " lib" ;
351+ WithPrefix += FileName ;
352352
353353#if defined(__APPLE__)
354- withPrefix += " .dylib" ;
354+ WithPrefix += " .dylib" ;
355355#elif defined(_WIN32)
356- withPrefix += " .dll" ;
356+ WithPrefix += " .dll" ;
357357#else
358- withPrefix += " .so" ;
358+ WithPrefix += " .so" ;
359359#endif
360360
361- Candidates.push_back (std::move (withPrefix ));
361+ Candidates.push_back (std::move (WithPrefix ));
362362 }
363363
364364 LLVM_DEBUG ({
@@ -373,8 +373,8 @@ DylibResolverImpl::tryWithExtensions(StringRef LibStem) const {
373373 LLVM_DEBUG (dbgs () << " Trying candidate: " << Name << " \n " ;);
374374
375375 for (const auto &R : Resolvers) {
376- if (auto result = R.resolve (Name, Substitutor, Validator))
377- return result ;
376+ if (auto Res = R.resolve (Name, Substitutor, Validator))
377+ return Res ;
378378 }
379379 }
380380
@@ -384,7 +384,7 @@ DylibResolverImpl::tryWithExtensions(StringRef LibStem) const {
384384}
385385
386386std::optional<std::string>
387- DylibResolverImpl::resolve (StringRef LibStem, bool variateLibStem ) const {
387+ DylibResolverImpl::resolve (StringRef LibStem, bool VariateLibStem ) const {
388388 LLVM_DEBUG (dbgs () << " Resolving library stem: " << LibStem << " \n " ;);
389389
390390 // If it is an absolute path, don't try iterate over the paths.
@@ -404,24 +404,24 @@ DylibResolverImpl::resolve(StringRef LibStem, bool variateLibStem) const {
404404
405405 for (const auto &R : Resolvers) {
406406 LLVM_DEBUG (dbgs () << " -> Resolving via search path ... \n " ;);
407- if (auto result = R.resolve (LibStem, Substitutor, Validator)) {
408- LLVM_DEBUG (dbgs () << " -> Resolved via search path: " << *result
407+ if (auto Result = R.resolve (LibStem, Substitutor, Validator)) {
408+ LLVM_DEBUG (dbgs () << " -> Resolved via search path: " << *Result
409409 << " \n " ;);
410410
411- return result ;
411+ return Result ;
412412 }
413413 }
414414
415415 // Expand libStem with paths, extensions, etc.
416416 // std::string foundName;
417- if (variateLibStem ) {
417+ if (VariateLibStem ) {
418418 LLVM_DEBUG (dbgs () << " -> Trying with extensions...\n " ;);
419419
420- if (auto norm = tryWithExtensions (LibStem)) {
421- LLVM_DEBUG (dbgs () << " -> Resolved via tryWithExtensions: " << *norm
420+ if (auto Norm = tryWithExtensions (LibStem)) {
421+ LLVM_DEBUG (dbgs () << " -> Resolved via tryWithExtensions: " << *Norm
422422 << " \n " ;);
423423
424- return norm ;
424+ return Norm ;
425425 }
426426 }
427427
@@ -433,8 +433,8 @@ DylibResolverImpl::resolve(StringRef LibStem, bool variateLibStem) const {
433433#ifndef _WIN32
434434mode_t PathResolver::lstatCached (StringRef Path) {
435435 // If already cached - retun cached result
436- if (auto cache = LibPathCache->read_lstat (Path))
437- return *cache ;
436+ if (auto Cache = LibPathCache->read_lstat (Path))
437+ return *Cache ;
438438
439439 // Not cached: perform lstat and store
440440 struct stat buf{};
@@ -447,8 +447,8 @@ mode_t PathResolver::lstatCached(StringRef Path) {
447447
448448std::optional<std::string> PathResolver::readlinkCached (StringRef Path) {
449449 // If already cached - retun cached result
450- if (auto cache = LibPathCache->read_link (Path))
451- return cache ;
450+ if (auto Cache = LibPathCache->read_link (Path))
451+ return Cache ;
452452
453453 // If result not in cache - call system function and cache result
454454 char buf[PATH_MAX];
@@ -767,8 +767,8 @@ std::string LibraryScanHelper::resolveCanonical(StringRef Path,
767767
768768PathType LibraryScanHelper::classifyKind (StringRef Path) const {
769769 // Detect home directory
770- const char *home = getenv (" HOME" );
771- if (home && Path.find (home ) == 0 )
770+ const char *Home = getenv (" HOME" );
771+ if (Home && Path.find (Home ) == 0 )
772772 return PathType::User;
773773
774774 static const std::array<std::string, 5 > UserPrefixes = {
0 commit comments