diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-21 01:47:18 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-21 01:47:18 +0000 |
commit | 66874fb18afbffb8b2ca05576851a64534be3352 (patch) | |
tree | d6391d232c549a7ec1e6bb31a943e468aac589d9 /include/clang/Basic | |
parent | 65124fe81f61eed98b845c87e3a78a780f3deb11 (diff) |
Use None rather than Optional<T>() where possible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/LLVM.h | 9 | ||||
-rw-r--r-- | include/clang/Basic/VersionTuple.h | 4 |
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; } |