summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/SourceManager.h40
-rw-r--r--include/clang/Frontend/ASTUnit.h2
-rw-r--r--include/clang/Lex/PreprocessorOptions.h18
3 files changed, 28 insertions, 32 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 585d13855e..bece66d427 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -104,7 +104,7 @@ namespace SrcMgr {
///
/// This is owned by the ContentCache object. The bits indicate
/// whether the buffer is invalid.
- mutable llvm::PointerIntPair<const llvm::MemoryBuffer *, 2> Buffer;
+ mutable llvm::PointerIntPair<llvm::MemoryBuffer *, 2> Buffer;
public:
/// \brief Reference to the file entry representing this ContentCache.
@@ -182,10 +182,10 @@ namespace SrcMgr {
/// will be emitted at.
///
/// \param Invalid If non-NULL, will be set \c true if an error occurred.
- const llvm::MemoryBuffer *getBuffer(DiagnosticsEngine &Diag,
- const SourceManager &SM,
- SourceLocation Loc = SourceLocation(),
- bool *Invalid = nullptr) const;
+ llvm::MemoryBuffer *getBuffer(DiagnosticsEngine &Diag,
+ const SourceManager &SM,
+ SourceLocation Loc = SourceLocation(),
+ bool *Invalid = nullptr) const;
/// \brief Returns the size of the content encapsulated by this
/// ContentCache.
@@ -205,7 +205,7 @@ namespace SrcMgr {
/// this content cache. This is used for performance analysis.
llvm::MemoryBuffer::BufferKind getMemoryBufferKind() const;
- void setBuffer(const llvm::MemoryBuffer *B) {
+ void setBuffer(llvm::MemoryBuffer *B) {
assert(!Buffer.getPointer() && "MemoryBuffer already set.");
Buffer.setPointer(B);
Buffer.setInt(false);
@@ -213,13 +213,11 @@ namespace SrcMgr {
/// \brief Get the underlying buffer, returning NULL if the buffer is not
/// yet available.
- const llvm::MemoryBuffer *getRawBuffer() const {
- return Buffer.getPointer();
- }
+ llvm::MemoryBuffer *getRawBuffer() const { return Buffer.getPointer(); }
/// \brief Replace the existing buffer (which will be deleted)
/// with the given buffer.
- void replaceBuffer(const llvm::MemoryBuffer *B, bool DoNotFree = false);
+ void replaceBuffer(llvm::MemoryBuffer *B, bool DoNotFree = false);
/// \brief Determine whether the buffer itself is invalid.
bool isBufferInvalid() const {
@@ -790,7 +788,7 @@ public:
///
/// This does no caching of the buffer and takes ownership of the
/// MemoryBuffer, so only pass a MemoryBuffer to this once.
- FileID createFileID(const llvm::MemoryBuffer *Buffer,
+ FileID createFileID(llvm::MemoryBuffer *Buffer,
SrcMgr::CharacteristicKind FileCharacter = SrcMgr::C_User,
int LoadedID = 0, unsigned LoadedOffset = 0,
SourceLocation IncludeLoc = SourceLocation()) {
@@ -820,8 +818,8 @@ 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 = nullptr);
+ llvm::MemoryBuffer *getMemoryBufferForFile(const FileEntry *File,
+ bool *Invalid = nullptr);
/// \brief Override the contents of the given source file by providing an
/// already-allocated buffer.
@@ -834,8 +832,7 @@ public:
/// \param DoNotFree If true, then the buffer will not be freed when the
/// source manager is destroyed.
void overrideFileContents(const FileEntry *SourceFile,
- const llvm::MemoryBuffer *Buffer,
- bool DoNotFree = false);
+ llvm::MemoryBuffer *Buffer, bool DoNotFree = false);
/// \brief Override the given source file with another one.
///
@@ -872,8 +869,8 @@ 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 = nullptr) const {
+ llvm::MemoryBuffer *getBuffer(FileID FID, SourceLocation Loc,
+ bool *Invalid = nullptr) const {
bool MyInvalid = false;
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid);
if (MyInvalid || !Entry.isFile()) {
@@ -887,8 +884,7 @@ public:
Invalid);
}
- const llvm::MemoryBuffer *getBuffer(FileID FID,
- bool *Invalid = nullptr) const {
+ llvm::MemoryBuffer *getBuffer(FileID FID, bool *Invalid = nullptr) const {
bool MyInvalid = false;
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid);
if (MyInvalid || !Entry.isFile()) {
@@ -1557,7 +1553,7 @@ public:
}
private:
- const llvm::MemoryBuffer *getFakeBufferForRecovery() const;
+ llvm::MemoryBuffer *getFakeBufferForRecovery() const;
const SrcMgr::ContentCache *getFakeContentCacheForRecovery() const;
const SrcMgr::SLocEntry &loadSLocEntry(unsigned Index, bool *Invalid) const;
@@ -1626,8 +1622,8 @@ private:
bool isSystemFile = false);
/// \brief Create a new ContentCache for the specified memory buffer.
- const SrcMgr::ContentCache*
- createMemBufferContentCache(const llvm::MemoryBuffer *Buf);
+ const SrcMgr::ContentCache *
+ createMemBufferContentCache(llvm::MemoryBuffer *Buf);
FileID getFileIDSlow(unsigned SLocOffset) const;
FileID getFileIDLocal(unsigned SLocOffset) const;
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h
index 3d7d0f2796..d5d6d49bde 100644
--- a/include/clang/Frontend/ASTUnit.h
+++ b/include/clang/Frontend/ASTUnit.h
@@ -692,7 +692,7 @@ public:
/// \brief A mapping from a file name to the memory buffer that stores the
/// remapped contents of that file.
- typedef std::pair<std::string, const llvm::MemoryBuffer *> RemappedFile;
+ typedef std::pair<std::string, llvm::MemoryBuffer *> RemappedFile;
/// \brief Create a ASTUnit. Gets ownership of the passed CompilerInvocation.
static ASTUnit *create(CompilerInvocation *CI,
diff --git a/include/clang/Lex/PreprocessorOptions.h b/include/clang/Lex/PreprocessorOptions.h
index eba2a13342..1ab5a3e8eb 100644
--- a/include/clang/Lex/PreprocessorOptions.h
+++ b/include/clang/Lex/PreprocessorOptions.h
@@ -102,9 +102,8 @@ public:
/// \brief The set of file-to-buffer remappings, which take existing files
/// on the system (the first part of each pair) and gives them the contents
/// of the specified memory buffer (the second part of each pair).
- std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >
- RemappedFileBuffers;
-
+ std::vector<std::pair<std::string, llvm::MemoryBuffer *>> RemappedFileBuffers;
+
/// \brief Whether the compiler instance should retain (i.e., not free)
/// the buffers associated with remapped files.
///
@@ -157,10 +156,11 @@ public:
return RemappedFiles.end();
}
- typedef std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >::
- iterator remapped_file_buffer_iterator;
- typedef std::vector<std::pair<std::string, const llvm::MemoryBuffer *> >::
- const_iterator const_remapped_file_buffer_iterator;
+ typedef std::vector<std::pair<std::string, llvm::MemoryBuffer *>>::iterator
+ remapped_file_buffer_iterator;
+ typedef std::vector<
+ std::pair<std::string, llvm::MemoryBuffer *>>::const_iterator
+ const_remapped_file_buffer_iterator;
remapped_file_buffer_iterator remapped_file_buffer_begin() {
return RemappedFileBuffers.begin();
}
@@ -197,8 +197,8 @@ public:
remapped_file_iterator eraseRemappedFile(remapped_file_iterator Remapped) {
return RemappedFiles.erase(Remapped);
}
-
- void addRemappedFile(StringRef From, const llvm::MemoryBuffer * To) {
+
+ void addRemappedFile(StringRef From, llvm::MemoryBuffer *To) {
RemappedFileBuffers.push_back(std::make_pair(From, To));
}