Skip to content

Commit 13f4263

Browse files
committed
Revert r342233.
This caused LLD test failures, which I've been unable to reproduce. Reverting to allow for further investigation next week. llvm-svn: 342244
1 parent 86497ad commit 13f4263

File tree

6 files changed

+3
-34
lines changed

6 files changed

+3
-34
lines changed

llvm/include/llvm-c/lto.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef bool lto_bool_t;
4444
* @{
4545
*/
4646

47-
#define LTO_API_VERSION 23
47+
#define LTO_API_VERSION 22
4848

4949
/**
5050
* \since prior to LTO_API_VERSION=3
@@ -827,16 +827,6 @@ extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg,
827827
extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg,
828828
unsigned max_size_bytes);
829829

830-
/**
831-
* Same as thinlto_codegen_set_cache_size_bytes, except the maximum size is in
832-
* megabytes (2^20 bytes).
833-
*
834-
* \since LTO_API_VERSION=23
835-
*/
836-
extern void
837-
thinlto_codegen_set_cache_size_megabytes(thinlto_code_gen_t cg,
838-
unsigned max_size_megabytes);
839-
840830
/**
841831
* Sets the maximum number of files in the cache directory. An unspecified
842832
* default value will be applied. A value of 0 will be ignored.

llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class ThinLTOCodeGenerator {
187187
/// Cache policy: the maximum size for the cache directory in bytes. A value
188188
/// over the amount of available space on the disk will be reduced to the
189189
/// amount of available space. A value of 0 will be ignored.
190-
void setCacheMaxSizeBytes(uint64_t MaxSizeBytes) {
190+
void setCacheMaxSizeBytes(unsigned MaxSizeBytes) {
191191
if (MaxSizeBytes)
192192
CacheOptions.Policy.MaxSizeBytes = MaxSizeBytes;
193193
}

llvm/test/ThinLTO/X86/cache.ll

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,6 @@
121121
; RUN: not ls %t.cache/llvmcache-foo-100k
122122
; RUN: not ls %t.cache/llvmcache-foo-77k
123123

124-
; Verify that specifying a max size > 4GB for the cache directory does not
125-
; prematurely prune, due to an integer overflow.
126-
; RUN: rm -Rf %t.cache && mkdir %t.cache
127-
; RUN: %python -c "with open(r'%t.cache/llvmcache-foo-10', 'w') as file: file.truncate(10)"
128-
; RUN: llvm-lto -thinlto-action=run -exported-symbol=globalfunc %t2.bc %t.bc -thinlto-cache-dir %t.cache --thinlto-cache-max-size-bytes 4294967297
129-
; RUN: ls %t.cache/llvmcache-foo-10
130-
131-
; Verify that negative numbers aren't accepted for the
132-
; --thinlto-cache-max-size-bytes switch
133-
; RUN: rm -Rf %t.cache && mkdir %t.cache
134-
; RUN: not llvm-lto %t.bc --thinlto-cache-max-size-bytes -1 2>&1 | FileCheck %s
135-
; CHECK: -thinlto-cache-max-size-bytes option: '-1' value invalid
136-
137124
; Verify that specifying max number of files in the cache directory prunes
138125
; it to this amount, removing the oldest files first.
139126
; RUN: rm -Rf %t.cache && mkdir %t.cache

llvm/tools/llvm-lto/llvm-lto.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static cl::opt<int>
158158
ThinLTOCachePruningInterval("thinlto-cache-pruning-interval",
159159
cl::init(1200), cl::desc("Set ThinLTO cache pruning interval."));
160160

161-
static cl::opt<unsigned long long>
161+
static cl::opt<int>
162162
ThinLTOCacheMaxSizeBytes("thinlto-cache-max-size-bytes",
163163
cl::desc("Set ThinLTO cache pruning directory maximum size in bytes."));
164164

llvm/tools/lto/lto.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,13 +591,6 @@ void thinlto_codegen_set_cache_size_bytes(
591591
return unwrap(cg)->setCacheMaxSizeBytes(MaxSizeBytes);
592592
}
593593

594-
void thinlto_codegen_set_cache_size_megabytes(
595-
thinlto_code_gen_t cg, unsigned MaxSizeMegabytes) {
596-
uint64_t MaxSizeBytes = MaxSizeMegabytes;
597-
MaxSizeBytes *= 1024 * 1024;
598-
return unwrap(cg)->setCacheMaxSizeBytes(MaxSizeBytes);
599-
}
600-
601594
void thinlto_codegen_set_cache_size_files(
602595
thinlto_code_gen_t cg, unsigned MaxSizeFiles) {
603596
return unwrap(cg)->setCacheMaxSizeFiles(MaxSizeFiles);

llvm/tools/lto/lto.exports

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ thinlto_codegen_set_cache_pruning_interval
5858
thinlto_codegen_set_cache_entry_expiration
5959
thinlto_codegen_set_final_cache_size_relative_to_available_space
6060
thinlto_codegen_set_cache_size_bytes
61-
thinlto_codegen_set_cache_size_megabytes
6261
thinlto_codegen_set_cache_size_files
6362
thinlto_codegen_set_savetemps_dir
6463
thinlto_codegen_set_cpu

0 commit comments

Comments
 (0)