Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: src/IceGlobalContext.cpp

Issue 1343843003: Refactor all instances of `typedef y x` to the C++11 `using x = y` syntax. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceGlobalContext.cpp
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp
index 3d157652cd8e8f8e44e1adcb4e3e6ebf59b1c49d..b4da1b6238e1b3f27a6316469e6d9b25d13835b9 100644
--- a/src/IceGlobalContext.cpp
+++ b/src/IceGlobalContext.cpp
@@ -80,7 +80,7 @@ struct KeyCompareLess<ValueType,
typename std::enable_if<std::is_floating_point<
typename ValueType::PrimType>::value>::type> {
bool operator()(const Constant *Const1, const Constant *Const2) const {
- typedef uint64_t CompareType;
+ using CompareType = uint64_t;
static_assert(sizeof(typename ValueType::PrimType) <= sizeof(CompareType),
"Expected floating-point type of width 64-bit or less");
typename ValueType::PrimType V1 = llvm::cast<ValueType>(Const1)->getValue();
@@ -139,23 +139,23 @@ public:
Constants.reserve(Pool.size());
for (auto &I : Pool)
Constants.push_back(I.second);
- // The sort (and its KeyCompareLess machinery) is not strictly
- // necessary, but is desirable for producing output that is
- // deterministic across unordered_map::iterator implementations.
+ // The sort (and its KeyCompareLess machinery) is not strictly necessary,
+ // but is desirable for producing output that is deterministic across
+ // unordered_map::iterator implementations.
std::sort(Constants.begin(), Constants.end(), KeyCompareLess<ValueType>());
return Constants;
}
private:
- // Use the default hash function, and a custom key comparison
- // function. The key comparison function for floating point
- // variables can't use the default == based implementation because
- // of special C++ semantics regarding +0.0, -0.0, and NaN
- // comparison. However, it's OK to use the default hash for
- // floating point values because KeyCompare is the final source of
- // truth - in the worst case a "false" collision must be resolved.
- typedef std::unordered_map<KeyType, ValueType *, std::hash<KeyType>,
- KeyCompare<KeyType>> ContainerType;
+ // Use the default hash function, and a custom key comparison function. The
+ // key comparison function for floating point variables can't use the default
+ // == based implementation because of special C++ semantics regarding +0.0,
+ // -0.0, and NaN comparison. However, it's OK to use the default hash for
+ // floating point values because KeyCompare is the final source of truth - in
+ // the worst case a "false" collision must be resolved.
+ using ContainerType =
+ std::unordered_map<KeyType, ValueType *, std::hash<KeyType>,
+ KeyCompare<KeyType>>;
ContainerType Pool;
uint32_t NextPoolID = 0;
};
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698