]> granicus.if.org Git - clang/commitdiff
rename "virtual location" of a macro to "instantiation location".
authorChris Lattner <sabre@nondot.org>
Fri, 16 Jan 2009 07:15:35 +0000 (07:15 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 16 Jan 2009 07:15:35 +0000 (07:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62315 91177308-0d34-0410-b5e6-96231b3b80d8

docs/InternalsManual.html
include/clang/Basic/SourceManager.h
lib/AST/ASTContext.cpp
lib/Basic/SourceManager.cpp

index 3e41d90ab536299846f0c87d31fa5c186db857af..2fcadb7a79c7beba7c34bde67993a6bfc06f11d9 100644 (file)
@@ -437,7 +437,7 @@ source code of the program.  Important design points include:</p>
 
 <p>In practice, the SourceLocation works together with the SourceManager class
 to encode two pieces of information about a location: it's spelling location
-and it's virtual location.  For most tokens, these will be the same.  However,
+and it's instantiation location.  For most tokens, these will be the same.  However,
 for a macro expansion (or tokens that came from a _Pragma directive) these will
 describe the location of the characters corresponding to the token and the
 location where the token was used (i.e. the macro instantiation point or the 
index bc8c85418752b40656f29c50ac1f64032bb70e90..f7e160deeb5e2fbbc70cbbb2be28520c48c4268b 100644 (file)
@@ -187,9 +187,9 @@ namespace SrcMgr {
   /// the token came from.  An actual macro SourceLocation stores deltas from
   /// these positions.
   class MacroIDInfo {
-    SourceLocation VirtualLoc, SpellingLoc;
+    SourceLocation InstantiationLoc, SpellingLoc;
   public:
-    SourceLocation getVirtualLoc() const { return VirtualLoc; }
+    SourceLocation getInstantiationLoc() const { return InstantiationLoc; }
     SourceLocation getSpellingLoc() const { return SpellingLoc; }
     
     /// get - Return a MacroID for a macro expansion.  VL specifies
@@ -198,7 +198,7 @@ namespace SrcMgr {
     /// come from).  Both VL and PL refer to normal File SLocs.
     static MacroIDInfo get(SourceLocation VL, SourceLocation SL) {
       MacroIDInfo X;
-      X.VirtualLoc = VL;
+      X.InstantiationLoc = VL;
       X.SpellingLoc = SL;
       return X;
     }
@@ -384,7 +384,7 @@ public:
     // File locations work.
     if (Loc.isFileID()) return Loc;
     
-    return MacroIDs[Loc.getMacroID()].getVirtualLoc();
+    return MacroIDs[Loc.getMacroID()].getInstantiationLoc();
   }
   
   /// getSpellingLoc - Given a SourceLocation object, return the spelling
index c64c1010bee729b90fbb070e71e6da91459e2ef0..fe868d076835f86ae9ac85ff597c6eb2b67fe7c8 100644 (file)
@@ -2488,6 +2488,7 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS) {
 //===----------------------------------------------------------------------===//
 //                         Integer Predicates
 //===----------------------------------------------------------------------===//
+
 unsigned ASTContext::getIntWidth(QualType T) {
   if (T == BoolTy)
     return 1;
index 719d29aa795ed82e693767f723aa27074eb86a9a..55e8c4aee78f179555acb143fe9bd919625611c1 100644 (file)
@@ -166,7 +166,7 @@ SourceLocation SourceManager::getInstantiationLoc(SourceLocation SpellingLoc,
     
     // The instanitation point and source SpellingLoc have to exactly match to
     // reuse (for now).  We could allow "nearby" instantiations in the future.
-    if (LastOne.getVirtualLoc() != InstantLoc ||
+    if (LastOne.getInstantiationLoc() != InstantLoc ||
         LastOne.getSpellingLoc().getFileID() != SpellingLoc.getFileID())
       continue;
   
@@ -480,13 +480,13 @@ FileIDInfo FileIDInfo::ReadVal(llvm::Deserializer& D) {
 }
 
 void MacroIDInfo::Emit(llvm::Serializer& S) const {
-  S.Emit(VirtualLoc);
+  S.Emit(InstantiationLoc);
   S.Emit(SpellingLoc);
 }
 
 MacroIDInfo MacroIDInfo::ReadVal(llvm::Deserializer& D) {
   MacroIDInfo I;
-  I.VirtualLoc = SourceLocation::ReadVal(D);
+  I.InstantiationLoc = SourceLocation::ReadVal(D);
   I.SpellingLoc = SourceLocation::ReadVal(D);
   return I;
 }