summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-05 22:42:27 +0000
committerChris Lattner <sabre@nondot.org>2010-04-05 22:42:27 +0000
commit58c79341ab977592c79d75e362383c3916a49173 (patch)
treeea65a5fe6d3d4825ba71dae3d7c95ec2e1e7b138 /clang/lib/Lex/Preprocessor.cpp
parentb535782fc44fa2e4e31476b7d0ff7e8e64092176 (diff)
downloadbcm5719-llvm-58c79341ab977592c79d75e362383c3916a49173.tar.gz
bcm5719-llvm-58c79341ab977592c79d75e362383c3916a49173.zip
Match MemoryBuffer API changes.
llvm-svn: 100484
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 8b4b1ddf414..4598383c1c9 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -258,9 +258,10 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File,
// Truncate the buffer.
if (Position < Buffer->getBufferEnd()) {
+ llvm::StringRef Data(Buffer->getBufferStart(),
+ Position-Buffer->getBufferStart());
MemoryBuffer *TruncatedBuffer
- = MemoryBuffer::getMemBufferCopy(Buffer->getBufferStart(), Position,
- Buffer->getBufferIdentifier());
+ = MemoryBuffer::getMemBufferCopy(Data, Buffer->getBufferIdentifier());
SourceMgr.overrideFileContents(File, TruncatedBuffer);
}
@@ -508,9 +509,7 @@ bool Preprocessor::EnterMainSourceFile() {
// Preprocess Predefines to populate the initial preprocessor state.
llvm::MemoryBuffer *SB =
- llvm::MemoryBuffer::getMemBufferCopy(Predefines.data(),
- Predefines.data() + Predefines.size(),
- "<built-in>");
+ llvm::MemoryBuffer::getMemBufferCopy(Predefines, "<built-in>");
assert(SB && "Cannot fail to create predefined source buffer");
FileID FID = SourceMgr.createFileIDForMemBuffer(SB);
assert(!FID.isInvalid() && "Could not create FileID for predefines?");
OpenPOWER on IntegriCloud