mbed-os/platform
Kevin Bracey 07d43b72d2 Add mstd::is_constant_evaluated
GCC 9 and sufficiently-new Clang (including ARM Compiler 6.13) give us
access to the C++20 (draft) `is_constant_evaluated` test. Allows us to
restrict code to compile-time only.

This is particularly useful when using assembler intrinsics, which the
compiler cannot optimise or compile-time evaluate. It allows us to write
something like

    constexpr uint32_t reverse_bits(uint32_t x)
    {
        if (is_constant_evaluated(x)) {
            // C code to do calculation here
            return x;
        } else {
            // an assembler intrinsic that cannot be optimised
            return __RBIT(x);
        }
    }

This can then be totally compile-time given a constant input.

(In this example, ultimately it would be a good idea to include this
functionality in CMSIS's GCC `__RBIT`, which needs it because GCC
requires use of assembler. Clang implements `__RBIT` as a built-in,
meaning it can already compute it at compile-time, so does not benefit.).
2020-01-08 13:36:17 +02:00
..
bare_metal Addressed review comments, in particular: 2019-08-01 12:42:24 +01:00
cxxsupport Add mstd::is_constant_evaluated 2020-01-08 13:36:17 +02:00
internal Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
source Merge pull request #12068 from rajkan01/feature_bare_metal 2020-01-03 11:35:48 +00:00
ATCmdParser.h busy s... fix (ONME-4352) 2019-12-12 09:36:34 +02:00
CThunk.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
CallChain.h Upstream PR #11073 review request changes (#11135) 2019-08-02 12:32:40 +01:00
Callback.h Remove deprecated Callback methods 2019-12-02 15:27:10 +02:00
CircularBuffer.h namespace and extern C don't need semicolon 2019-12-26 16:08:22 -06:00
CriticalSectionLock.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
DeepSleepLock.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
DirHandle.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
FileBase.h Change Doxygen groups structure, splitting first by Public/Internal (#11105) 2019-08-02 12:23:47 +01:00
FileHandle.h Change Doxygen groups structure, splitting first by Public/Internal (#11105) 2019-08-02 12:23:47 +01:00
FileLike.h Change Doxygen groups structure, splitting first by Public/Internal (#11105) 2019-08-02 12:23:47 +01:00
FilePath.h Change Doxygen groups structure, splitting first by Public/Internal (#11105) 2019-08-02 12:23:47 +01:00
FileSystemHandle.h Change Doxygen groups structure, splitting first by Public/Internal (#11105) 2019-08-02 12:23:47 +01:00
FileSystemLike.h Change Doxygen groups structure, splitting first by Public/Internal (#11105) 2019-08-02 12:23:47 +01:00
LocalFileSystem.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
NonCopyable.h Fix Coverity issue: Initialize FlashIAP non-static member in constructor 2019-09-17 09:55:37 +01:00
PlatformMutex.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
ScopedLock.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
ScopedRamExecutionLock.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
ScopedRomWriteLock.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
SharedPtr.h SharedPtr: add nullptr constructor 2019-12-09 11:37:06 +02:00
SingletonPtr.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
Span.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
Stream.h mbed_retarget: Add a minimal console implementation to provide basic functionalities 2019-11-11 15:14:00 +00:00
Transaction.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
critical.h Renamed files in platform to match source names 2017-02-22 18:17:54 -06:00
mbed_application.h Add bootloader support for the LPC55S69 board 2019-03-16 00:13:40 +02:00
mbed_assert.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_atomic.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_critical.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_debug.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_error.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_interface.h Avoid crashes during fault handler 2019-11-28 15:03:26 +02:00
mbed_lib.json UnbufferedSerial: Introduce the class to replace RawSerial 2019-12-12 08:44:09 +00:00
mbed_mem_trace.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_mktime.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_mpu_mgmt.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_poll.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_power_mgmt.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_preprocessor.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_retarget.h namespace and extern C don't need semicolon 2019-12-26 16:08:22 -06:00
mbed_rtc_time.h mbed_rtc_time.h lacks an include guard 2019-10-09 17:58:23 -05:00
mbed_semihost_api.h Platform: Separate internal APIs from public APIs 2019-08-02 12:23:47 +01:00
mbed_sleep.h Fix merge conflict mishap 2018-03-01 17:33:21 +00:00
mbed_stats.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_thread.h Move source files and add Doxygen labels 2019-09-10 14:31:24 +01:00
mbed_toolchain.h Add MBED_FALLTHROUGH attribute 2019-12-05 12:08:26 +02:00
mbed_version.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
mbed_wait_api.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
platform.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
rtc_time.h Renamed files in platform to match source names 2017-02-22 18:17:54 -06:00
semihost_api.h Renamed files in platform to match source names 2017-02-22 18:17:54 -06:00
sleep.h Add system_reset() function to Mbed OS 2018-02-28 16:42:34 +00:00
toolchain.h Harmonise Doxygen comments in drivers, events, platform and rtos dirs 2019-09-09 10:59:51 +01:00
wait_api.h Renamed files in platform to match source names 2017-02-22 18:17:54 -06:00