diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-04-06 06:49:59 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-04-06 06:49:59 +0000 |
commit | 4841121580df86b327013d1fab2a9339be487bce (patch) | |
tree | c9a467eb2f1d1a56bebaf2e611c002c1395b7619 /include/llvm/Support/DebugLoc.h | |
parent | 49123fd58c52833dd40702c30dd05e2c40156f33 (diff) |
Add an empty key for DebugLoc so that you can store an empty DebugLoc in a
DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128994 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/DebugLoc.h')
-rw-r--r-- | include/llvm/Support/DebugLoc.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h index 764591cfed..8d19e300ec 100644 --- a/include/llvm/Support/DebugLoc.h +++ b/include/llvm/Support/DebugLoc.h @@ -27,11 +27,19 @@ namespace llvm { class DebugLoc { friend struct DenseMapInfo<DebugLoc>; + /// getEmptyKey() - A private constructor that returns an unknown that is + /// not equal to the tombstone key or DebugLoc(). + static DebugLoc getEmptyKey() { + DebugLoc DL; + DL.LineCol = -1; + return DL; + } + /// getTombstoneKey() - A private constructor that returns an unknown that - /// is distinguishable from the usual one. + /// is not equal to the empty key or DebugLoc(). static DebugLoc getTombstoneKey() { DebugLoc DL; - DL.LineCol = -1; + DL.LineCol = -2; return DL; } |