r187379 - Update for llvm api change.
Rafael Espindola
rafael.espindola at gmail.com
Mon Jul 29 14:26:52 PDT 2013
Author: rafael
Date: Mon Jul 29 16:26:52 2013
New Revision: 187379
URL: http://llvm.org/viewvc/llvm-project?rev=187379&view=rev
Log:
Update for llvm api change.
Modified:
cfe/trunk/lib/Basic/SourceManager.cpp
cfe/trunk/lib/Frontend/ASTUnit.cpp
Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=187379&r1=187378&r2=187379&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Mon Jul 29 16:26:52 2013
@@ -1580,11 +1580,12 @@ unsigned SourceManager::getFileIDSize(Fi
///
/// This routine involves a system call, and therefore should only be used
/// in non-performance-critical code.
-static Optional<uint64_t> getActualFileUID(const FileEntry *File) {
+static Optional<llvm::sys::fs::UniqueID>
+getActualFileUID(const FileEntry *File) {
if (!File)
return None;
- uint64_t ID;
+ llvm::sys::fs::UniqueID ID;
if (llvm::sys::fs::getUniqueID(File->getName(), ID))
return None;
@@ -1617,7 +1618,7 @@ FileID SourceManager::translateFile(cons
// First, check the main file ID, since it is common to look for a
// location in the main file.
- Optional<uint64_t> SourceFileUID;
+ Optional<llvm::sys::fs::UniqueID> SourceFileUID;
Optional<StringRef> SourceFileName;
if (!MainFileID.isInvalid()) {
bool Invalid = false;
@@ -1640,7 +1641,8 @@ FileID SourceManager::translateFile(cons
if (*SourceFileName == llvm::sys::path::filename(MainFile->getName())) {
SourceFileUID = getActualFileUID(SourceFile);
if (SourceFileUID) {
- if (Optional<uint64_t> MainFileUID = getActualFileUID(MainFile)) {
+ if (Optional<llvm::sys::fs::UniqueID> MainFileUID =
+ getActualFileUID(MainFile)) {
if (*SourceFileUID == *MainFileUID) {
FirstFID = MainFileID;
SourceFile = MainFile;
@@ -1703,7 +1705,8 @@ FileID SourceManager::translateFile(cons
const FileEntry *Entry =FileContentCache? FileContentCache->OrigEntry : 0;
if (Entry &&
*SourceFileName == llvm::sys::path::filename(Entry->getName())) {
- if (Optional<uint64_t> EntryUID = getActualFileUID(Entry)) {
+ if (Optional<llvm::sys::fs::UniqueID> EntryUID =
+ getActualFileUID(Entry)) {
if (*SourceFileUID == *EntryUID) {
FirstFID = FileID::get(I);
SourceFile = Entry;
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=187379&r1=187378&r2=187379&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Mon Jul 29 16:26:52 2013
@@ -1264,7 +1264,7 @@ ASTUnit::ComputePreamble(CompilerInvocat
// (to a memory buffer).
llvm::MemoryBuffer *Buffer = 0;
std::string MainFilePath(FrontendOpts.Inputs[0].getFile());
- uint64_t MainFileID;
+ llvm::sys::fs::UniqueID MainFileID;
if (!llvm::sys::fs::getUniqueID(MainFilePath, MainFileID)) {
// Check whether there is a file-file remapping of the main file
for (PreprocessorOptions::remapped_file_iterator
@@ -1273,7 +1273,7 @@ ASTUnit::ComputePreamble(CompilerInvocat
M != E;
++M) {
std::string MPath(M->first);
- uint64_t MID;
+ llvm::sys::fs::UniqueID MID;
if (!llvm::sys::fs::getUniqueID(MPath, MID)) {
if (MainFileID == MID) {
// We found a remapping. Try to load the resulting, remapped source.
@@ -1299,7 +1299,7 @@ ASTUnit::ComputePreamble(CompilerInvocat
M != E;
++M) {
std::string MPath(M->first);
- uint64_t MID;
+ llvm::sys::fs::UniqueID MID;
if (!llvm::sys::fs::getUniqueID(MPath, MID)) {
if (MainFileID == MID) {
// We found a remapping.
@@ -2470,11 +2470,11 @@ void ASTUnit::CodeComplete(StringRef Fil
llvm::MemoryBuffer *OverrideMainBuffer = 0;
if (!getPreambleFile(this).empty()) {
std::string CompleteFilePath(File);
- uint64_t CompleteFileID;
+ llvm::sys::fs::UniqueID CompleteFileID;
if (!llvm::sys::fs::getUniqueID(CompleteFilePath, CompleteFileID)) {
std::string MainPath(OriginalSourceFile);
- uint64_t MainID;
+ llvm::sys::fs::UniqueID MainID;
if (!llvm::sys::fs::getUniqueID(MainPath, MainID)) {
if (CompleteFileID == MainID && Line > 1)
OverrideMainBuffer
More information about the cfe-commits
mailing list