diff options
| author | Alp Toker <alp@nuanti.com> | 2014-01-27 04:07:17 +0000 |
|---|---|---|
| committer | Alp Toker <alp@nuanti.com> | 2014-01-27 04:07:17 +0000 |
| commit | 042f41b0476c02a76e268bf049ad29dd2543188f (patch) | |
| tree | f9041367ab15a8a1e957f10ac2fe8709c53eb455 /llvm/lib/Support/Windows/Windows.h | |
| parent | 054234faa8f026aac12b8a192d6464a485f3bc6a (diff) | |
| download | bcm5719-llvm-042f41b0476c02a76e268bf049ad29dd2543188f.tar.gz bcm5719-llvm-042f41b0476c02a76e268bf049ad29dd2543188f.zip | |
StringRef: Extend constexpr capabilities and introduce ConstStringRef
(1) Add llvm_expect(), an asserting macro that can be evaluated as a constexpr
expression as well as a runtime assert or compiler hint in release builds. This
technique can be used to construct functions that are both unevaluated and
compiled depending on usage.
(2) Update StringRef using llvm_expect() to preserve runtime assertions while
extending the same checks to static asserts in C++11 builds that support the
feature.
(3) Introduce ConstStringRef, a strong subclass of StringRef that references
compile-time constant strings. It's convertible to, but not from, ordinary
StringRef and thus can be used to add compile-time safety to various interfaces
in LLVM and clang that only accept fixed inputs such as diagnostic format
strings that tend to get misused.
llvm-svn: 200187
Diffstat (limited to 'llvm/lib/Support/Windows/Windows.h')
0 files changed, 0 insertions, 0 deletions

