[llvm-commits] [llvm] r74474 - /llvm/trunk/include/llvm/Support/SourceMgr.h
Daniel Dunbar
daniel at zuster.org
Mon Jun 29 16:29:08 PDT 2009
Author: ddunbar
Date: Mon Jun 29 18:28:55 2009
New Revision: 74474
URL: http://llvm.org/viewvc/llvm-project?rev=74474&view=rev
Log:
Add SMLoc::isValid method.
- To support using SMLoc as a sentinel.
Modified:
llvm/trunk/include/llvm/Support/SourceMgr.h
Modified: llvm/trunk/include/llvm/Support/SourceMgr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/SourceMgr.h?rev=74474&r1=74473&r2=74474&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/SourceMgr.h (original)
+++ llvm/trunk/include/llvm/Support/SourceMgr.h Mon Jun 29 18:28:55 2009
@@ -30,6 +30,8 @@
SMLoc() : Ptr(0) {}
SMLoc(const SMLoc &RHS) : Ptr(RHS.Ptr) {}
+ bool isValid() const { return Ptr != 0; }
+
bool operator==(const SMLoc &RHS) const { return RHS.Ptr == Ptr; }
bool operator!=(const SMLoc &RHS) const { return RHS.Ptr != Ptr; }
More information about the llvm-commits
mailing list