-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Serialization] Remove an unused local variable (NFC) #141358
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
[Serialization] Remove an unused local variable (NFC) #141358
Conversation
Note that getTimestampFilename just constructs a file name, so it's mostly a "pure" function except possible heap allocation.
|
@llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) ChangesNote that getTimestampFilename just constructs a file name, so it's Full diff: https://github.com/llvm/llvm-project/pull/141358.diff 1 Files Affected:
diff --git a/clang/lib/Serialization/ModuleCache.cpp b/clang/lib/Serialization/ModuleCache.cpp
index 4ae49c4ec9a05..f42bdc16d815d 100644
--- a/clang/lib/Serialization/ModuleCache.cpp
+++ b/clang/lib/Serialization/ModuleCache.cpp
@@ -34,8 +34,6 @@ class CrossProcessModuleCache : public ModuleCache {
}
std::time_t getModuleTimestamp(StringRef ModuleFilename) override {
- std::string TimestampFilename =
- serialization::ModuleFile::getTimestampFilename(ModuleFilename);
llvm::sys::fs::file_status Status;
if (llvm::sys::fs::status(ModuleFilename, Status) != std::error_code{})
return 0;
|
|
@llvm/pr-subscribers-clang-modules Author: Kazu Hirata (kazutakahirata) ChangesNote that getTimestampFilename just constructs a file name, so it's Full diff: https://github.com/llvm/llvm-project/pull/141358.diff 1 Files Affected:
diff --git a/clang/lib/Serialization/ModuleCache.cpp b/clang/lib/Serialization/ModuleCache.cpp
index 4ae49c4ec9a05..f42bdc16d815d 100644
--- a/clang/lib/Serialization/ModuleCache.cpp
+++ b/clang/lib/Serialization/ModuleCache.cpp
@@ -34,8 +34,6 @@ class CrossProcessModuleCache : public ModuleCache {
}
std::time_t getModuleTimestamp(StringRef ModuleFilename) override {
- std::string TimestampFilename =
- serialization::ModuleFile::getTimestampFilename(ModuleFilename);
llvm::sys::fs::file_status Status;
if (llvm::sys::fs::status(ModuleFilename, Status) != std::error_code{})
return 0;
|
The llvm#137363 PR was supposed to be NFC, but accidentally passed the wrong path to `sys::fs::status`. Then, llvm#141358 removed the correct path that was flagged by the compiler as unused. None of our existing regression tests caught this. We only find out due to a SourceKit-LSP benchmark getting slower. This PR re-implements the original behavior, add new remark to Clang for PCM input file validation, and uses it to create more reliable tests of the `-fmodules-validate-once-per-build-session` flag.
…2965) #137363 was supposed to be NFC for the `CrossProcessModuleCache` (a.k.a normal implicit module builds), but accidentally passed the wrong path to `sys::fs::status`. Then, #141358 removed the correct path that should've been passed instead. (The variable was flagged as unused.) None of our existing tests caught this regression, we only found out due to a SourceKit-LSP benchmark getting slower. This PR re-implements the original behavior, adds new remark to Clang for PCM input file validation, and uses it to create more reliable tests of the `-fmodules-validate-once-per-build-session` flag.
…m#162965) llvm#137363 was supposed to be NFC for the `CrossProcessModuleCache` (a.k.a normal implicit module builds), but accidentally passed the wrong path to `sys::fs::status`. Then, llvm#141358 removed the correct path that should've been passed instead. (The variable was flagged as unused.) None of our existing tests caught this regression, we only found out due to a SourceKit-LSP benchmark getting slower. This PR re-implements the original behavior, adds new remark to Clang for PCM input file validation, and uses it to create more reliable tests of the `-fmodules-validate-once-per-build-session` flag. (cherry picked from commit ce8abef)
…m#162965) llvm#137363 was supposed to be NFC for the `CrossProcessModuleCache` (a.k.a normal implicit module builds), but accidentally passed the wrong path to `sys::fs::status`. Then, llvm#141358 removed the correct path that should've been passed instead. (The variable was flagged as unused.) None of our existing tests caught this regression, we only found out due to a SourceKit-LSP benchmark getting slower. This PR re-implements the original behavior, adds new remark to Clang for PCM input file validation, and uses it to create more reliable tests of the `-fmodules-validate-once-per-build-session` flag.
…m#162965) llvm#137363 was supposed to be NFC for the `CrossProcessModuleCache` (a.k.a normal implicit module builds), but accidentally passed the wrong path to `sys::fs::status`. Then, llvm#141358 removed the correct path that should've been passed instead. (The variable was flagged as unused.) None of our existing tests caught this regression, we only found out due to a SourceKit-LSP benchmark getting slower. This PR re-implements the original behavior, adds new remark to Clang for PCM input file validation, and uses it to create more reliable tests of the `-fmodules-validate-once-per-build-session` flag. (cherry picked from commit ce8abef)
Note that getTimestampFilename just constructs a file name, so it's
mostly a "pure" function except possible heap allocation.