[llvm] r223580 - Reformat.
NAKAMURA Takumi
geek4civic at gmail.com
Fri Dec 5 21:57:06 PST 2014
Author: chapuni
Date: Fri Dec 5 23:57:06 2014
New Revision: 223580
URL: http://llvm.org/viewvc/llvm-project?rev=223580&view=rev
Log:
Reformat.
Modified:
llvm/trunk/lib/IR/Constants.cpp
llvm/trunk/lib/IR/LLVMContextImpl.h
Modified: llvm/trunk/lib/IR/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Constants.cpp?rev=223580&r1=223579&r2=223580&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Constants.cpp (original)
+++ llvm/trunk/lib/IR/Constants.cpp Fri Dec 5 23:57:06 2014
@@ -554,8 +554,7 @@ Constant *ConstantInt::getFalse(Type *Ty
ConstantInt::getFalse(Ty->getContext()));
}
-
-// Get a ConstantInt from an APInt. Note that the value stored in the DenseMap
+// Get a ConstantInt from an APInt. Note that the value stored in the DenseMap
// as the key, is a DenseMapAPIntKeyInfo::KeyTy which has provided the
// operator== and operator!= to ensure that the DenseMap doesn't attempt to
// compare APInt's of different widths, which would violate an APInt class
@@ -566,7 +565,8 @@ ConstantInt *ConstantInt::get(LLVMContex
// get an existing value or the insertion position
LLVMContextImpl *pImpl = Context.pImpl;
ConstantInt *&Slot = pImpl->IntConstants[DenseMapAPIntKeyInfo::KeyTy(V, ITy)];
- if (!Slot) Slot = new ConstantInt(ITy, V);
+ if (!Slot)
+ Slot = new ConstantInt(ITy, V);
return Slot;
}
Modified: llvm/trunk/lib/IR/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=223580&r1=223579&r2=223580&view=diff
==============================================================================
--- llvm/trunk/lib/IR/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/IR/LLVMContextImpl.h Fri Dec 5 23:57:06 2014
@@ -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;
More information about the llvm-commits
mailing list