forked from OSchip/llvm-project
				
			Add an empty key for DebugLoc so that you can store an empty DebugLoc in a
DenseMap. llvm-svn: 128994
This commit is contained in:
		
							parent
							
								
									b1915d62a7
								
							
						
					
					
						commit
						d4b3d29c50
					
				| 
						 | 
				
			
			@ -27,14 +27,22 @@ namespace llvm {
 | 
			
		|||
  class DebugLoc {
 | 
			
		||||
    friend struct DenseMapInfo<DebugLoc>;
 | 
			
		||||
 | 
			
		||||
    /// getTombstoneKey() - A private constructor that returns an unknown that
 | 
			
		||||
    /// is distinguishable from the usual one.
 | 
			
		||||
    static DebugLoc getTombstoneKey() {
 | 
			
		||||
    /// 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 not equal to the empty key or DebugLoc().
 | 
			
		||||
    static DebugLoc getTombstoneKey() {
 | 
			
		||||
      DebugLoc DL;
 | 
			
		||||
      DL.LineCol = -2;
 | 
			
		||||
      return DL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// LineCol - This 32-bit value encodes the line and column number for the
 | 
			
		||||
    /// location, encoded as 24-bits for line and 8 bits for col.  A value of 0
 | 
			
		||||
    /// for either means unknown.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -133,7 +133,7 @@ DebugLoc DebugLoc::getFromDILocation(MDNode *N) {
 | 
			
		|||
//===----------------------------------------------------------------------===//
 | 
			
		||||
 | 
			
		||||
DebugLoc DenseMapInfo<DebugLoc>::getEmptyKey() {
 | 
			
		||||
  return DebugLoc();
 | 
			
		||||
  return DebugLoc::getEmptyKey();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DebugLoc DenseMapInfo<DebugLoc>::getTombstoneKey() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue