[cfe-commits] r98674 - in /cfe/trunk: include/clang/Basic/SourceLocation.h lib/Basic/SourceLocation.cpp

Douglas Gregor dgregor at apple.com
Tue Mar 16 13:53:17 PDT 2010


Author: dgregor
Date: Tue Mar 16 15:53:17 2010
New Revision: 98674

URL: http://llvm.org/viewvc/llvm-project?rev=98674&view=rev
Log:
Update get*LineNumber() and get*ColumnNumber() functions to pass the
Invalid bit through; there are no safety-critical callers of these
functions.

Modified:
    cfe/trunk/include/clang/Basic/SourceLocation.h
    cfe/trunk/lib/Basic/SourceLocation.cpp

Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=98674&r1=98673&r2=98674&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
+++ cfe/trunk/include/clang/Basic/SourceLocation.h Tue Mar 16 15:53:17 2010
@@ -200,11 +200,11 @@
   FullSourceLoc getInstantiationLoc() const;
   FullSourceLoc getSpellingLoc() const;
 
-  unsigned getInstantiationLineNumber() const;
-  unsigned getInstantiationColumnNumber() const;
+  unsigned getInstantiationLineNumber(bool *Invalid = 0) const;
+  unsigned getInstantiationColumnNumber(bool *Invalid = 0) const;
 
-  unsigned getSpellingLineNumber() const;
-  unsigned getSpellingColumnNumber() const;
+  unsigned getSpellingLineNumber(bool *Invalid = 0) const;
+  unsigned getSpellingColumnNumber(bool *Invalid = 0) const;
 
   const char *getCharacterData(bool *Invalid = 0) const;
 

Modified: cfe/trunk/lib/Basic/SourceLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceLocation.cpp?rev=98674&r1=98673&r2=98674&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceLocation.cpp (original)
+++ cfe/trunk/lib/Basic/SourceLocation.cpp Tue Mar 16 15:53:17 2010
@@ -80,24 +80,24 @@
   return FullSourceLoc(SrcMgr->getSpellingLoc(*this), *SrcMgr);
 }
 
-unsigned FullSourceLoc::getInstantiationLineNumber() const {
+unsigned FullSourceLoc::getInstantiationLineNumber(bool *Invalid) const {
   assert(isValid());
-  return SrcMgr->getInstantiationLineNumber(*this);
+  return SrcMgr->getInstantiationLineNumber(*this, Invalid);
 }
 
-unsigned FullSourceLoc::getInstantiationColumnNumber() const {
+unsigned FullSourceLoc::getInstantiationColumnNumber(bool *Invalid) const {
   assert(isValid());
-  return SrcMgr->getInstantiationColumnNumber(*this);
+  return SrcMgr->getInstantiationColumnNumber(*this, Invalid);
 }
 
-unsigned FullSourceLoc::getSpellingLineNumber() const {
+unsigned FullSourceLoc::getSpellingLineNumber(bool *Invalid) const {
   assert(isValid());
-  return SrcMgr->getSpellingLineNumber(*this);
+  return SrcMgr->getSpellingLineNumber(*this, Invalid);
 }
 
-unsigned FullSourceLoc::getSpellingColumnNumber() const {
+unsigned FullSourceLoc::getSpellingColumnNumber(bool *Invalid) const {
   assert(isValid());
-  return SrcMgr->getSpellingColumnNumber(*this);
+  return SrcMgr->getSpellingColumnNumber(*this, Invalid);
 }
 
 bool FullSourceLoc::isInSystemHeader() const {





More information about the cfe-commits mailing list