[PATCH] D25730: Remove TimeValue usage from llvm/Support

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 12:02:53 PDT 2016


labath added inline comments.


================
Comment at: include/llvm/Object/Archive.h:25
 #include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/TimeValue.h"
 
----------------
mehdi_amini wrote:
> It seems to indicate that there as still uses of TimeValue in here?
Affirmative. llvm/Object still uses TimeValue. I am deliberately not trying to do this at once, but in smaller chunks. It was necessary to add this as Support/Filesystem.h no longer includes TimeValue.h.


================
Comment at: include/llvm/Support/CachePruning.h:64
+  std::chrono::seconds Expiration{0};
+  std::chrono::seconds Interval{0};
   unsigned PercentageOfAvailableSpace = 0;
----------------
mehdi_amini wrote:
> Why not `= 0` ?
> (http://llvm.org/docs/CodingStandards.html#do-not-use-braced-initializer-lists-to-call-a-constructor )
`= 0` will not work, as duration objects are not implicitly constructible from integer types. I'd have to write `= std::chrono::seconds(0)`. After re-reading that section it's still not clear to me whether this is a permitted usage of brace-initialization. One could argue that duration is "constructed like an aggregate" (which contains only one member) and it does not do anything fancy.


https://reviews.llvm.org/D25730





More information about the llvm-commits mailing list