[llvm] r208362 - Missed formatting
David Blaikie
dblaikie at gmail.com
Thu May 8 14:53:33 PDT 2014
Author: dblaikie
Date: Thu May 8 16:53:33 2014
New Revision: 208362
URL: http://llvm.org/viewvc/llvm-project?rev=208362&view=rev
Log:
Missed formatting
Modified:
llvm/trunk/include/llvm/ADT/StringMap.h
llvm/trunk/unittests/ADT/StringMapTest.cpp
Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=208362&r1=208361&r2=208362&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Thu May 8 16:53:33 2014
@@ -53,7 +53,10 @@ protected:
: TheTable(nullptr),
// Initialize the map with zero buckets to allocation.
NumBuckets(0), NumItems(0), NumTombstones(0), ItemSize(itemSize) {}
- StringMapImpl(StringMapImpl &&RHS) : TheTable(RHS.TheTable), NumBuckets(RHS.NumBuckets), NumItems(RHS.NumItems), NumTombstones(RHS.NumTombstones), ItemSize(RHS.ItemSize) {
+ StringMapImpl(StringMapImpl &&RHS)
+ : TheTable(RHS.TheTable), NumBuckets(RHS.NumBuckets),
+ NumItems(RHS.NumItems), NumTombstones(RHS.NumTombstones),
+ ItemSize(RHS.ItemSize) {
RHS.TheTable = nullptr;
RHS.NumBuckets = 0;
RHS.NumItems = 0;
@@ -115,7 +118,7 @@ public:
explicit StringMapEntry(unsigned strLen)
: StringMapEntryBase(strLen), second() {}
StringMapEntry(unsigned strLen, ValueTy V)
- : StringMapEntryBase(strLen), second(std::move(V)) {}
+ : StringMapEntryBase(strLen), second(std::move(V)) {}
StringRef getKey() const {
return StringRef(getKeyData(), getKeyLength());
@@ -351,7 +354,7 @@ public:
return *static_cast<MapEntryTy*>(Bucket);
MapEntryTy *NewItem =
- MapEntryTy::Create(Key.begin(), Key.end(), Allocator, std::move(Val));
+ MapEntryTy::Create(Key.begin(), Key.end(), Allocator, std::move(Val));
if (Bucket == getTombstoneVal())
--NumTombstones;
Modified: llvm/trunk/unittests/ADT/StringMapTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/StringMapTest.cpp?rev=208362&r1=208361&r2=208362&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/StringMapTest.cpp (original)
+++ llvm/trunk/unittests/ADT/StringMapTest.cpp Thu May 8 16:53:33 2014
@@ -221,17 +221,18 @@ TEST_F(StringMapTest, NonDefaultConstruc
struct MoveOnly {
int i;
MoveOnly(int i) : i(i) {}
- MoveOnly(MoveOnly&&) = default;
- MoveOnly(const MoveOnly&) = delete;
- MoveOnly &operator=(MoveOnly&&) = default;
- MoveOnly &operator=(const MoveOnly&) = delete;
+ MoveOnly(MoveOnly &&) = default;
+ MoveOnly(const MoveOnly &) = delete;
+ MoveOnly &operator=(MoveOnly &&) = default;
+ MoveOnly &operator=(const MoveOnly &) = delete;
};
TEST_F(StringMapTest, MoveOnlyKey) {
StringMap<MoveOnly> t;
t.GetOrCreateValue("Test", MoveOnly(42));
StringRef Key = "Test";
- StringMapEntry<MoveOnly>::Create(Key.begin(), Key.end(), MoveOnly(42))->Destroy();
+ StringMapEntry<MoveOnly>::Create(Key.begin(), Key.end(), MoveOnly(42))
+ ->Destroy();
}
TEST_F(StringMapTest, MoveConstruct) {
@@ -259,24 +260,23 @@ TEST_F(StringMapTest, MoveAssignment) {
struct Countable {
int &InstanceCount;
int Number;
- Countable(int Number, int &InstanceCount) :InstanceCount(InstanceCount), Number(Number) {
+ Countable(int Number, int &InstanceCount)
+ : InstanceCount(InstanceCount), Number(Number) {
++InstanceCount;
}
Countable(Countable &&C) : InstanceCount(C.InstanceCount), Number(C.Number) {
++InstanceCount;
C.Number = -1;
}
- Countable(const Countable &C) : InstanceCount(C.InstanceCount), Number(C.Number) {
+ Countable(const Countable &C)
+ : InstanceCount(C.InstanceCount), Number(C.Number) {
++InstanceCount;
}
Countable &operator=(Countable C) {
Number = C.Number;
return *this;
}
- ~Countable() {
- --InstanceCount;
- }
-
+ ~Countable() { --InstanceCount; }
};
TEST_F(StringMapTest, MoveDtor) {
More information about the llvm-commits
mailing list