summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-03-15 18:47:07 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-03-15 18:47:07 +0000
commit86c7741f68297cab233a12b44408a463f71aeee6 (patch)
treee2265b30a882da72f3c57b0bf6ce068983dc64b0 /llvm/lib
parentd6fa23e1db04c1f82499a452cdea7b550fa30366 (diff)
downloadbcm5719-llvm-86c7741f68297cab233a12b44408a463f71aeee6.tar.gz
bcm5719-llvm-86c7741f68297cab233a12b44408a463f71aeee6.zip
Make some assertions on constant expressions static.
llvm-svn: 204011
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp4
-rw-r--r--llvm/lib/IR/AsmWriter.cpp4
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp b/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
index 8459cb13789..c0a33ceaf24 100644
--- a/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp
@@ -67,7 +67,9 @@ DWARFDebugArangeSet::extract(DataExtractor data, uint32_t *offset_ptr) {
Descriptor arangeDescriptor;
- assert(sizeof(arangeDescriptor.Address) == sizeof(arangeDescriptor.Length));
+ static_assert(sizeof(arangeDescriptor.Address) ==
+ sizeof(arangeDescriptor.Length),
+ "Different datatypes for addresses and sizes!");
assert(sizeof(arangeDescriptor.Address) >= HeaderData.AddrSize);
while (data.isValidOffset(*offset_ptr)) {
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 93a59a63c89..d4670e4bc6c 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -811,8 +811,8 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
// output the string in hexadecimal format! Note that loading and storing
// floating point types changes the bits of NaNs on some hosts, notably
// x86, so we must not use these types.
- assert(sizeof(double) == sizeof(uint64_t) &&
- "assuming that double is 64 bits!");
+ static_assert(sizeof(double) == sizeof(uint64_t),
+ "assuming that double is 64 bits!");
char Buffer[40];
APFloat apf = CFP->getValueAPF();
// Halves and floats are represented in ASCII IR as double, convert.
OpenPOWER on IntegriCloud