summaryrefslogtreecommitdiffstats
path: root/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-01-15 15:39:40 +0000
commita3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824 (patch)
treea6082d4d1d1e9ddaea09a6a04bb4a47da95d642d /lib/Lex/Pragma.cpp
parentbb1e3bc1e0be2b8f891db46457a8943451bf4d8b (diff)
downloadFreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.zip
FreeBSD-src-a3fa5c7f1b5e2ba4d6ec033dc0e2376326b05824.tar.gz
Update clang to r93512.
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r--lib/Lex/Pragma.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index 8b46f71..856b3bd 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -286,26 +286,25 @@ void Preprocessor::HandlePragmaDependency(Token &DependencyTok) {
return;
// Reserve a buffer to get the spelling.
- llvm::SmallVector<char, 128> FilenameBuffer;
+ llvm::SmallString<128> FilenameBuffer;
FilenameBuffer.resize(FilenameTok.getLength());
const char *FilenameStart = &FilenameBuffer[0];
unsigned Len = getSpelling(FilenameTok, FilenameStart);
- const char *FilenameEnd = FilenameStart+Len;
- bool isAngled = GetIncludeFilenameSpelling(FilenameTok.getLocation(),
- FilenameStart, FilenameEnd);
+ llvm::StringRef Filename(FilenameStart, Len);
+ bool isAngled =
+ GetIncludeFilenameSpelling(FilenameTok.getLocation(), Filename);
// If GetIncludeFilenameSpelling set the start ptr to null, there was an
// error.
- if (FilenameStart == 0)
+ if (Filename.empty())
return;
// Search include directories for this file.
const DirectoryLookup *CurDir;
- const FileEntry *File = LookupFile(FilenameStart, FilenameEnd,
+ const FileEntry *File = LookupFile(Filename, FilenameTok.getLocation(),
isAngled, 0, CurDir);
if (File == 0) {
- Diag(FilenameTok, diag::err_pp_file_not_found)
- << std::string(FilenameStart, FilenameEnd);
+ Diag(FilenameTok, diag::err_pp_file_not_found) << Filename;
return;
}
OpenPOWER on IntegriCloud