[PATCH] D41279: [ThinLTO][C-API] Correct api comments
ben via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 15 03:36:22 PST 2017
bd1976llvm created this revision.
bd1976llvm added reviewers: mehdi_amini, tejohnson, pcc.
Herald added a reviewer: deadalnix.
Herald added subscribers: eraman, inglorion.
Negative values never disabled the pruning - they simply set high values for the pruning interval.
Once https://reviews.llvm.org/D41231 lands the behaviour will be that negative values set the maximum pruning interval (which appears to have been the intention from the start).
I have adjusted the comments to reflect this, removed any inaccurate statements, and corrected any typos I spotted in the English.
https://reviews.llvm.org/D41279
Files:
include/llvm-c/lto.h
include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
Index: include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
===================================================================
--- include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
+++ include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
@@ -148,8 +148,9 @@
/// incremental build.
void setCacheDir(std::string Path) { CacheOptions.Path = std::move(Path); }
- /// Cache policy: interval (seconds) between two prune of the cache. Set to a
- /// negative value (default) to disable pruning. A value of 0 will be ignored.
+ /// Cache policy: interval (seconds) between two prunes of the cache. A
+ /// negative value sets the maximum possible pruning interval. A value
+ /// of 0 will be ignored.
void setCachePruningInterval(int Interval) {
if (Interval)
CacheOptions.Policy.Interval = std::chrono::seconds(Interval);
Index: include/llvm-c/lto.h
===================================================================
--- include/llvm-c/lto.h
+++ include/llvm-c/lto.h
@@ -757,17 +757,16 @@
* @ingroup LLVMCTLTO
*
* These entry points control the ThinLTO cache. The cache is intended to
- * support incremental build, and thus needs to be persistent accross build.
- * The client enabled the cache by supplying a path to an existing directory.
+ * support incremental builds, and thus needs to be persistent across builds.
+ * The client enables the cache by supplying a path to an existing directory.
* The code generator will use this to store objects files that may be reused
* during a subsequent build.
* To avoid filling the disk space, a few knobs are provided:
- * - The pruning interval limit the frequency at which the garbage collector
- * will try to scan the cache directory to prune it from expired entries.
- * Setting to -1 disable the pruning (default).
+ * - The pruning interval limits the frequency at which the garbage collector
+ * will try to scan the cache directory to prune expired entries.
* - The pruning expiration time indicates to the garbage collector how old an
* entry needs to be to be removed.
- * - Finally, the garbage collector can be instructed to prune the cache till
+ * - Finally, the garbage collector can be instructed to prune the cache until
* the occupied space goes below a threshold.
* @{
*/
@@ -782,9 +781,9 @@
const char *cache_dir);
/**
- * Sets the cache pruning interval (in seconds). A negative value disable the
- * pruning. An unspecified default value will be applied, and a value of 0 will
- * be ignored.
+ * Sets the cache pruning interval (in seconds). A negative value sets the
+ * maximum possible pruning interval. An unspecified default value will be
+ * applied, and a value of 0 will be ignored.
*
* \since LTO_API_VERSION=18
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41279.127091.patch
Type: text/x-patch
Size: 2798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171215/0f1e3ed5/attachment.bin>
More information about the llvm-commits
mailing list