From 8230abc187d82136966d81ecb15c1c9dda6d69fa Mon Sep 17 00:00:00 2001 From: Dean Michael Berris Date: Tue, 10 Jul 2018 08:58:12 +0000 Subject: [XRay][compiler-rt] Fixup build breakage Changes: - Remove static assertion on size of a structure, fails on systems where pointers aren't 8 bytes. - Use size_t instead of deducing type of arguments to `nearest_boundary`. Follow-up to D48653. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336648 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/xray/xray_function_call_trie.h | 2 -- lib/xray/xray_utils.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/xray') diff --git a/lib/xray/xray_function_call_trie.h b/lib/xray/xray_function_call_trie.h index 5ad822795..6c4710584 100644 --- a/lib/xray/xray_function_call_trie.h +++ b/lib/xray/xray_function_call_trie.h @@ -101,8 +101,6 @@ public: NodeIdPair(Node *N, int32_t F) : NodePtr(N), FId(F) {} }; - static_assert(sizeof(NodeIdPair) == 16, "Wrong size for NodeIDPair."); - using NodeIdPairArray = Array; using NodeIdPairAllocatorType = NodeIdPairArray::AllocatorType; diff --git a/lib/xray/xray_utils.h b/lib/xray/xray_utils.h index 0a7911f12..ce64528f9 100644 --- a/lib/xray/xray_utils.h +++ b/lib/xray/xray_utils.h @@ -42,7 +42,7 @@ constexpr size_t gcd(size_t a, size_t b) { constexpr size_t lcm(size_t a, size_t b) { return a * b / gcd(a, b); } -template constexpr T nearest_boundary(T number, T multiple) { +constexpr size_t nearest_boundary(size_t number, size_t multiple) { return multiple * ((number / multiple) + (number % multiple ? 1 : 0)); } -- cgit v1.2.1