[cfe-commits] r62315 - in /cfe/trunk: docs/InternalsManual.html include/clang/Basic/SourceManager.h lib/AST/ASTContext.cpp lib/Basic/SourceManager.cpp
Chris Lattner
sabre at nondot.org
Thu Jan 15 23:15:35 PST 2009
Author: lattner
Date: Fri Jan 16 01:15:35 2009
New Revision: 62315
URL: http://llvm.org/viewvc/llvm-project?rev=62315&view=rev
Log:
rename "virtual location" of a macro to "instantiation location".
Modified:
cfe/trunk/docs/InternalsManual.html
cfe/trunk/include/clang/Basic/SourceManager.h
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/lib/Basic/SourceManager.cpp
Modified: cfe/trunk/docs/InternalsManual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/InternalsManual.html?rev=62315&r1=62314&r2=62315&view=diff
==============================================================================
--- cfe/trunk/docs/InternalsManual.html (original)
+++ cfe/trunk/docs/InternalsManual.html Fri Jan 16 01:15:35 2009
@@ -437,7 +437,7 @@
<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
Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=62315&r1=62314&r2=62315&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Fri Jan 16 01:15:35 2009
@@ -187,9 +187,9 @@
/// 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 @@
/// 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 @@
// 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
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=62315&r1=62314&r2=62315&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Jan 16 01:15:35 2009
@@ -2488,6 +2488,7 @@
//===----------------------------------------------------------------------===//
// Integer Predicates
//===----------------------------------------------------------------------===//
+
unsigned ASTContext::getIntWidth(QualType T) {
if (T == BoolTy)
return 1;
Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=62315&r1=62314&r2=62315&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Fri Jan 16 01:15:35 2009
@@ -166,7 +166,7 @@
// 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 @@
}
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;
}
More information about the cfe-commits
mailing list