summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-04-06 06:49:59 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-04-06 06:49:59 +0000
commitd4b3d29c50debd26000510b8401ed263812dba09 (patch)
treede1808cad93b05615953fc5b0b58bee3464a9df9 /llvm/include
parentb1915d62a7d7b8dd1520156046160df1a047dc08 (diff)
downloadbcm5719-llvm-d4b3d29c50debd26000510b8401ed263812dba09.tar.gz
bcm5719-llvm-d4b3d29c50debd26000510b8401ed263812dba09.zip
Add an empty key for DebugLoc so that you can store an empty DebugLoc in a
DenseMap. llvm-svn: 128994
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Support/DebugLoc.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/DebugLoc.h b/llvm/include/llvm/Support/DebugLoc.h
index 764591cfede..8d19e300ec2 100644
--- a/llvm/include/llvm/Support/DebugLoc.h
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud