r284667 - Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 19 16:39:55 PDT 2016
Author: rnk
Date: Wed Oct 19 18:39:55 2016
New Revision: 284667
URL: http://llvm.org/viewvc/llvm-project?rev=284667&view=rev
Log:
Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it
Modified:
cfe/trunk/include/clang/AST/Attr.h
cfe/trunk/include/clang/AST/Stmt.h
cfe/trunk/include/clang/Format/Format.h
cfe/trunk/include/clang/Lex/PreprocessingRecord.h
cfe/trunk/include/clang/Lex/Preprocessor.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/include/clang/Sema/SemaInternal.h
cfe/trunk/lib/Format/Format.cpp
cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp
cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
Modified: cfe/trunk/include/clang/AST/Attr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Attr.h?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Attr.h (original)
+++ cfe/trunk/include/clang/AST/Attr.h Wed Oct 19 18:39:55 2016
@@ -55,21 +55,20 @@ protected:
unsigned IsLateParsed : 1;
unsigned DuplicatesAllowed : 1;
- void *operator new(size_t bytes) LLVM_NOEXCEPT {
+ void *operator new(size_t bytes) noexcept {
llvm_unreachable("Attrs cannot be allocated with regular 'new'.");
}
- void operator delete(void *data) LLVM_NOEXCEPT {
+ void operator delete(void *data) noexcept {
llvm_unreachable("Attrs cannot be released with regular 'delete'.");
}
public:
// Forward so that the regular new and delete do not hide global ones.
void *operator new(size_t Bytes, ASTContext &C,
- size_t Alignment = 8) LLVM_NOEXCEPT {
+ size_t Alignment = 8) noexcept {
return ::operator new(Bytes, C, Alignment);
}
- void operator delete(void *Ptr, ASTContext &C,
- size_t Alignment) LLVM_NOEXCEPT {
+ void operator delete(void *Ptr, ASTContext &C, size_t Alignment) noexcept {
return ::operator delete(Ptr, C, Alignment);
}
Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed Oct 19 18:39:55 2016
@@ -71,10 +71,10 @@ public:
// Make vanilla 'new' and 'delete' illegal for Stmts.
protected:
- void *operator new(size_t bytes) LLVM_NOEXCEPT {
+ void *operator new(size_t bytes) noexcept {
llvm_unreachable("Stmts cannot be allocated with regular 'new'.");
}
- void operator delete(void *data) LLVM_NOEXCEPT {
+ void operator delete(void *data) noexcept {
llvm_unreachable("Stmts cannot be released with regular 'delete'.");
}
@@ -284,12 +284,12 @@ public:
return operator new(bytes, *C, alignment);
}
- void *operator new(size_t bytes, void *mem) LLVM_NOEXCEPT { return mem; }
+ void *operator new(size_t bytes, void *mem) noexcept { return mem; }
- void operator delete(void *, const ASTContext &, unsigned) LLVM_NOEXCEPT {}
- void operator delete(void *, const ASTContext *, unsigned) LLVM_NOEXCEPT {}
- void operator delete(void *, size_t) LLVM_NOEXCEPT {}
- void operator delete(void *, void *) LLVM_NOEXCEPT {}
+ void operator delete(void *, const ASTContext &, unsigned) noexcept {}
+ void operator delete(void *, const ASTContext *, unsigned) noexcept {}
+ void operator delete(void *, size_t) noexcept {}
+ void operator delete(void *, void *) noexcept {}
public:
/// \brief A placeholder type used to construct an empty shell of a
Modified: cfe/trunk/include/clang/Format/Format.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/include/clang/Format/Format.h (original)
+++ cfe/trunk/include/clang/Format/Format.h Wed Oct 19 18:39:55 2016
@@ -35,7 +35,7 @@ namespace format {
enum class ParseError { Success = 0, Error, Unsuitable };
class ParseErrorCategory final : public std::error_category {
public:
- const char *name() const LLVM_NOEXCEPT override;
+ const char *name() const noexcept override;
std::string message(int EV) const override;
};
const std::error_category &getParseCategory();
Modified: cfe/trunk/include/clang/Lex/PreprocessingRecord.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/PreprocessingRecord.h?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/PreprocessingRecord.h (original)
+++ cfe/trunk/include/clang/Lex/PreprocessingRecord.h Wed Oct 19 18:39:55 2016
@@ -32,11 +32,11 @@ namespace clang {
/// \brief Allocates memory within a Clang preprocessing record.
void *operator new(size_t bytes, clang::PreprocessingRecord &PR,
- unsigned alignment = 8) LLVM_NOEXCEPT;
+ unsigned alignment = 8) noexcept;
/// \brief Frees memory allocated in a Clang preprocessing record.
void operator delete(void *ptr, clang::PreprocessingRecord &PR,
- unsigned) LLVM_NOEXCEPT;
+ unsigned) noexcept;
namespace clang {
class MacroDefinitionRecord;
@@ -98,24 +98,24 @@ namespace clang {
// Only allow allocation of preprocessed entities using the allocator
// in PreprocessingRecord or by doing a placement new.
void *operator new(size_t bytes, PreprocessingRecord &PR,
- unsigned alignment = 8) LLVM_NOEXCEPT {
+ unsigned alignment = 8) noexcept {
return ::operator new(bytes, PR, alignment);
}
- void *operator new(size_t bytes, void *mem) LLVM_NOEXCEPT { return mem; }
+ void *operator new(size_t bytes, void *mem) noexcept { return mem; }
void operator delete(void *ptr, PreprocessingRecord &PR,
- unsigned alignment) LLVM_NOEXCEPT {
+ unsigned alignment) noexcept {
return ::operator delete(ptr, PR, alignment);
}
- void operator delete(void *, std::size_t) LLVM_NOEXCEPT {}
- void operator delete(void *, void *) LLVM_NOEXCEPT {}
+ void operator delete(void *, std::size_t) noexcept {}
+ void operator delete(void *, void *) noexcept {}
private:
// Make vanilla 'new' and 'delete' illegal for preprocessed entities.
- void *operator new(size_t bytes) LLVM_NOEXCEPT;
- void operator delete(void *data) LLVM_NOEXCEPT;
+ void *operator new(size_t bytes) noexcept;
+ void operator delete(void *data) noexcept;
};
/// \brief Records the presence of a preprocessor directive.
@@ -523,12 +523,12 @@ namespace clang {
} // end namespace clang
inline void *operator new(size_t bytes, clang::PreprocessingRecord &PR,
- unsigned alignment) LLVM_NOEXCEPT {
+ unsigned alignment) noexcept {
return PR.Allocate(bytes, alignment);
}
inline void operator delete(void *ptr, clang::PreprocessingRecord &PR,
- unsigned) LLVM_NOEXCEPT {
+ unsigned) noexcept {
PR.Deallocate(ptr);
}
Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Wed Oct 19 18:39:55 2016
@@ -424,10 +424,10 @@ class Preprocessor : public RefCountedBa
public:
MacroState() : MacroState(nullptr) {}
MacroState(MacroDirective *MD) : State(MD) {}
- MacroState(MacroState &&O) LLVM_NOEXCEPT : State(O.State) {
+ MacroState(MacroState &&O) noexcept : State(O.State) {
O.State = (MacroDirective *)nullptr;
}
- MacroState &operator=(MacroState &&O) LLVM_NOEXCEPT {
+ MacroState &operator=(MacroState &&O) noexcept {
auto S = O.State;
O.State = (MacroDirective *)nullptr;
State = S;
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Wed Oct 19 18:39:55 2016
@@ -2867,8 +2867,8 @@ private:
TypoDiagnosticGenerator DiagHandler;
TypoRecoveryCallback RecoveryHandler;
TypoExprState();
- TypoExprState(TypoExprState&& other) LLVM_NOEXCEPT;
- TypoExprState& operator=(TypoExprState&& other) LLVM_NOEXCEPT;
+ TypoExprState(TypoExprState &&other) noexcept;
+ TypoExprState &operator=(TypoExprState &&other) noexcept;
};
/// \brief The set of unhandled TypoExprs and their associated state.
Modified: cfe/trunk/include/clang/Sema/SemaInternal.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/SemaInternal.h?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/SemaInternal.h (original)
+++ cfe/trunk/include/clang/Sema/SemaInternal.h Wed Oct 19 18:39:55 2016
@@ -333,12 +333,12 @@ private:
inline Sema::TypoExprState::TypoExprState() {}
-inline Sema::TypoExprState::TypoExprState(TypoExprState &&other) LLVM_NOEXCEPT {
+inline Sema::TypoExprState::TypoExprState(TypoExprState &&other) noexcept {
*this = std::move(other);
}
-inline Sema::TypoExprState &Sema::TypoExprState::operator=(
- Sema::TypoExprState &&other) LLVM_NOEXCEPT {
+inline Sema::TypoExprState &Sema::TypoExprState::
+operator=(Sema::TypoExprState &&other) noexcept {
Consumer = std::move(other.Consumer);
DiagHandler = std::move(other.DiagHandler);
RecoveryHandler = std::move(other.RecoveryHandler);
Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Wed Oct 19 18:39:55 2016
@@ -420,7 +420,7 @@ std::error_code make_error_code(ParseErr
return std::error_code(static_cast<int>(e), getParseCategory());
}
-const char *ParseErrorCategory::name() const LLVM_NOEXCEPT {
+const char *ParseErrorCategory::name() const noexcept {
return "clang-format.parse_error";
}
Modified: cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp (original)
+++ cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp Wed Oct 19 18:39:55 2016
@@ -250,7 +250,7 @@ SerializedDiagnosticReader::readDiagnost
namespace {
class SDErrorCategoryType final : public std::error_category {
- const char *name() const LLVM_NOEXCEPT override {
+ const char *name() const noexcept override {
return "clang.serialized_diags";
}
std::string message(int IE) const override {
Modified: cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp?rev=284667&r1=284666&r2=284667&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Wed Oct 19 18:39:55 2016
@@ -929,8 +929,7 @@ struct DiagText {
};
struct SelectPiece : Piece {
SelectPiece() {}
- SelectPiece(SelectPiece &&O) LLVM_NOEXCEPT : Options(std::move(O.Options)) {
- }
+ SelectPiece(SelectPiece &&O) noexcept : Options(std::move(O.Options)) {}
std::vector<DiagText> Options;
void print(std::vector<std::string> &RST) override;
};
@@ -938,7 +937,7 @@ struct DiagText {
std::vector<std::unique_ptr<Piece>> Pieces;
DiagText();
- DiagText(DiagText &&O) LLVM_NOEXCEPT : Pieces(std::move(O.Pieces)) {}
+ DiagText(DiagText &&O) noexcept : Pieces(std::move(O.Pieces)) {}
DiagText(StringRef Text);
DiagText(StringRef Kind, StringRef Text);
More information about the cfe-commits
mailing list