diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-10-12 17:56:40 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-10-12 17:56:40 +0000 |
| commit | 7000ca3f55b87a26883f3aca4855c93ada74b749 (patch) | |
| tree | e4f8ff5faa90958897599a7a82fbe63f812b8ff8 /llvm/lib/Support | |
| parent | 5ca10d0edbf387b605bd7358152b42b66d133863 (diff) | |
| download | bcm5719-llvm-7000ca3f55b87a26883f3aca4855c93ada74b749.tar.gz bcm5719-llvm-7000ca3f55b87a26883f3aca4855c93ada74b749.zip | |
Modernize old-style static asserts. NFC.
llvm-svn: 219588
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/APFloat.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Support/APInt.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index 3063a07f9ff..57fbe897fc8 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -35,8 +35,7 @@ using namespace llvm; /* Assumed in hexadecimal significand parsing, and conversion to hexadecimal strings. */ -#define COMPILE_TIME_ASSERT(cond) extern int CTAssert[(cond) ? 1 : -1] -COMPILE_TIME_ASSERT(integerPartWidth % 4 == 0); +static_assert(integerPartWidth % 4 == 0, "Part width must be divisible by 4!"); namespace llvm { diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 8973f02d80b..02778b2fc7c 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -2288,8 +2288,7 @@ void APInt::print(raw_ostream &OS, bool isSigned) const { // Assumed by lowHalf, highHalf, partMSB and partLSB. A fairly safe // and unrestricting assumption. -#define COMPILE_TIME_ASSERT(cond) extern int CTAssert[(cond) ? 1 : -1] -COMPILE_TIME_ASSERT(integerPartWidth % 2 == 0); +static_assert(integerPartWidth % 2 == 0, "Part width must be divisible by 2!"); /* Some handy functions local to this file. */ namespace { |

