diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
commit | 71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch) | |
tree | 5343938942df402b49ec7300a1c25a2d4ccd5821 /include/llvm/LTO/legacy/ThinLTOCodeGenerator.h | |
parent | 31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff) |
Diffstat (limited to 'include/llvm/LTO/legacy/ThinLTOCodeGenerator.h')
-rw-r--r-- | include/llvm/LTO/legacy/ThinLTOCodeGenerator.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h b/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h index 0cc3b26e9659..f9545333aabd 100644 --- a/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h +++ b/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h @@ -20,6 +20,7 @@ #include "llvm/ADT/StringSet.h" #include "llvm/ADT/Triple.h" #include "llvm/IR/ModuleSummaryIndex.h" +#include "llvm/Support/CachePruning.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Target/TargetOptions.h" @@ -140,9 +141,7 @@ public: struct CachingOptions { std::string Path; // Path to the cache, empty to disable. - int PruningInterval = 1200; // seconds, -1 to disable pruning. - unsigned int Expiration = 7 * 24 * 3600; // seconds (1w default). - unsigned MaxPercentageOfAvailableSpace = 75; // percentage. + CachePruningPolicy Policy; }; /// Provide a path to a directory where to store the cached files for @@ -153,14 +152,14 @@ public: /// negative value (default) to disable pruning. A value of 0 will be ignored. void setCachePruningInterval(int Interval) { if (Interval) - CacheOptions.PruningInterval = Interval; + CacheOptions.Policy.Interval = std::chrono::seconds(Interval); } /// Cache policy: expiration (in seconds) for an entry. /// A value of 0 will be ignored. void setCacheEntryExpiration(unsigned Expiration) { if (Expiration) - CacheOptions.Expiration = Expiration; + CacheOptions.Policy.Expiration = std::chrono::seconds(Expiration); } /** @@ -178,7 +177,7 @@ public: */ void setMaxCacheSizeRelativeToAvailableSpace(unsigned Percentage) { if (Percentage) - CacheOptions.MaxPercentageOfAvailableSpace = Percentage; + CacheOptions.Policy.PercentageOfAvailableSpace = Percentage; } /**@}*/ @@ -206,6 +205,10 @@ public: TMBuilder.Options = std::move(Options); } + /// Enable the Freestanding mode: indicate that the optimizer should not + /// assume builtins are present on the target. + void setFreestanding(bool Enabled) { Freestanding = Enabled; } + /// CodeModel void setCodePICModel(Optional<Reloc::Model> Model) { TMBuilder.RelocModel = Model; @@ -323,6 +326,10 @@ private: /// importing or optimization. bool CodeGenOnly = false; + /// Flag to indicate that the optimizer should not assume builtins are present + /// on the target. + bool Freestanding = false; + /// IR Optimization Level [0-3]. unsigned OptLevel = 3; }; |