diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-12-06 05:57:06 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-12-06 05:57:06 +0000 |
commit | fc3062f65aee7ed02b0bdb75f3883f6030d7bf9f (patch) | |
tree | beeb240ffc6a00a5933f44ece09cad00410a20ab /llvm/lib/IR/LLVMContextImpl.h | |
parent | 8d5f5e42389514999ee8a6ac747b16b25e7adfcd (diff) | |
download | bcm5719-llvm-fc3062f65aee7ed02b0bdb75f3883f6030d7bf9f.tar.gz bcm5719-llvm-fc3062f65aee7ed02b0bdb75f3883f6030d7bf9f.zip |
Reformat.
llvm-svn: 223580
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.h')
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index 5fd8683ccaf..7b5f14deb5c 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -48,54 +48,46 @@ class Value; struct DenseMapAPIntKeyInfo { struct KeyTy { APInt val; - Type* type; - KeyTy(const APInt& V, Type* Ty) : val(V), type(Ty) {} - bool operator==(const KeyTy& that) const { + Type *type; + KeyTy(const APInt &V, Type *Ty) : val(V), type(Ty) {} + bool operator==(const KeyTy &that) const { return type == that.type && this->val == that.val; } - bool operator!=(const KeyTy& that) const { - return !this->operator==(that); - } + bool operator!=(const KeyTy &that) const { return !this->operator==(that); } friend hash_code hash_value(const KeyTy &Key) { return hash_combine(Key.type, Key.val); } }; - static inline KeyTy getEmptyKey() { return KeyTy(APInt(1,0), nullptr); } - static inline KeyTy getTombstoneKey() { return KeyTy(APInt(1,1), nullptr); } + static inline KeyTy getEmptyKey() { return KeyTy(APInt(1, 0), nullptr); } + static inline KeyTy getTombstoneKey() { return KeyTy(APInt(1, 1), nullptr); } static unsigned getHashValue(const KeyTy &Key) { return static_cast<unsigned>(hash_value(Key)); } - static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) { - return LHS == RHS; - } + static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) { return LHS == RHS; } }; struct DenseMapAPFloatKeyInfo { struct KeyTy { APFloat val; - KeyTy(const APFloat& V) : val(V){} - bool operator==(const KeyTy& that) const { + KeyTy(const APFloat &V) : val(V) {} + bool operator==(const KeyTy &that) const { return this->val.bitwiseIsEqual(that.val); } - bool operator!=(const KeyTy& that) const { - return !this->operator==(that); - } + bool operator!=(const KeyTy &that) const { return !this->operator==(that); } friend hash_code hash_value(const KeyTy &Key) { return hash_combine(Key.val); } }; - static inline KeyTy getEmptyKey() { - return KeyTy(APFloat(APFloat::Bogus,1)); + static inline KeyTy getEmptyKey() { + return KeyTy(APFloat(APFloat::Bogus, 1)); } - static inline KeyTy getTombstoneKey() { - return KeyTy(APFloat(APFloat::Bogus,2)); + static inline KeyTy getTombstoneKey() { + return KeyTy(APFloat(APFloat::Bogus, 2)); } static unsigned getHashValue(const KeyTy &Key) { return static_cast<unsigned>(hash_value(Key)); } - static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) { - return LHS == RHS; - } + static bool isEqual(const KeyTy &LHS, const KeyTy &RHS) { return LHS == RHS; } }; struct AnonStructTypeKeyInfo { @@ -280,9 +272,9 @@ public: typedef DenseMap<DenseMapAPIntKeyInfo::KeyTy, ConstantInt *, DenseMapAPIntKeyInfo> IntMapTy; IntMapTy IntConstants; - - typedef DenseMap<DenseMapAPFloatKeyInfo::KeyTy, ConstantFP*, - DenseMapAPFloatKeyInfo> FPMapTy; + + typedef DenseMap<DenseMapAPFloatKeyInfo::KeyTy, ConstantFP *, + DenseMapAPFloatKeyInfo> FPMapTy; FPMapTy FPConstants; FoldingSet<AttributeImpl> AttrsSet; |