summaryrefslogtreecommitdiffstats
path: root/include/clang
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2011-03-06 10:52:04 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2011-03-06 10:52:04 +0000
commit8b5b4099c61a136e9a1714c4d8a593febe942268 (patch)
treea841ec99921f03ce9577a2216960103d96dfd95c /include/clang
parent5453d93ab8668f2d9d0bc02182695b02d207e32d (diff)
Reinstate r127112, "Propagate new-style exception spec information to ExtProtoInfo.", this time with the missing header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/Type.h13
-rw-r--r--include/clang/Basic/ExceptionSpecificationType.h38
-rw-r--r--include/clang/Sema/DeclSpec.h10
3 files changed, 46 insertions, 15 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 9b177cceed..c194e7baa9 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -15,6 +15,7 @@
#define LLVM_CLANG_AST_TYPE_H
#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/ExceptionSpecificationType.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/Linkage.h"
#include "clang/Basic/PartialDiagnostic.h"
@@ -2403,17 +2404,17 @@ public:
/// ExtProtoInfo - Extra information about a function prototype.
struct ExtProtoInfo {
ExtProtoInfo() :
- Variadic(false), HasExceptionSpec(false), HasAnyExceptionSpec(false),
- TypeQuals(0), RefQualifier(RQ_None), NumExceptions(0), Exceptions(0) {}
+ Variadic(false), ExceptionSpecType(EST_None), TypeQuals(0),
+ RefQualifier(RQ_None), NumExceptions(0), Exceptions(0), NoexceptExpr(0) {}
FunctionType::ExtInfo ExtInfo;
bool Variadic;
- bool HasExceptionSpec;
- bool HasAnyExceptionSpec;
+ ExceptionSpecificationType ExceptionSpecType;
unsigned char TypeQuals;
RefQualifierKind RefQualifier;
unsigned NumExceptions;
const QualType *Exceptions;
+ Expr *NoexceptExpr;
};
private:
@@ -2462,8 +2463,8 @@ public:
ExtProtoInfo EPI;
EPI.ExtInfo = getExtInfo();
EPI.Variadic = isVariadic();
- EPI.HasExceptionSpec = hasExceptionSpec();
- EPI.HasAnyExceptionSpec = hasAnyExceptionSpec();
+ EPI.ExceptionSpecType = hasExceptionSpec() ?
+ (hasAnyExceptionSpec() ? EST_DynamicAny : EST_Dynamic) : EST_None;
EPI.TypeQuals = static_cast<unsigned char>(getTypeQuals());
EPI.RefQualifier = getRefQualifier();
EPI.NumExceptions = NumExceptions;
diff --git a/include/clang/Basic/ExceptionSpecificationType.h b/include/clang/Basic/ExceptionSpecificationType.h
new file mode 100644
index 0000000000..48621c73d7
--- /dev/null
+++ b/include/clang/Basic/ExceptionSpecificationType.h
@@ -0,0 +1,38 @@
+//===--- ExceptionSpecificationType.h ---------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the ExceptionSpecificationType enumeration and various
+// utility functions.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
+#define LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
+
+namespace clang {
+
+/// \brief The various types of exception specifications that exist in C++0x.
+enum ExceptionSpecificationType {
+ EST_None, ///< no exception specification
+ EST_Dynamic, ///< throw() or throw(T1, T2)
+ EST_DynamicAny, ///< Microsoft throw(...) extension
+ EST_BasicNoexcept, ///< noexcept
+ EST_ComputedNoexcept ///< noexcept(expression)
+};
+
+inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) {
+ return ESpecType == EST_Dynamic || ESpecType == EST_DynamicAny;
+}
+
+inline bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType) {
+ return ESpecType == EST_BasicNoexcept || ESpecType == EST_ComputedNoexcept;
+}
+
+} // end namespace clang
+
+#endif // LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H
diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h
index 164dac096d..b7a6499502 100644
--- a/include/clang/Sema/DeclSpec.h
+++ b/include/clang/Sema/DeclSpec.h
@@ -24,6 +24,7 @@
#include "clang/Sema/Ownership.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/Lex/Token.h"
+#include "clang/Basic/ExceptionSpecificationType.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/Specifiers.h"
#include "llvm/ADT/SmallVector.h"
@@ -907,15 +908,6 @@ public:
/// parsing.
typedef llvm::SmallVector<Token, 4> CachedTokens;
-/// \brief The various types of exception specifications that exist in C++0x.
-enum ExceptionSpecificationType {
- EST_None, ///< no exception specification
- EST_Dynamic, ///< throw() or throw(T1, T2)
- EST_DynamicAny, ///< Microsoft throw(...) extension
- EST_BasicNoexcept, ///< noexcept
- EST_ComputedNoexcept ///< noexcept(expression)
-};
-
/// DeclaratorChunk - One instance of this struct is used for each type in a
/// declarator that is parsed.
///