aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/ExprCXX.h2
-rw-r--r--include/clang/AST/ExprObjC.h3
-rw-r--r--include/clang/AST/Type.h2
-rw-r--r--include/clang/Basic/LLVM.h9
-rw-r--r--include/clang/Basic/VersionTuple.h4
-rw-r--r--include/clang/Lex/PreprocessingRecord.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h2
7 files changed, 14 insertions, 10 deletions
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h
index 7665dbce4c..cc12d0527a 100644
--- a/include/clang/AST/ExprCXX.h
+++ b/include/clang/AST/ExprCXX.h
@@ -3373,7 +3373,7 @@ public:
if (NumExpansions)
return NumExpansions - 1;
- return Optional<unsigned>();
+ return None;
}
SourceLocation getLocStart() const LLVM_READONLY {
diff --git a/include/clang/AST/ExprObjC.h b/include/clang/AST/ExprObjC.h
index 2b88dfdcb2..b6bf006645 100644
--- a/include/clang/AST/ExprObjC.h
+++ b/include/clang/AST/ExprObjC.h
@@ -300,8 +300,7 @@ public:
ObjCDictionaryElement getKeyValueElement(unsigned Index) const {
assert((Index < NumElements) && "Arg access out of range!");
const KeyValuePair &KV = getKeyValues()[Index];
- ObjCDictionaryElement Result = { KV.Key, KV.Value, SourceLocation(),
- Optional<unsigned>() };
+ ObjCDictionaryElement Result = { KV.Key, KV.Value, SourceLocation(), None };
if (HasPackExpansions) {
const ExpansionData &Expansion = getExpansionData()[Index];
Result.EllipsisLoc = Expansion.EllipsisLoc;
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index f0a7ae888d..2026b226c5 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -4155,7 +4155,7 @@ public:
if (NumExpansions)
return NumExpansions - 1;
- return Optional<unsigned>();
+ return None;
}
bool isSugared() const { return false; }
diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h
index abeec15741..eb47597f11 100644
--- a/include/clang/Basic/LLVM.h
+++ b/include/clang/Basic/LLVM.h
@@ -16,9 +16,13 @@
#ifndef CLANG_BASIC_LLVM_H
#define CLANG_BASIC_LLVM_H
-// This should be the only #include, force #includes of all the others on
-// clients.
+// Do not proliferate #includes here, require clients to #include their
+// dependencies.
+// Casting.h has complex templates that cannot be easily forward declared.
#include "llvm/Support/Casting.h"
+// None.h includes an enumerant that is desired & cannot be forward declared
+// without a definition of NoneType.
+#include "llvm/ADT/None.h"
namespace llvm {
// ADT's.
@@ -54,6 +58,7 @@ namespace clang {
using llvm::cast_or_null;
// ADT's.
+ using llvm::None;
using llvm::Optional;
using llvm::StringRef;
using llvm::Twine;
diff --git a/include/clang/Basic/VersionTuple.h b/include/clang/Basic/VersionTuple.h
index 059b7f7239..ff06a5c23d 100644
--- a/include/clang/Basic/VersionTuple.h
+++ b/include/clang/Basic/VersionTuple.h
@@ -57,14 +57,14 @@ public:
/// \brief Retrieve the minor version number, if provided.
Optional<unsigned> getMinor() const {
if (!HasMinor)
- return Optional<unsigned>();
+ return None;
return Minor;
}
/// \brief Retrieve the subminor version number, if provided.
Optional<unsigned> getSubminor() const {
if (!HasSubminor)
- return Optional<unsigned>();
+ return None;
return Subminor;
}
diff --git a/include/clang/Lex/PreprocessingRecord.h b/include/clang/Lex/PreprocessingRecord.h
index 926da52675..535e0ca79b 100644
--- a/include/clang/Lex/PreprocessingRecord.h
+++ b/include/clang/Lex/PreprocessingRecord.h
@@ -279,7 +279,7 @@ namespace clang {
/// entity with index \p Index came from file \p FID.
virtual Optional<bool> isPreprocessedEntityInFileID(unsigned Index,
FileID FID) {
- return Optional<bool>();
+ return None;
}
};
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h b/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
index 0e0108c2d5..31d02f51ea 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
@@ -85,7 +85,7 @@ public:
template<typename T>
Optional<T> getAs() const {
if (!T::isKind(*this))
- return Optional<T>();
+ return None;
T t;
SVal& sv = t;
sv = *this;