Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 5b1c9f3

Browse files
committed
Remove LLVM_NOEXCEPT and replace it with noexcept
Now that we have dropped MSVC 2013, all supported compilers support noexcept and we can drop this portability macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284672 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 04e3307 commit 5b1c9f3

File tree

19 files changed

+26
-33
lines changed

19 files changed

+26
-33
lines changed

include/llvm/MC/MCContext.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ namespace llvm {
578578
/// allocator supports it).
579579
/// \return The allocated memory. Could be NULL.
580580
inline void *operator new(size_t Bytes, llvm::MCContext &C,
581-
size_t Alignment = 8) LLVM_NOEXCEPT {
581+
size_t Alignment = 8) noexcept {
582582
return C.allocate(Bytes, Alignment);
583583
}
584584
/// \brief Placement delete companion to the new above.
@@ -587,8 +587,7 @@ inline void *operator new(size_t Bytes, llvm::MCContext &C,
587587
/// invoking it directly; see the new operator for more details. This operator
588588
/// is called implicitly by the compiler if a placement new expression using
589589
/// the MCContext throws in the object constructor.
590-
inline void operator delete(void *Ptr, llvm::MCContext &C,
591-
size_t) LLVM_NOEXCEPT {
590+
inline void operator delete(void *Ptr, llvm::MCContext &C, size_t) noexcept {
592591
C.deallocate(Ptr);
593592
}
594593

@@ -612,7 +611,7 @@ inline void operator delete(void *Ptr, llvm::MCContext &C,
612611
/// allocator supports it).
613612
/// \return The allocated memory. Could be NULL.
614613
inline void *operator new[](size_t Bytes, llvm::MCContext &C,
615-
size_t Alignment = 8) LLVM_NOEXCEPT {
614+
size_t Alignment = 8) noexcept {
616615
return C.allocate(Bytes, Alignment);
617616
}
618617

@@ -622,7 +621,7 @@ inline void *operator new[](size_t Bytes, llvm::MCContext &C,
622621
/// invoking it directly; see the new[] operator for more details. This operator
623622
/// is called implicitly by the compiler if a placement new[] expression using
624623
/// the MCContext throws in the object constructor.
625-
inline void operator delete[](void *Ptr, llvm::MCContext &C) LLVM_NOEXCEPT {
624+
inline void operator delete[](void *Ptr, llvm::MCContext &C) noexcept {
626625
C.deallocate(Ptr);
627626
}
628627

include/llvm/Support/Compiler.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@
7373
#define LLVM_MSC_PREREQ(version) 0
7474
#endif
7575

76-
#if !defined(_MSC_VER) || defined(__clang__) || LLVM_MSC_PREREQ(1900)
77-
#define LLVM_NOEXCEPT noexcept
78-
#else
79-
#define LLVM_NOEXCEPT throw()
80-
#endif
81-
8276
/// \brief Does the compiler support ref-qualifiers for *this?
8377
///
8478
/// Sadly, this is separate from just rvalue reference support because GCC

include/llvm/Support/YAMLParser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,20 @@ class Node {
144144
unsigned int getType() const { return TypeID; }
145145

146146
void *operator new(size_t Size, BumpPtrAllocator &Alloc,
147-
size_t Alignment = 16) LLVM_NOEXCEPT {
147+
size_t Alignment = 16) noexcept {
148148
return Alloc.Allocate(Size, Alignment);
149149
}
150150

151151
void operator delete(void *Ptr, BumpPtrAllocator &Alloc,
152-
size_t Size) LLVM_NOEXCEPT {
152+
size_t Size) noexcept {
153153
Alloc.Deallocate(Ptr, Size);
154154
}
155155

156156
protected:
157157
std::unique_ptr<Document> &Doc;
158158
SMRange SourceRange;
159159

160-
void operator delete(void *) LLVM_NOEXCEPT = delete;
160+
void operator delete(void *) noexcept = delete;
161161

162162
~Node() = default;
163163

lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6581,7 +6581,7 @@ namespace {
65816581
// will be removed once this transition is complete. Clients should prefer to
65826582
// deal with the Error value directly, rather than converting to error_code.
65836583
class BitcodeErrorCategoryType : public std::error_category {
6584-
const char *name() const LLVM_NOEXCEPT override {
6584+
const char *name() const noexcept override {
65856585
return "llvm.bitcode";
65866586
}
65876587
std::string message(int IE) const override {

lib/DebugInfo/CodeView/CodeViewError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace {
2020
// deal with the Error value directly, rather than converting to error_code.
2121
class CodeViewErrorCategory : public std::error_category {
2222
public:
23-
const char *name() const LLVM_NOEXCEPT override { return "llvm.codeview"; }
23+
const char *name() const noexcept override { return "llvm.codeview"; }
2424

2525
std::string message(int Condition) const override {
2626
switch (static_cast<cv_error_code>(Condition)) {

lib/DebugInfo/MSF/MSFError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace {
2020
// deal with the Error value directly, rather than converting to error_code.
2121
class MSFErrorCategory : public std::error_category {
2222
public:
23-
const char *name() const LLVM_NOEXCEPT override { return "llvm.msf"; }
23+
const char *name() const noexcept override { return "llvm.msf"; }
2424

2525
std::string message(int Condition) const override {
2626
switch (static_cast<msf_error_code>(Condition)) {

lib/DebugInfo/PDB/DIA/DIAError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using namespace llvm::pdb;
1010
// deal with the Error value directly, rather than converting to error_code.
1111
class DIAErrorCategory : public std::error_category {
1212
public:
13-
const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb.dia"; }
13+
const char *name() const noexcept override { return "llvm.pdb.dia"; }
1414

1515
std::string message(int Condition) const override {
1616
switch (static_cast<dia_error_code>(Condition)) {

lib/DebugInfo/PDB/GenericError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace {
2020
// deal with the Error value directly, rather than converting to error_code.
2121
class GenericErrorCategory : public std::error_category {
2222
public:
23-
const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb"; }
23+
const char *name() const noexcept override { return "llvm.pdb"; }
2424

2525
std::string message(int Condition) const override {
2626
switch (static_cast<generic_error_code>(Condition)) {

lib/DebugInfo/PDB/Raw/RawError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace {
1111
// deal with the Error value directly, rather than converting to error_code.
1212
class RawErrorCategory : public std::error_category {
1313
public:
14-
const char *name() const LLVM_NOEXCEPT override { return "llvm.pdb.raw"; }
14+
const char *name() const noexcept override { return "llvm.pdb.raw"; }
1515

1616
std::string message(int Condition) const override {
1717
switch (static_cast<raw_error_code>(Condition)) {

lib/ExecutionEngine/Orc/OrcError.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace {
2525
// deal with the Error value directly, rather than converting to error_code.
2626
class OrcErrorCategory : public std::error_category {
2727
public:
28-
const char *name() const LLVM_NOEXCEPT override { return "orc"; }
28+
const char *name() const noexcept override { return "orc"; }
2929

3030
std::string message(int condition) const override {
3131
switch (static_cast<OrcErrorCode>(condition)) {

lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ enum RuntimeDyldErrorCode {
3939
// deal with the Error value directly, rather than converting to error_code.
4040
class RuntimeDyldErrorCategory : public std::error_category {
4141
public:
42-
const char *name() const LLVM_NOEXCEPT override { return "runtimedyld"; }
42+
const char *name() const noexcept override { return "runtimedyld"; }
4343

4444
std::string message(int Condition) const override {
4545
switch (static_cast<RuntimeDyldErrorCode>(Condition)) {

lib/Object/Error.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ namespace {
2424
// deal with the Error value directly, rather than converting to error_code.
2525
class _object_error_category : public std::error_category {
2626
public:
27-
const char* name() const LLVM_NOEXCEPT override;
27+
const char* name() const noexcept override;
2828
std::string message(int ev) const override;
2929
};
3030
}
3131

32-
const char *_object_error_category::name() const LLVM_NOEXCEPT {
32+
const char *_object_error_category::name() const noexcept {
3333
return "llvm.object";
3434
}
3535

lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ std::string getCoverageMapErrString(coveragemap_error Err) {
589589
// will be removed once this transition is complete. Clients should prefer to
590590
// deal with the Error value directly, rather than converting to error_code.
591591
class CoverageMappingErrorCategoryType : public std::error_category {
592-
const char *name() const LLVM_NOEXCEPT override { return "llvm.coveragemap"; }
592+
const char *name() const noexcept override { return "llvm.coveragemap"; }
593593
std::string message(int IE) const override {
594594
return getCoverageMapErrString(static_cast<coveragemap_error>(IE));
595595
}

lib/ProfileData/InstrProf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ std::string getInstrProfErrString(instrprof_error Err) {
8080
// will be removed once this transition is complete. Clients should prefer to
8181
// deal with the Error value directly, rather than converting to error_code.
8282
class InstrProfErrorCategoryType : public std::error_category {
83-
const char *name() const LLVM_NOEXCEPT override { return "llvm.instrprof"; }
83+
const char *name() const noexcept override { return "llvm.instrprof"; }
8484
std::string message(int IE) const override {
8585
return getInstrProfErrString(static_cast<instrprof_error>(IE));
8686
}

lib/ProfileData/SampleProf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace {
2424
// will be removed once this transition is complete. Clients should prefer to
2525
// deal with the Error value directly, rather than converting to error_code.
2626
class SampleProfErrorCategoryType : public std::error_category {
27-
const char *name() const LLVM_NOEXCEPT override { return "llvm.sampleprof"; }
27+
const char *name() const noexcept override { return "llvm.sampleprof"; }
2828
std::string message(int IE) const override {
2929
sampleprof_error E = static_cast<sampleprof_error>(IE);
3030
switch (E) {

lib/Support/Error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace {
2828
// deal with the Error value directly, rather than converting to error_code.
2929
class ErrorErrorCategory : public std::error_category {
3030
public:
31-
const char *name() const LLVM_NOEXCEPT override { return "Error"; }
31+
const char *name() const noexcept override { return "Error"; }
3232

3333
std::string message(int condition) const override {
3434
switch (static_cast<ErrorErrorCode>(condition)) {

tools/llvm-cxxdump/Error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace {
2222
// deal with the Error value directly, rather than converting to error_code.
2323
class cxxdump_error_category : public std::error_category {
2424
public:
25-
const char *name() const LLVM_NOEXCEPT override { return "llvm.cxxdump"; }
25+
const char *name() const noexcept override { return "llvm.cxxdump"; }
2626
std::string message(int ev) const override {
2727
switch (static_cast<cxxdump_error>(ev)) {
2828
case cxxdump_error::success:

tools/llvm-readobj/Error.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ namespace {
2222
// deal with the Error value directly, rather than converting to error_code.
2323
class _readobj_error_category : public std::error_category {
2424
public:
25-
const char* name() const LLVM_NOEXCEPT override;
25+
const char* name() const noexcept override;
2626
std::string message(int ev) const override;
2727
};
2828
} // namespace
2929

30-
const char *_readobj_error_category::name() const LLVM_NOEXCEPT {
30+
const char *_readobj_error_category::name() const noexcept {
3131
return "llvm.readobj";
3232
}
3333

tools/obj2yaml/Error.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ namespace {
1818
// deal with the Error value directly, rather than converting to error_code.
1919
class _obj2yaml_error_category : public std::error_category {
2020
public:
21-
const char *name() const LLVM_NOEXCEPT override;
21+
const char *name() const noexcept override;
2222
std::string message(int ev) const override;
2323
};
2424
} // namespace
2525

26-
const char *_obj2yaml_error_category::name() const LLVM_NOEXCEPT {
26+
const char *_obj2yaml_error_category::name() const noexcept {
2727
return "obj2yaml";
2828
}
2929

0 commit comments

Comments
 (0)