From 06dde92cd6a9659c0786164688002d912fd22a32 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 2 Mar 2014 13:02:01 +0000 Subject: [PATCH] [C++11] Switch from LLVM_STATIC_ASSERT to static_assert now that we require host toolchains which support this. llvm-svn: 202640 --- .../clang/ASTMatchers/ASTMatchersInternal.h | 2 +- .../Core/PathSensitive/CallEvent.h | 16 ++++++++-------- clang/lib/Lex/PPDirectives.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index 9aeb4f9fd760..b3bb3ca75092 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -52,7 +52,7 @@ namespace clang { namespace ast_matchers { -/// TODO: Use LLVM_STATIC_ASSERT() instead of this. +/// TODO: Use static_assert instead of this. template struct CompileAssert {}; #define TOOLING_COMPILE_ASSERT(Expr, Msg) LLVM_ATTRIBUTE_UNUSED \ typedef CompileAssert<(bool(Expr))> Msg[bool(Expr) ? 1 : -1] diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h index 7eca84313769..fe1a65d47e75 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h @@ -915,23 +915,23 @@ class CallEventManager { template T *create(Arg A, ProgramStateRef St, const LocationContext *LCtx) { - LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy), - "CallEvent subclasses are not all the same size"); + static_assert(sizeof(T) == sizeof(CallEventTemplateTy), + "CallEvent subclasses are not all the same size"); return new (allocate()) T(A, St, LCtx); } template T *create(Arg1 A1, Arg2 A2, ProgramStateRef St, const LocationContext *LCtx) { - LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy), - "CallEvent subclasses are not all the same size"); + static_assert(sizeof(T) == sizeof(CallEventTemplateTy), + "CallEvent subclasses are not all the same size"); return new (allocate()) T(A1, A2, St, LCtx); } template T *create(Arg1 A1, Arg2 A2, Arg3 A3, ProgramStateRef St, const LocationContext *LCtx) { - LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy), - "CallEvent subclasses are not all the same size"); + static_assert(sizeof(T) == sizeof(CallEventTemplateTy), + "CallEvent subclasses are not all the same size"); return new (allocate()) T(A1, A2, A3, St, LCtx); } @@ -939,8 +939,8 @@ class CallEventManager { typename Arg4> T *create(Arg1 A1, Arg2 A2, Arg3 A3, Arg4 A4, ProgramStateRef St, const LocationContext *LCtx) { - LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy), - "CallEvent subclasses are not all the same size"); + static_assert(sizeof(T) == sizeof(CallEventTemplateTy), + "CallEvent subclasses are not all the same size"); return new (allocate()) T(A1, A2, A3, A4, St, LCtx); } diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 4a9e09f798ef..050ade45e443 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -60,8 +60,8 @@ MacroInfo *Preprocessor::AllocateMacroInfo(SourceLocation L) { MacroInfo *Preprocessor::AllocateDeserializedMacroInfo(SourceLocation L, unsigned SubModuleID) { - LLVM_STATIC_ASSERT(llvm::AlignOf::Alignment >= sizeof(SubModuleID), - "alignment for MacroInfo is less than the ID"); + static_assert(llvm::AlignOf::Alignment >= sizeof(SubModuleID), + "alignment for MacroInfo is less than the ID"); DeserializedMacroInfoChain *MIChain = BP.Allocate(); MIChain->Next = DeserialMIChainHead;