[cfe-commits] r38553 - in /cfe/cfe/trunk: Driver/clang.cpp Lex/MacroExpander.cpp Lex/Preprocessor.cpp include/clang/Lex/LexerToken.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:22:32 PDT 2007


Author: sabre
Date: Wed Jul 11 11:22:32 2007
New Revision: 38553

URL: http://llvm.org/viewvc/llvm-project?rev=38553&view=rev
Log:
Rename LexerToken::getSourceLocation -> getLocation

Modified:
    cfe/cfe/trunk/Driver/clang.cpp
    cfe/cfe/trunk/Lex/MacroExpander.cpp
    cfe/cfe/trunk/Lex/Preprocessor.cpp
    cfe/cfe/trunk/include/clang/Lex/LexerToken.h

Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=38553&r1=38552&r2=38553&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:22:32 2007
@@ -607,7 +607,7 @@
       // Print out space characters so that the first token on a line is
       // indented for easy reading.
       unsigned ColNo = 
-        PP.getSourceManager().getColumnNumber(Tok.getSourceLocation());
+        PP.getSourceManager().getColumnNumber(Tok.getLocation());
       
       // This hack prevents stuff like:
       // #define HASH #

Modified: cfe/cfe/trunk/Lex/MacroExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/MacroExpander.cpp?rev=38553&r1=38552&r2=38553&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/MacroExpander.cpp (original)
+++ cfe/cfe/trunk/Lex/MacroExpander.cpp Wed Jul 11 11:22:32 2007
@@ -19,7 +19,7 @@
 
 MacroExpander::MacroExpander(LexerToken &Tok, Preprocessor &pp)
   : Macro(*Tok.getIdentifierInfo()->getMacroInfo()), PP(pp), CurToken(0),
-    InstantiateLoc(Tok.getSourceLocation()),
+    InstantiateLoc(Tok.getLocation()),
     AtStartOfLine(Tok.isAtStartOfLine()),
     HasLeadingSpace(Tok.hasLeadingSpace()) {
 }

Modified: cfe/cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Preprocessor.cpp?rev=38553&r1=38552&r2=38553&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/cfe/trunk/Lex/Preprocessor.cpp Wed Jul 11 11:22:32 2007
@@ -126,7 +126,7 @@
   if (isSkipping() && Diagnostic::isNoteWarningOrExtension(DiagID))
     return;
   
-  Diag(Tok.getSourceLocation(), DiagID, Msg);
+  Diag(Tok.getLocation(), DiagID, Msg);
 }
 
 
@@ -141,7 +141,7 @@
   if (Tok.hasLeadingSpace())
     std::cerr << " [LeadingSpace]";
   if (Tok.needsCleaning()) {
-    const char *Start = SourceMgr.getCharacterData(Tok.getSourceLocation());
+    const char *Start = SourceMgr.getCharacterData(Tok.getLocation());
     std::cerr << " [UnClean='" << std::string(Start, Start+Tok.getLength())
               << "']";
   }
@@ -202,7 +202,7 @@
   assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
   
   // If this token contains nothing interesting, return it directly.
-  const char *TokStart = SourceMgr.getCharacterData(Tok.getSourceLocation());
+  const char *TokStart = SourceMgr.getCharacterData(Tok.getLocation());
   assert(TokStart && "Token has invalid location!");
   if (!Tok.needsCleaning())
     return std::string(TokStart, TokStart+Tok.getLength());
@@ -229,7 +229,7 @@
 unsigned Preprocessor::getSpelling(const LexerToken &Tok, char *Buffer) const {
   assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
   
-  const char *TokStart = SourceMgr.getCharacterData(Tok.getSourceLocation());
+  const char *TokStart = SourceMgr.getCharacterData(Tok.getLocation());
   assert(TokStart && "Token has invalid location!");
 
   // If this token contains nothing interesting, return it directly.
@@ -349,7 +349,7 @@
 void Preprocessor::EnterMacro(LexerToken &Tok) {
   IdentifierTokenInfo *Identifier = Tok.getIdentifierInfo();
   MacroInfo &MI = *Identifier->getMacroInfo();
-  SourceLocation ExpandLoc = Tok.getSourceLocation();
+  SourceLocation ExpandLoc = Tok.getLocation();
   //unsigned MacroID = SourceMgr.getMacroID(Identifier, ExpandLoc);
   if (CurLexer) {
     IncludeStack.push_back(IncludeStackInfo(CurLexer, CurNextDirLookup));
@@ -649,7 +649,7 @@
     // allows us to avoid computing the spelling for #define/#undef and other
     // common directives.
     // FIXME: This should use a bit in the identifier information!
-    char FirstChar = SourceMgr.getCharacterData(Tok.getSourceLocation())[0];
+    char FirstChar = SourceMgr.getCharacterData(Tok.getLocation())[0];
     if (FirstChar >= 'a' && FirstChar <= 'z' && 
         FirstChar != 'i' && FirstChar != 'e') {
       CurLexer->ParsingPreprocessorDirective = false;
@@ -664,8 +664,7 @@
         // We know the entire #if/#ifdef/#ifndef block will be skipped, don't
         // bother parsing the condition.
         DiscardUntilEndOfDirective();
-        CurLexer->pushConditionalLevel(Tok.getSourceLocation(),
-                                       /*wasskipping*/true,
+        CurLexer->pushConditionalLevel(Tok.getLocation(), /*wasskipping*/true,
                                        /*foundnonskip*/false,
                                        /*fnddelse*/false);
       }
@@ -939,7 +938,7 @@
 
   // Look up the file, create a File ID for it.
   unsigned FileID = 
-    SourceMgr.createFileID(File, FilenameTok.getSourceLocation());
+    SourceMgr.createFileID(File, FilenameTok.getLocation());
   if (FileID == 0)
     return Diag(FilenameTok, diag::err_pp_file_not_found);
 
@@ -989,7 +988,7 @@
   if (MacroNameTok.getKind() == tok::eom)
     return;
   
-  MacroInfo *MI = new MacroInfo(MacroNameTok.getSourceLocation());
+  MacroInfo *MI = new MacroInfo(MacroNameTok.getLocation());
   
   LexerToken Tok;
   LexUnexpandedToken(Tok);
@@ -1090,12 +1089,11 @@
   // Should we include the stuff contained by this directive?
   if (!MacroNameTok.getIdentifierInfo()->getMacroInfo() == isIfndef) {
     // Yes, remember that we are inside a conditional, then lex the next token.
-    CurLexer->pushConditionalLevel(DirectiveTok.getSourceLocation(),
-                                   /*wasskip*/false,
+    CurLexer->pushConditionalLevel(DirectiveTok.getLocation(), /*wasskip*/false,
                                    /*foundnonskip*/true, /*foundelse*/false);
   } else {
     // No, skip the contents of this block and return the first token after it.
-    SkipExcludedConditionalBlock(DirectiveTok.getSourceLocation(),
+    SkipExcludedConditionalBlock(DirectiveTok.getLocation(),
                                  /*Foundnonskip*/false, 
                                  /*FoundElse*/false);
   }
@@ -1112,13 +1110,11 @@
   // Should we include the stuff contained by this directive?
   if (ConditionalTrue) {
     // Yes, remember that we are inside a conditional, then lex the next token.
-    CurLexer->pushConditionalLevel(IfToken.getSourceLocation(),
-                                   /*wasskip*/false,
+    CurLexer->pushConditionalLevel(IfToken.getLocation(), /*wasskip*/false,
                                    /*foundnonskip*/true, /*foundelse*/false);
   } else {
     // No, skip the contents of this block and return the first token after it.
-    SkipExcludedConditionalBlock(IfToken.getSourceLocation(),
-                                 /*Foundnonskip*/false, 
+    SkipExcludedConditionalBlock(IfToken.getLocation(), /*Foundnonskip*/false, 
                                  /*FoundElse*/false);
   }
 }

Modified: cfe/cfe/trunk/include/clang/Lex/LexerToken.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/LexerToken.h?rev=38553&r1=38552&r2=38553&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/LexerToken.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/LexerToken.h Wed Jul 11 11:22:32 2007
@@ -57,7 +57,7 @@
 
   /// getLocation - Return a source location identifier for the specified
   /// offset in the current file.
-  SourceLocation getSourceLocation() const { return Loc; }
+  SourceLocation getLocation() const { return Loc; }
   unsigned getLength() const { return Length; }
 
   void SetLocation(SourceLocation L) { Loc = L; }





More information about the cfe-commits mailing list