-
Notifications
You must be signed in to change notification settings - Fork 31
Fix typos in repo #556
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
base: main
Are you sure you want to change the base?
Fix typos in repo #556
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,7 +256,7 @@ | |
static inline mode_t cached_lstat(const char *path) { | ||
static StringMap<mode_t> lstat_cache; | ||
|
||
// If already cached - retun cached result | ||
// If already cached - return cached result | ||
auto it = lstat_cache.find(path); | ||
if (it != lstat_cache.end()) | ||
return it->second; | ||
|
@@ -272,7 +272,7 @@ | |
static inline StringRef cached_readlink(const char* pathname) { | ||
static StringMap<std::string> readlink_cache; | ||
|
||
// If already cached - retun cached result | ||
// If already cached - return cached result | ||
auto it = readlink_cache.find(pathname); | ||
if (it != readlink_cache.end()) | ||
return StringRef(it->second); | ||
|
@@ -304,7 +304,7 @@ | |
return ""; | ||
} | ||
|
||
// If already cached - retun cached result | ||
// If already cached - return cached result | ||
static StringMap<std::pair<std::string,int>> cache; | ||
bool relative_path = llvm::sys::path::is_relative(path); | ||
if (!relative_path) { | ||
|
@@ -606,10 +606,12 @@ | |
Deps.push_back(Data + Dyn.d_un.d_val); | ||
break; | ||
case ELF::DT_RPATH: | ||
SplitPaths(Data + Dyn.d_un.d_val, RPath, utils::kAllowNonExistant, Cpp::utils::platform::kEnvDelim, false); | ||
SplitPaths(Data + Dyn.d_un.d_val, RPath, utils::kAllowNonExistent, | ||
Cpp::utils::platform::kEnvDelim, false); | ||
break; | ||
case ELF::DT_RUNPATH: | ||
SplitPaths(Data + Dyn.d_un.d_val, RunPath, utils::kAllowNonExistant, Cpp::utils::platform::kEnvDelim, false); | ||
SplitPaths(Data + Dyn.d_un.d_val, RunPath, utils::kAllowNonExistent, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not access members of unions; use (boost::)variant instead [cppcoreguidelines-pro-type-union-access] SplitPaths(Data + Dyn.d_un.d_val, RunPath, utils::kAllowNonExistent,
^ |
||
Cpp::utils::platform::kEnvDelim, false); | ||
break; | ||
case ELF::DT_FLAGS_1: | ||
// Check if this is not a pie executable. | ||
|
@@ -757,7 +759,9 @@ | |
} | ||
else if (Command.C.cmd == MachO::LC_RPATH) { | ||
MachO::rpath_command rpathCmd = Obj->getRpathCommand(Command); | ||
SplitPaths(Command.Ptr + rpathCmd.path, RPath, utils::kAllowNonExistant, Cpp::utils::platform::kEnvDelim, false); | ||
SplitPaths(Command.Ptr + rpathCmd.path, RPath, | ||
utils::kAllowNonExistent, | ||
Cpp::utils::platform::kEnvDelim, false); | ||
} | ||
} | ||
} else if (BinObjF->isCOFF()) { | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -231,8 +231,8 @@ | |||||||||||
incpaths.push_back("-v"); | ||||||||||||
} | ||||||||||||
|
||||||||||||
void LogNonExistantDirectory(llvm::StringRef Path) { | ||||||||||||
#define DEBUG_TYPE "LogNonExistantDirectory" | ||||||||||||
void LogNonExistentDirectory(llvm::StringRef Path) { | ||||||||||||
#define DEBUG_TYPE "LogNonExistentDirectory" | ||||||||||||
LLVM_DEBUG(dbgs() << " ignoring nonexistent directory \"" << Path << "\"\n"); | ||||||||||||
#undef DEBUG_TYPE | ||||||||||||
} | ||||||||||||
|
@@ -276,27 +276,27 @@ | |||||||||||
AllExisted = AllExisted && Exists; | ||||||||||||
|
||||||||||||
if (!Exists) { | ||||||||||||
if (Mode == kFailNonExistant) { | ||||||||||||
if (Mode == kFailNonExistent) { | ||||||||||||
if (Verbose) { | ||||||||||||
// Exiting early, but still log all non-existant paths that we have | ||||||||||||
LogNonExistantDirectory(Split.first); | ||||||||||||
// Exiting early, but still log all non-existent paths that we have | ||||||||||||
LogNonExistentDirectory(Split.first); | ||||||||||||
while (!Split.second.empty()) { | ||||||||||||
Split = PathStr.split(Delim); | ||||||||||||
if (llvm::sys::fs::is_directory(Split.first)) { | ||||||||||||
LLVM_DEBUG(dbgs() << " ignoring directory that exists \"" | ||||||||||||
<< Split.first << "\"\n"); | ||||||||||||
} else | ||||||||||||
LogNonExistantDirectory(Split.first); | ||||||||||||
LogNonExistentDirectory(Split.first); | ||||||||||||
Split = Split.second.split(Delim); | ||||||||||||
} | ||||||||||||
if (!llvm::sys::fs::is_directory(Split.first)) | ||||||||||||
LogNonExistantDirectory(Split.first); | ||||||||||||
LogNonExistentDirectory(Split.first); | ||||||||||||
} | ||||||||||||
return false; | ||||||||||||
} else if (Mode == kAllowNonExistant) | ||||||||||||
} else if (Mode == kAllowNonExistent) | ||||||||||||
Paths.push_back(Split.first); | ||||||||||||
else if (Verbose) | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use 'else' after 'return' [llvm-else-after-return]
Suggested change
|
||||||||||||
LogNonExistantDirectory(Split.first); | ||||||||||||
LogNonExistentDirectory(Split.first); | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: do not use 'else' after 'return' [llvm-else-after-return]
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's probably a good warning to fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried applying this suggestion, and it broke the ci jobs (also caused another lot of review comments). Reverted. |
||||||||||||
} else | ||||||||||||
Paths.push_back(Split.first); | ||||||||||||
} | ||||||||||||
|
@@ -311,10 +311,10 @@ | |||||||||||
if (!PathStr.empty()) { | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: expected unqualified-id [clang-diagnostic-error] if (!PathStr.empty()) {
^ |
||||||||||||
if (!llvm::sys::fs::is_directory(PathStr)) { | ||||||||||||
AllExisted = false; | ||||||||||||
if (Mode == kAllowNonExistant) | ||||||||||||
if (Mode == kAllowNonExistent) | ||||||||||||
Paths.push_back(PathStr); | ||||||||||||
else if (Verbose) | ||||||||||||
LogNonExistantDirectory(PathStr); | ||||||||||||
LogNonExistentDirectory(PathStr); | ||||||||||||
} else | ||||||||||||
Paths.push_back(PathStr); | ||||||||||||
} | ||||||||||||
|
@@ -331,7 +331,7 @@ | |||||||||||
|
||||||||||||
llvm::SmallVector<llvm::StringRef, 10> Paths; | ||||||||||||
if (Delim && *Delim) | ||||||||||||
SplitPaths(PathStr, Paths, kAllowNonExistant, Delim, HOpts.Verbose); | ||||||||||||
SplitPaths(PathStr, Paths, kAllowNonExistent, Delim, HOpts.Verbose); | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: use of undeclared identifier 'kAllowNonExistent'; did you mean 'utils::kAllowNonExistent'? [clang-diagnostic-error]
Suggested change
Additional contextlib/Interpreter/Paths.h:64: 'utils::kAllowNonExistent' declared here kAllowNonExistent ///< Add all paths whether they exist or not
^ |
||||||||||||
else | ||||||||||||
Paths.push_back(PathStr); | ||||||||||||
|
||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not access members of unions; use (boost::)variant instead [cppcoreguidelines-pro-type-union-access]