LLVM: include/llvm/Support/CachePruning.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_SUPPORT_CACHEPRUNING_H

15#define LLVM_SUPPORT_CACHEPRUNING_H

16

19#include

20#include

21

22namespace llvm {

23

24template class Expected;

26

27

28

30

31

32

33

34 std::optionalstd::chrono::seconds Interval = std::chrono::seconds(1200);

35

36

37

38

39 std::chrono::seconds Expiration = std::chrono::hours(7 * 24);

40

41

42

43

44

45

47

48

49

50

52

53

54

55

56

57

58

59

60

61

63};

64

65

66

67

68

69

72

73

74

75

76

77

78

79

80

81

82

83

86 const std::vector<std::unique_ptr> &Files = {});

87}

88

89#endif

Tagged union holding either a T or a Error.

StringRef - Represent a constant reference to a string, i.e.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI Expected< CachePruningPolicy > parseCachePruningPolicy(StringRef PolicyStr)

Parse the given string as a cache pruning policy.

LLVM_ABI bool pruneCache(StringRef Path, CachePruningPolicy Policy, const std::vector< std::unique_ptr< MemoryBuffer > > &Files={})

Peform pruning using the supplied policy, returns true if pruning occurred, i.e.

Policy for the pruneCache() function.

Definition CachePruning.h:29

uint64_t MaxSizeFiles

The maximum number of files in the cache directory.

Definition CachePruning.h:62

std::optional< std::chrono::seconds > Interval

The pruning interval.

Definition CachePruning.h:34

std::chrono::seconds Expiration

The expiration for a file.

Definition CachePruning.h:39

uint64_t MaxSizeBytes

The maximum size for the cache directory in bytes.

Definition CachePruning.h:51

unsigned MaxSizePercentageOfAvailableSpace

The maximum size for the cache directory, in terms of percentage of the available space on the disk.

Definition CachePruning.h:46