From 4488835d1c78221553909447cf87d7e4ff7f99fb Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 29 Jul 2013 21:26:52 +0000 Subject: [PATCH] Update for llvm api change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187379 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/SourceManager.cpp | 13 ++++++++----- lib/Frontend/ASTUnit.cpp | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index aba3e150f2..755675ff1d 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -1580,11 +1580,12 @@ unsigned SourceManager::getFileIDSize(FileID FID) const { /// /// This routine involves a system call, and therefore should only be used /// in non-performance-critical code. -static Optional getActualFileUID(const FileEntry *File) { +static Optional +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(const FileEntry *SourceFile) const { // First, check the main file ID, since it is common to look for a // location in the main file. - Optional SourceFileUID; + Optional SourceFileUID; Optional SourceFileName; if (!MainFileID.isInvalid()) { bool Invalid = false; @@ -1640,7 +1641,8 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { if (*SourceFileName == llvm::sys::path::filename(MainFile->getName())) { SourceFileUID = getActualFileUID(SourceFile); if (SourceFileUID) { - if (Optional MainFileUID = getActualFileUID(MainFile)) { + if (Optional MainFileUID = + getActualFileUID(MainFile)) { if (*SourceFileUID == *MainFileUID) { FirstFID = MainFileID; SourceFile = MainFile; @@ -1703,7 +1705,8 @@ FileID SourceManager::translateFile(const FileEntry *SourceFile) const { const FileEntry *Entry =FileContentCache? FileContentCache->OrigEntry : 0; if (Entry && *SourceFileName == llvm::sys::path::filename(Entry->getName())) { - if (Optional EntryUID = getActualFileUID(Entry)) { + if (Optional EntryUID = + getActualFileUID(Entry)) { if (*SourceFileUID == *EntryUID) { FirstFID = FileID::get(I); SourceFile = Entry; diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 909186118f..72f5d4c18e 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -1264,7 +1264,7 @@ ASTUnit::ComputePreamble(CompilerInvocation &Invocation, // (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(CompilerInvocation &Invocation, 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(CompilerInvocation &Invocation, 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 File, unsigned Line, unsigned Column, 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 -- 2.40.0