Просмотр исходного кода

elimiante FullSourceLoc::getCanonicalFileID


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62374 91177308-0d34-0410-b5e6-96231b3b80d8
Chris Lattner 16 лет назад
Родитель
Сommit
4abb87ef14
3 измененных файлов с 6 добавлено и 15 удалено
  1. 0 2
      include/clang/Basic/SourceLocation.h
  2. 2 7
      lib/Basic/SourceLocation.cpp
  3. 4 6
      lib/Driver/HTMLDiagnostics.cpp

+ 0 - 2
include/clang/Basic/SourceLocation.h

@@ -258,8 +258,6 @@ public:
 
 
   bool isInSystemHeader() const;
   bool isInSystemHeader() const;
   
   
-  unsigned getCanonicalFileID() const;
-  
   bool operator==(const FullSourceLoc& RHS) const {
   bool operator==(const FullSourceLoc& RHS) const {
     return SrcMgr == RHS.SrcMgr && Loc == RHS.Loc;
     return SrcMgr == RHS.SrcMgr && Loc == RHS.Loc;
   }
   }

+ 2 - 7
lib/Basic/SourceLocation.cpp

@@ -98,9 +98,8 @@ bool FullSourceLoc::isInSystemHeader() const {
   return SrcMgr->isInSystemHeader(Loc);
   return SrcMgr->isInSystemHeader(Loc);
 }
 }
 
 
-
-const char * FullSourceLoc::getCharacterData() const {
-  assert (isValid());
+const char *FullSourceLoc::getCharacterData() const {
+  assert(isValid());
   return SrcMgr->getCharacterData(Loc);
   return SrcMgr->getCharacterData(Loc);
 }
 }
 
 
@@ -109,10 +108,6 @@ const llvm::MemoryBuffer* FullSourceLoc::getBuffer() const {
   return SrcMgr->getBuffer(Loc.getFileID());
   return SrcMgr->getBuffer(Loc.getFileID());
 }
 }
 
 
-unsigned FullSourceLoc::getCanonicalFileID() const {
-  return SrcMgr->getCanonicalFileID(Loc);
-}
-
 void FullSourceLoc::dump() const {
 void FullSourceLoc::dump() const {
   if (!isValid()) {
   if (!isValid()) {
     fprintf(stderr, "Invalid Loc\n");
     fprintf(stderr, "Invalid Loc\n");

+ 4 - 6
lib/Driver/HTMLDiagnostics.cpp

@@ -124,8 +124,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
   if (noDir)
   if (noDir)
     return;
     return;
   
   
-  SourceManager& SMgr = D.begin()->getLocation().getManager();
-
+  SourceManager &SMgr = D.begin()->getLocation().getManager();
   unsigned FileID = 0;
   unsigned FileID = 0;
   bool FileIDInitialized = false;
   bool FileIDInitialized = false;
   
   
@@ -134,10 +133,9 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
     FullSourceLoc L = I->getLocation().getInstantiationLoc();
     FullSourceLoc L = I->getLocation().getInstantiationLoc();
     
     
     if (!FileIDInitialized) {
     if (!FileIDInitialized) {
-      FileID = L.getCanonicalFileID();
+      FileID = SMgr.getCanonicalFileID(L.getLocation());
       FileIDInitialized = true;
       FileIDInitialized = true;
-    }
-    else if (L.getCanonicalFileID() != FileID)
+    } else if (SMgr.getCanonicalFileID(L.getLocation()) != FileID)
       return; // FIXME: Emit a warning?
       return; // FIXME: Emit a warning?
     
     
     // Check the source ranges.
     // Check the source ranges.
@@ -345,7 +343,7 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, unsigned BugFileID,
 
 
   assert (&LPos.getManager() == &SM && "SourceManagers are different!");
   assert (&LPos.getManager() == &SM && "SourceManagers are different!");
   
   
-  if (LPos.getCanonicalFileID() != BugFileID)
+  if (SM.getCanonicalFileID(LPos.getLocation()) != BugFileID)
     return;
     return;
   
   
   const llvm::MemoryBuffer *Buf = SM.getBuffer(FileID);
   const llvm::MemoryBuffer *Buf = SM.getBuffer(FileID);