summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic')
-rw-r--r--include/clang/Basic/ABI.h8
-rw-r--r--include/clang/Basic/Builtins.h20
-rw-r--r--include/clang/Basic/Diagnostic.h12
-rw-r--r--include/clang/Basic/FileManager.h10
-rw-r--r--include/clang/Basic/FileSystemStatCache.h2
-rw-r--r--include/clang/Basic/IdentifierTable.h4
-rw-r--r--include/clang/Basic/Module.h6
-rw-r--r--include/clang/Basic/PartialDiagnostic.h16
-rw-r--r--include/clang/Basic/SourceLocation.h22
-rw-r--r--include/clang/Basic/SourceManager.h92
-rw-r--r--include/clang/Basic/TargetInfo.h4
-rw-r--r--include/clang/Basic/VirtualFileSystem.h2
12 files changed, 103 insertions, 95 deletions
diff --git a/include/clang/Basic/ABI.h b/include/clang/Basic/ABI.h
index 3b3d59efc0..9e8ef2e3ee 100644
--- a/include/clang/Basic/ABI.h
+++ b/include/clang/Basic/ABI.h
@@ -186,10 +186,10 @@ struct ThunkInfo {
/// an ABI-specific comparator.
const CXXMethodDecl *Method;
- ThunkInfo() : Method(0) { }
+ ThunkInfo() : Method(nullptr) { }
ThunkInfo(const ThisAdjustment &This, const ReturnAdjustment &Return,
- const CXXMethodDecl *Method = 0)
+ const CXXMethodDecl *Method = nullptr)
: This(This), Return(Return), Method(Method) {}
friend bool operator==(const ThunkInfo &LHS, const ThunkInfo &RHS) {
@@ -197,7 +197,9 @@ struct ThunkInfo {
LHS.Method == RHS.Method;
}
- bool isEmpty() const { return This.isEmpty() && Return.isEmpty() && Method == 0; }
+ bool isEmpty() const {
+ return This.isEmpty() && Return.isEmpty() && Method == nullptr;
+ }
};
} // end namespace clang
diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h
index fd8fd422b1..f9d30e4056 100644
--- a/include/clang/Basic/Builtins.h
+++ b/include/clang/Basic/Builtins.h
@@ -94,53 +94,53 @@ public:
/// \brief Return true if this function has no side effects and doesn't
/// read memory.
bool isConst(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'c') != 0;
+ return strchr(GetRecord(ID).Attributes, 'c') != nullptr;
}
/// \brief Return true if we know this builtin never throws an exception.
bool isNoThrow(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'n') != 0;
+ return strchr(GetRecord(ID).Attributes, 'n') != nullptr;
}
/// \brief Return true if we know this builtin never returns.
bool isNoReturn(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'r') != 0;
+ return strchr(GetRecord(ID).Attributes, 'r') != nullptr;
}
/// \brief Return true if we know this builtin can return twice.
bool isReturnsTwice(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'j') != 0;
+ return strchr(GetRecord(ID).Attributes, 'j') != nullptr;
}
/// \brief Returns true if this builtin does not perform the side-effects
/// of its arguments.
bool isUnevaluated(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'u') != 0;
+ return strchr(GetRecord(ID).Attributes, 'u') != nullptr;
}
/// \brief Return true if this is a builtin for a libc/libm function,
/// with a "__builtin_" prefix (e.g. __builtin_abs).
bool isLibFunction(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'F') != 0;
+ return strchr(GetRecord(ID).Attributes, 'F') != nullptr;
}
/// \brief Determines whether this builtin is a predefined libc/libm
/// function, such as "malloc", where we know the signature a
/// priori.
bool isPredefinedLibFunction(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'f') != 0;
+ return strchr(GetRecord(ID).Attributes, 'f') != nullptr;
}
/// \brief Determines whether this builtin is a predefined compiler-rt/libgcc
/// function, such as "__clear_cache", where we know the signature a
/// priori.
bool isPredefinedRuntimeFunction(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'i') != 0;
+ return strchr(GetRecord(ID).Attributes, 'i') != nullptr;
}
/// \brief Determines whether this builtin has custom typechecking.
bool hasCustomTypechecking(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 't') != 0;
+ return strchr(GetRecord(ID).Attributes, 't') != nullptr;
}
/// \brief Completely forget that the given ID was ever considered a builtin,
@@ -168,7 +168,7 @@ public:
///
/// Such functions can be const when the MathErrno lang option is disabled.
bool isConstWithoutErrno(unsigned ID) const {
- return strchr(GetRecord(ID).Attributes, 'e') != 0;
+ return strchr(GetRecord(ID).Attributes, 'e') != nullptr;
}
private:
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h
index d8d1ea6932..7739631f63 100644
--- a/include/clang/Basic/Diagnostic.h
+++ b/include/clang/Basic/Diagnostic.h
@@ -354,7 +354,7 @@ public:
explicit DiagnosticsEngine(
const IntrusiveRefCntPtr<DiagnosticIDs> &Diags,
DiagnosticOptions *DiagOpts,
- DiagnosticConsumer *client = 0,
+ DiagnosticConsumer *client = nullptr,
bool ShouldOwnClient = true);
~DiagnosticsEngine();
@@ -386,7 +386,7 @@ public:
return Client;
}
- bool hasSourceManager() const { return SourceMgr != 0; }
+ bool hasSourceManager() const { return SourceMgr != nullptr; }
SourceManager &getSourceManager() const {
assert(SourceMgr && "SourceManager not set!");
return *SourceMgr;
@@ -889,7 +889,7 @@ class DiagnosticBuilder {
friend class DiagnosticsEngine;
DiagnosticBuilder()
- : DiagObj(0), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(false),
+ : DiagObj(nullptr), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(false),
IsForceEmit(false) { }
explicit DiagnosticBuilder(DiagnosticsEngine *diagObj)
@@ -909,7 +909,7 @@ protected:
/// \brief Clear out the current diagnostic.
void Clear() const {
- DiagObj = 0;
+ DiagObj = nullptr;
IsActive = false;
IsForceEmit = false;
}
@@ -1245,7 +1245,7 @@ public:
}
const FixItHint *getFixItHints() const {
- return getNumFixItHints()? DiagObj->DiagFixItHints : 0;
+ return getNumFixItHints()? DiagObj->DiagFixItHints : nullptr;
}
/// \brief Format this diagnostic into a string, substituting the
@@ -1341,7 +1341,7 @@ public:
/// \param PP The preprocessor object being used for the source; this is
/// optional, e.g., it may not be present when processing AST source files.
virtual void BeginSourceFile(const LangOptions &LangOpts,
- const Preprocessor *PP = 0) {}
+ const Preprocessor *PP = nullptr) {}
/// \brief Callback to inform the diagnostic client that processing
/// of a source file has ended.
diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h
index cc9e4e4079..023433b25b 100644
--- a/include/clang/Basic/FileManager.h
+++ b/include/clang/Basic/FileManager.h
@@ -49,7 +49,7 @@ class DirectoryEntry {
const char *Name; // Name of the directory.
friend class FileManager;
public:
- DirectoryEntry() : Name(0) {}
+ DirectoryEntry() : Name(nullptr) {}
const char *getName() const { return Name; }
};
@@ -74,7 +74,7 @@ class FileEntry {
friend class FileManager;
void closeFile() const {
- File.reset(0); // rely on destructor to close File
+ File.reset(nullptr); // rely on destructor to close File
}
void operator=(const FileEntry &) LLVM_DELETED_FUNCTION;
@@ -180,7 +180,7 @@ class FileManager : public RefCountedBase<FileManager> {
public:
FileManager(const FileSystemOptions &FileSystemOpts,
- IntrusiveRefCntPtr<vfs::FileSystem> FS = 0);
+ IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr);
~FileManager();
/// \brief Installs the provided FileSystemStatCache object within
@@ -241,10 +241,10 @@ public:
/// \brief Open the specified file as a MemoryBuffer, returning a new
/// MemoryBuffer if successful, otherwise returning null.
llvm::MemoryBuffer *getBufferForFile(const FileEntry *Entry,
- std::string *ErrorStr = 0,
+ std::string *ErrorStr = nullptr,
bool isVolatile = false);
llvm::MemoryBuffer *getBufferForFile(StringRef Filename,
- std::string *ErrorStr = 0);
+ std::string *ErrorStr = nullptr);
/// \brief Get the 'stat' information for the given \p Path.
///
diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h
index c4a89b3dbe..2e9528db91 100644
--- a/include/clang/Basic/FileSystemStatCache.h
+++ b/include/clang/Basic/FileSystemStatCache.h
@@ -95,7 +95,7 @@ protected:
// If we hit the end of the list of stat caches to try, just compute and
// return it without a cache.
- return get(Path, Data, isFile, F, 0, FS) ? CacheMissing : CacheExists;
+ return get(Path, Data, isFile, F, nullptr, FS) ? CacheMissing : CacheExists;
}
};
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index abf5b930e4..f65ba86354 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -428,7 +428,7 @@ public:
/// \brief Create the identifier table, populating it with info about the
/// language keywords for the language specified by \p LangOpts.
IdentifierTable(const LangOptions &LangOpts,
- IdentifierInfoLookup* externalLookup = 0);
+ IdentifierInfoLookup* externalLookup = nullptr);
/// \brief Set the external identifier lookup mechanism.
void setExternalIdentifierLookup(IdentifierInfoLookup *IILookup) {
@@ -625,7 +625,7 @@ class Selector {
IdentifierInfo *getAsIdentifierInfo() const {
if (getIdentifierInfoFlag() < MultiArg)
return reinterpret_cast<IdentifierInfo *>(InfoPtr & ~ArgFlags);
- return 0;
+ return nullptr;
}
MultiKeywordSelector *getMultiKeywordSelector() const {
return reinterpret_cast<MultiKeywordSelector *>(InfoPtr & ~ArgFlags);
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index 783aa1d57b..89fd3886b4 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -311,7 +311,7 @@ public:
HeaderDirective &MissingHeader) const;
/// \brief Determine whether this module is a submodule.
- bool isSubModule() const { return Parent != 0; }
+ bool isSubModule() const { return Parent != nullptr; }
/// \brief Determine whether this module is a submodule of the given other
/// module.
@@ -362,8 +362,8 @@ public:
/// \brief Set the serialized AST file for the top-level module of this module.
void setASTFile(const FileEntry *File) {
- assert((File == 0 || getASTFile() == 0 || getASTFile() == File) &&
- "file path changed");
+ assert((File == nullptr || getASTFile() == nullptr ||
+ getASTFile() == File) && "file path changed");
getTopLevelModule()->ASTFile = File;
}
diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h
index 314b9ef180..f5418c02d7 100644
--- a/include/clang/Basic/PartialDiagnostic.h
+++ b/include/clang/Basic/PartialDiagnostic.h
@@ -159,7 +159,7 @@ private:
Allocator->Deallocate(DiagStorage);
else if (Allocator != reinterpret_cast<StorageAllocator *>(~uintptr_t(0)))
delete DiagStorage;
- DiagStorage = 0;
+ DiagStorage = nullptr;
}
void AddSourceRange(const CharSourceRange &R) const {
@@ -187,13 +187,13 @@ public:
/// \brief Create a null partial diagnostic, which cannot carry a payload,
/// and only exists to be swapped with a real partial diagnostic.
PartialDiagnostic(NullDiagnostic)
- : DiagID(0), DiagStorage(0), Allocator(0) { }
+ : DiagID(0), DiagStorage(nullptr), Allocator(nullptr) { }
PartialDiagnostic(unsigned DiagID, StorageAllocator &Allocator)
- : DiagID(DiagID), DiagStorage(0), Allocator(&Allocator) { }
+ : DiagID(DiagID), DiagStorage(nullptr), Allocator(&Allocator) { }
PartialDiagnostic(const PartialDiagnostic &Other)
- : DiagID(Other.DiagID), DiagStorage(0), Allocator(Other.Allocator)
+ : DiagID(Other.DiagID), DiagStorage(nullptr), Allocator(Other.Allocator)
{
if (Other.DiagStorage) {
DiagStorage = getStorage();
@@ -204,7 +204,7 @@ public:
PartialDiagnostic(PartialDiagnostic &&Other)
: DiagID(Other.DiagID), DiagStorage(Other.DiagStorage),
Allocator(Other.Allocator) {
- Other.DiagStorage = 0;
+ Other.DiagStorage = nullptr;
}
PartialDiagnostic(const PartialDiagnostic &Other, Storage *DiagStorage)
@@ -216,7 +216,7 @@ public:
}
PartialDiagnostic(const Diagnostic &Other, StorageAllocator &Allocator)
- : DiagID(Other.getID()), DiagStorage(0), Allocator(&Allocator)
+ : DiagID(Other.getID()), DiagStorage(nullptr), Allocator(&Allocator)
{
// Copy arguments.
for (unsigned I = 0, N = Other.getNumArgs(); I != N; ++I) {
@@ -256,7 +256,7 @@ public:
DiagStorage = Other.DiagStorage;
Allocator = Other.Allocator;
- Other.DiagStorage = 0;
+ Other.DiagStorage = nullptr;
return *this;
}
@@ -335,7 +335,7 @@ public:
freeStorage();
}
- bool hasStorage() const { return DiagStorage != 0; }
+ bool hasStorage() const { return DiagStorage != nullptr; }
friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD,
unsigned I) {
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h
index 01ca9a5ac1..7b637d7e1f 100644
--- a/include/clang/Basic/SourceLocation.h
+++ b/include/clang/Basic/SourceLocation.h
@@ -268,7 +268,7 @@ class FullSourceLoc : public SourceLocation {
const SourceManager *SrcMgr;
public:
/// \brief Creates a FullSourceLoc where isValid() returns \c false.
- explicit FullSourceLoc() : SrcMgr(0) {}
+ explicit FullSourceLoc() : SrcMgr(nullptr) {}
explicit FullSourceLoc(SourceLocation Loc, const SourceManager &SM)
: SourceLocation(Loc), SrcMgr(&SM) {}
@@ -284,19 +284,19 @@ public:
FullSourceLoc getExpansionLoc() const;
FullSourceLoc getSpellingLoc() const;
- unsigned getExpansionLineNumber(bool *Invalid = 0) const;
- unsigned getExpansionColumnNumber(bool *Invalid = 0) const;
+ unsigned getExpansionLineNumber(bool *Invalid = nullptr) const;
+ unsigned getExpansionColumnNumber(bool *Invalid = nullptr) const;
- unsigned getSpellingLineNumber(bool *Invalid = 0) const;
- unsigned getSpellingColumnNumber(bool *Invalid = 0) const;
+ unsigned getSpellingLineNumber(bool *Invalid = nullptr) const;
+ unsigned getSpellingColumnNumber(bool *Invalid = nullptr) const;
- const char *getCharacterData(bool *Invalid = 0) const;
+ const char *getCharacterData(bool *Invalid = nullptr) const;
- const llvm::MemoryBuffer* getBuffer(bool *Invalid = 0) const;
+ const llvm::MemoryBuffer* getBuffer(bool *Invalid = nullptr) const;
/// \brief Return a StringRef to the source buffer data for the
/// specified FileID.
- StringRef getBufferData(bool *Invalid = 0) const;
+ StringRef getBufferData(bool *Invalid = nullptr) const;
/// \brief Decompose the specified location into a raw FileID + Offset pair.
///
@@ -358,7 +358,7 @@ class PresumedLoc {
unsigned Line, Col;
SourceLocation IncludeLoc;
public:
- PresumedLoc() : Filename(0) {}
+ PresumedLoc() : Filename(nullptr) {}
PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL)
: Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) {
}
@@ -367,8 +367,8 @@ public:
///
/// This occurs when created with invalid source locations or when walking
/// off the top of a \#include stack.
- bool isInvalid() const { return Filename == 0; }
- bool isValid() const { return Filename != 0; }
+ bool isInvalid() const { return Filename == nullptr; }
+ bool isValid() const { return Filename != nullptr; }
/// \brief Return the presumed filename of this location.
///
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 73fd770f72..df38f75adb 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -143,16 +143,16 @@ namespace SrcMgr {
/// file considered as a system one.
unsigned IsSystemFile : 1;
- ContentCache(const FileEntry *Ent = 0)
- : Buffer(0, false), OrigEntry(Ent), ContentsEntry(Ent),
- SourceLineCache(0), NumLines(0), BufferOverridden(false),
+ ContentCache(const FileEntry *Ent = nullptr)
+ : Buffer(nullptr, false), OrigEntry(Ent), ContentsEntry(Ent),
+ SourceLineCache(nullptr), NumLines(0), BufferOverridden(false),
IsSystemFile(false) {
(void)NonceAligner; // Silence warnings about unused member.
}
ContentCache(const FileEntry *Ent, const FileEntry *contentEnt)
- : Buffer(0, false), OrigEntry(Ent), ContentsEntry(contentEnt),
- SourceLineCache(0), NumLines(0), BufferOverridden(false),
+ : Buffer(nullptr, false), OrigEntry(Ent), ContentsEntry(contentEnt),
+ SourceLineCache(nullptr), NumLines(0), BufferOverridden(false),
IsSystemFile(false) {}
~ContentCache();
@@ -161,15 +161,15 @@ namespace SrcMgr {
/// a non-NULL Buffer or SourceLineCache. Ownership of allocated memory
/// is not transferred, so this is a logical error.
ContentCache(const ContentCache &RHS)
- : Buffer(0, false), SourceLineCache(0), BufferOverridden(false),
- IsSystemFile(false)
- {
+ : Buffer(nullptr, false), SourceLineCache(nullptr),
+ BufferOverridden(false), IsSystemFile(false) {
OrigEntry = RHS.OrigEntry;
ContentsEntry = RHS.ContentsEntry;
-
- assert (RHS.Buffer.getPointer() == 0 && RHS.SourceLineCache == 0 &&
- "Passed ContentCache object cannot own a buffer.");
-
+
+ assert(RHS.Buffer.getPointer() == nullptr &&
+ RHS.SourceLineCache == nullptr &&
+ "Passed ContentCache object cannot own a buffer.");
+
NumLines = RHS.NumLines;
}
@@ -185,7 +185,7 @@ namespace SrcMgr {
const llvm::MemoryBuffer *getBuffer(DiagnosticsEngine &Diag,
const SourceManager &SM,
SourceLocation Loc = SourceLocation(),
- bool *Invalid = 0) const;
+ bool *Invalid = nullptr) const;
/// \brief Returns the size of the content encapsulated by this
/// ContentCache.
@@ -841,7 +841,7 @@ public:
/// \param Invalid If non-NULL, will be set \c true if an error
/// occurs while retrieving the memory buffer.
const llvm::MemoryBuffer *getMemoryBufferForFile(const FileEntry *File,
- bool *Invalid = 0);
+ bool *Invalid = nullptr);
/// \brief Override the contents of the given source file by providing an
/// already-allocated buffer.
@@ -893,7 +893,7 @@ public:
/// If there is an error opening this buffer the first time, this
/// manufactures a temporary buffer and returns a non-empty error string.
const llvm::MemoryBuffer *getBuffer(FileID FID, SourceLocation Loc,
- bool *Invalid = 0) const {
+ bool *Invalid = nullptr) const {
bool MyInvalid = false;
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid);
if (MyInvalid || !Entry.isFile()) {
@@ -907,7 +907,8 @@ public:
Invalid);
}
- const llvm::MemoryBuffer *getBuffer(FileID FID, bool *Invalid = 0) const {
+ const llvm::MemoryBuffer *getBuffer(FileID FID,
+ bool *Invalid = nullptr) const {
bool MyInvalid = false;
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid);
if (MyInvalid || !Entry.isFile()) {
@@ -927,11 +928,11 @@ public:
bool MyInvalid = false;
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid);
if (MyInvalid || !Entry.isFile())
- return 0;
+ return nullptr;
const SrcMgr::ContentCache *Content = Entry.getFile().getContentCache();
if (!Content)
- return 0;
+ return nullptr;
return Content->OrigEntry;
}
@@ -940,7 +941,7 @@ public:
{
const SrcMgr::ContentCache *Content = sloc.getFile().getContentCache();
if (!Content)
- return 0;
+ return nullptr;
return Content->OrigEntry;
}
@@ -949,7 +950,7 @@ public:
///
/// \param FID The file ID whose contents will be returned.
/// \param Invalid If non-NULL, will be set true if an error occurred.
- StringRef getBufferData(FileID FID, bool *Invalid = 0) const;
+ StringRef getBufferData(FileID FID, bool *Invalid = nullptr) const;
/// \brief Get the number of FileIDs (files and macros) that were created
/// during preprocessing of \p FID, including it.
@@ -1184,15 +1185,16 @@ public:
/// \param MacroBegin If non-null and function returns true, it is set to the
/// begin location of the immediate macro expansion.
bool isAtStartOfImmediateMacroExpansion(SourceLocation Loc,
- SourceLocation *MacroBegin = 0) const;
+ SourceLocation *MacroBegin = nullptr) const;
/// \brief Returns true if the given MacroID location points at the character
/// end of the immediate macro expansion.
///
/// \param MacroEnd If non-null and function returns true, it is set to the
/// character end location of the immediate macro expansion.
- bool isAtEndOfImmediateMacroExpansion(SourceLocation Loc,
- SourceLocation *MacroEnd = 0) const;
+ bool
+ isAtEndOfImmediateMacroExpansion(SourceLocation Loc,
+ SourceLocation *MacroEnd = nullptr) const;
/// \brief Returns true if \p Loc is inside the [\p Start, +\p Length)
/// chunk of the source location address space.
@@ -1201,7 +1203,7 @@ public:
/// relative offset of \p Loc inside the chunk.
bool isInSLocAddrSpace(SourceLocation Loc,
SourceLocation Start, unsigned Length,
- unsigned *RelativeOffset = 0) const {
+ unsigned *RelativeOffset = nullptr) const {
assert(((Start.getOffset() < NextLocalOffset &&
Start.getOffset()+Length <= NextLocalOffset) ||
(Start.getOffset() >= CurrentLoadedOffset &&
@@ -1247,7 +1249,8 @@ public:
/// in the appropriate spelling MemoryBuffer.
///
/// \param Invalid If non-NULL, will be set \c true if an error occurs.
- const char *getCharacterData(SourceLocation SL, bool *Invalid = 0) const;
+ const char *getCharacterData(SourceLocation SL,
+ bool *Invalid = nullptr) const;
/// \brief Return the column # for the specified file position.
///
@@ -1256,12 +1259,13 @@ public:
/// on a file sloc, so you must choose a spelling or expansion location
/// before calling this method.
unsigned getColumnNumber(FileID FID, unsigned FilePos,
- bool *Invalid = 0) const;
- unsigned getSpellingColumnNumber(SourceLocation Loc, bool *Invalid = 0) const;
+ bool *Invalid = nullptr) const;
+ unsigned getSpellingColumnNumber(SourceLocation Loc,
+ bool *Invalid = nullptr) const;
unsigned getExpansionColumnNumber(SourceLocation Loc,
- bool *Invalid = 0) const;
- unsigned getPresumedColumnNumber(SourceLocation Loc, bool *Invalid = 0) const;
-
+ bool *Invalid = nullptr) const;
+ unsigned getPresumedColumnNumber(SourceLocation Loc,
+ bool *Invalid = nullptr) const;
/// \brief Given a SourceLocation, return the spelling line number
/// for the position indicated.
@@ -1269,17 +1273,17 @@ public:
/// This requires building and caching a table of line offsets for the
/// MemoryBuffer, so this is not cheap: use only when about to emit a
/// diagnostic.
- unsigned getLineNumber(FileID FID, unsigned FilePos, bool *Invalid = 0) const;
- unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid = 0) const;
- unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = 0) const;
- unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = 0) const;
+ unsigned getLineNumber(FileID FID, unsigned FilePos, bool *Invalid = nullptr) const;
+ unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
+ unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
+ unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
/// \brief Return the filename or buffer identifier of the buffer the
/// location is in.
///
/// Note that this name does not respect \#line directives. Use
/// getPresumedLoc for normal clients.
- const char *getBufferName(SourceLocation Loc, bool *Invalid = 0) const;
+ const char *getBufferName(SourceLocation Loc, bool *Invalid = nullptr) const;
/// \brief Return the file characteristic of the specified source
/// location, indicating whether this is a normal file, a system
@@ -1356,7 +1360,7 @@ public:
/// FileID chunk and sets relative offset (offset of \p Loc from beginning
/// of FileID) to \p relativeOffset.
bool isInFileID(SourceLocation Loc, FileID FID,
- unsigned *RelativeOffset = 0) const {
+ unsigned *RelativeOffset = nullptr) const {
unsigned Offs = Loc.getOffset();
if (isOffsetInFileID(FID, Offs)) {
if (RelativeOffset)
@@ -1385,7 +1389,7 @@ public:
bool IsSystemHeader, bool IsExternCHeader);
/// \brief Determine if the source manager has a line table.
- bool hasLineTable() const { return LineTable != 0; }
+ bool hasLineTable() const { return LineTable != nullptr; }
/// \brief Retrieve the stored line table.
LineTableInfo &getLineTable();
@@ -1492,7 +1496,7 @@ public:
/// \brief Get a local SLocEntry. This is exposed for indexing.
const SrcMgr::SLocEntry &getLocalSLocEntry(unsigned Index,
- bool *Invalid = 0) const {
+ bool *Invalid = nullptr) const {
assert(Index < LocalSLocEntryTable.size() && "Invalid index");
return LocalSLocEntryTable[Index];
}
@@ -1502,14 +1506,15 @@ public:
/// \brief Get a loaded SLocEntry. This is exposed for indexing.
const SrcMgr::SLocEntry &getLoadedSLocEntry(unsigned Index,
- bool *Invalid = 0) const {
+ bool *Invalid = nullptr) const {
assert(Index < LoadedSLocEntryTable.size() && "Invalid index");
if (SLocEntryLoaded[Index])
return LoadedSLocEntryTable[Index];
return loadSLocEntry(Index, Invalid);
}
- const SrcMgr::SLocEntry &getSLocEntry(FileID FID, bool *Invalid = 0) const {
+ const SrcMgr::SLocEntry &getSLocEntry(FileID FID,
+ bool *Invalid = nullptr) const {
if (FID.ID == 0 || FID.ID == -1) {
if (Invalid) *Invalid = true;
return LocalSLocEntryTable[0];
@@ -1578,15 +1583,16 @@ private:
const SrcMgr::SLocEntry &loadSLocEntry(unsigned Index, bool *Invalid) const;
/// \brief Get the entry with the given unwrapped FileID.
- const SrcMgr::SLocEntry &getSLocEntryByID(int ID, bool *Invalid = 0) const {
+ const SrcMgr::SLocEntry &getSLocEntryByID(int ID,
+ bool *Invalid = nullptr) const {
assert(ID != -1 && "Using FileID sentinel value");
if (ID < 0)
return getLoadedSLocEntryByID(ID, Invalid);
return getLocalSLocEntry(static_cast<unsigned>(ID), Invalid);
}
- const SrcMgr::SLocEntry &getLoadedSLocEntryByID(int ID,
- bool *Invalid = 0) const {
+ const SrcMgr::SLocEntry &
+ getLoadedSLocEntryByID(int ID, bool *Invalid = nullptr) const {
return getLoadedSLocEntry(static_cast<unsigned>(-ID - 2), Invalid);
}
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index f9f7904cb3..29de91569d 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -735,7 +735,7 @@ public:
/// \brief Return the section to use for C++ static initialization functions.
virtual const char *getStaticInitSectionSpecifier() const {
- return 0;
+ return nullptr;
}
const LangAS::Map &getAddressSpaceMap() const {
@@ -801,7 +801,7 @@ protected:
unsigned &NumAliases) const = 0;
virtual void getGCCAddlRegNames(const AddlRegName *&Addl,
unsigned &NumAddl) const {
- Addl = 0;
+ Addl = nullptr;
NumAddl = 0;
}
virtual bool validateAsmConstraint(const char *&Name,
diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h
index f6307db991..ec2ca7050a 100644
--- a/include/clang/Basic/VirtualFileSystem.h
+++ b/include/clang/Basic/VirtualFileSystem.h
@@ -163,7 +163,7 @@ llvm::sys::fs::UniqueID getNextVirtualUniqueID();
IntrusiveRefCntPtr<FileSystem>
getVFSFromYAML(llvm::MemoryBuffer *Buffer,
llvm::SourceMgr::DiagHandlerTy DiagHandler,
- void *DiagContext = 0,
+ void *DiagContext = nullptr,
IntrusiveRefCntPtr<FileSystem> ExternalFS = getRealFileSystem());
} // end namespace vfs