aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic')
-rw-r--r--include/clang/Basic/LLVM.h9
-rw-r--r--include/clang/Basic/VersionTuple.h4
2 files changed, 9 insertions, 4 deletions
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;
}