summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Chrono.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* s/LLVM_ON_WIN32/_WIN32/, llvmNico Weber2018-04-291-1/+1
| | | | | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. This moves over all uses of the macro, but doesn't remove the definition of it in (llvm-)config.h yet. llvm-svn: 331127
* [Support][Chrono] Use explicit cast of text output of time values.Simon Dardis2017-11-061-3/+3
| | | | | | | | | | | | | | | | | | rL316419 exposed a platform specific issue where the type of the values passed to llvm::format could be different to the format string. Debian unstable for mips uses long long int for std::chrono:duration, while x86_64 uses long int. For mips, this resulted in the value being corrupted when rendered to a string. Address this by explicitly casting the result of the duration_cast to the type specified in the format string. Reviewers: sammccall Differential Revision: https://reviews.llvm.org/D39597 llvm-svn: 317523
* Support formatv of TimePoint with strftime-style formats.Sam McCall2017-10-241-0/+40
| | | | | | | | | | | | | | | | Summary: Support formatv of TimePoint with strftime-style formats. Extensions for millis/micros/nanos are added. Inital use case is HH:MM:SS.MMM timestamps in clangd logs. Reviewers: bkramer, ilya-biryukov Subscribers: labath, llvm-commits Differential Revision: https://reviews.llvm.org/D38992 llvm-svn: 316419
* Make naming in Host.h in line with coding standards.Kristof Beyls2017-03-311-6/+6
| | | | | | | Based on post-commit review comments by Chandler Carruth on https://reviews.llvm.org/D31236. Thanks! llvm-svn: 299211
* Revert "Make naming in Host.h in line with coding standards."Kristof Beyls2017-03-301-6/+6
| | | | | | | | | | | | | | | | | | | This reverts r299062, which caused build failures on Windows. It also reverts the attempts to fix the windows builds in r299064 and r299065. The introduction of namespace llvm::sys::detail makes MSVC, and seemingly also mingw, complain about ambiguity with the existing namespace llvm::detail. E.g.: C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/MathExtras.h(184): error C2872: 'detail': ambiguous symbol C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/PointerLikeTypeTraits.h(31): note: could be 'llvm::detail' C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/Host.h(80): note: or 'llvm::sys::detail' In r299064 and r299065 I tried to fix these ambiguities, based on the errors reported in the log files. It seems however that the build stops early when this kind of error is encountered, and many build-then-fix-iterations on Windows may be needed to fix this. Therefore reverting r299062 for now to get the build working again on Windows. llvm-svn: 299066
* Make naming in Host.h in line with coding standards.Kristof Beyls2017-03-301-6/+6
| | | | | | | Based on post-commit review comments by Chandler Carruth on https://reviews.llvm.org/D31236. Thanks! llvm-svn: 299062
* Attempt to fix MSVC build broken by r294326Pavel Labath2017-02-071-6/+6
| | | | | | MSVC does not think that `char []` can be constexpr. Switch to regular const. llvm-svn: 294327
* [Support] Add FormatVariadic support for chrono typesPavel Labath2017-02-071-0/+7
| | | | | | | | | | | | | | | | Summary: The formatter has three knobs: - the user can choose which time unit to use for formatting (default: whatever is the unit of the input) - he can choose whether the unit gets displayed (default: yes) - he can affect the way the number itself is formatted via standard number formatting options (default:default) Reviewers: zturner, inglorion Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29481 llvm-svn: 294326
* Reapply "Add Chrono.h - std::chrono support header"Pavel Labath2016-10-201-0/+47
| | | | | | | | | This is a resubmission of r284590. The mingw build should be fixed now. The problem was we were matching time_t with _localtime_64s, which was incorrect on _USE_32BIT_TIME_T systems. Instead I use localtime_s, which should always evaluate to the correct function. llvm-svn: 284720
* Revert "Add Chrono.h - std::chrono support header"Pavel Labath2016-10-191-47/+0
| | | | | | | | | This reverts commit r284590 as it fails on the mingw buildbot. I think I know the fix, but I cannot test it right now. Will reapply when I verify it works ok. This reverts r284590. llvm-svn: 284615
* Add Chrono.h - std::chrono support headerPavel Labath2016-10-191-0/+47
Summary: std::chrono mostly covers the functionality of llvm::sys::TimeValue and lldb_private::TimeValue. This header adds a bit of utility functions and typedefs, which make the usage of the library and porting code from TimeValues easier. Rationale: - TimePoint typedef - precision of system_clock is implementation defined - using a well-defined precision helps maintain consistency between platforms, makes it interact better with existing TimeValue classes, and avoids cases there a time point is implicitly convertible to a specific precision on some platforms but not on others. - system_clock::to_time_t only accepts time_points with the default system precision (even though time_t has only second precision on all platforms we support). To avoid the need for explicit casts, I have added a toTimeT() wrapper function. toTimePoint(time_t) was not strictly necessary, but I have added it for symmetry. Reviewers: zturner, mehdi_amini Subscribers: beanz, mgorny, llvm-commits, modocache Differential Revision: https://reviews.llvm.org/D25416 llvm-svn: 284590
OpenPOWER on IntegriCloud