mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
Added FoldingSet style 'profiling' support for APSInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e420debd26
commit
4048a08284
@ -125,6 +125,10 @@ public:
|
|||||||
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
|
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
|
||||||
return IsUnsigned ? uge(RHS) : sge(RHS);
|
return IsUnsigned ? uge(RHS) : sge(RHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Profile - Used to insert APSInt objects, or objects that contain APSInt
|
||||||
|
/// objects, into FoldingSets.
|
||||||
|
void Profile(FoldingSetNodeID& ID) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
23
lib/Support/APSInt.cpp
Normal file
23
lib/Support/APSInt.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//===-- llvm/ADT/APSInt.cpp - Arbitrary Precision Signed Int ---*- C++ -*--===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// This file implements the APSInt class, which is a simple class that
|
||||||
|
// represents an arbitrary sized integer that knows its signedness.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "llvm/ADT/APSInt.h"
|
||||||
|
#include "llvm/ADT/FoldingSet.h"
|
||||||
|
|
||||||
|
using namespace llvm;
|
||||||
|
|
||||||
|
void APSInt::Profile(FoldingSetNodeID& ID) const {
|
||||||
|
ID.AddInteger((unsigned) (IsUnsigned ? 1 : 0));
|
||||||
|
APInt::Profile(ID);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user