[mojo] Make mojo::core::ports::NodeName and mojo::core::ports::PortName constexpr.
check_static_initializers fails because of: --- # 0x10beb30 name.cc _GLOBAL__sub_I_name.cc Symbol missing source lines. Showing raw disassembly (via objdump). This might be verbose due to inlined functions. nacl_helper: file format elf64-x86-64 Disassembly of section .text: 00000000010beb30 <_GLOBAL__sub_I_name.cc>: 10beb30: 55 pushq %rbp 10beb31: 48 89 e5 movq %rsp, %rbp 10beb34: 48 ff 05 ed bf 14 00 incq 0x14bfed(%rip) # 0x120ab28 <__profc__ZN4mojo4core5ports8PortNameC2Emm> 10beb3b: 0f 57 c0 xorps %xmm0, %xmm0 10beb3e: 0f 11 05 2b a4 40 00 movups %xmm0, 0x40a42b(%rip) # 0x14c8f70 <mojo::core::ports::kInvalidPortName> 10beb45: 48 ff 05 e4 bf 14 00 incq 0x14bfe4(%rip) # 0x120ab30 <__profc__ZN4mojo4core5ports8NodeNameC2Emm> 10beb4c: 48 83 05 44 76 0c 00 02 addq $0x2, 0xc7644(%rip) # 0x1186198 <__profc__ZN4mojo4core5ports4NameC2Emm> 10beb54: 0f 11 05 25 a4 40 00 movups %xmm0, 0x40a425(%rip) # 0x14c8f80 <mojo::core::ports::kInvalidNodeName> 10beb5b: 5d popq %rbp 10beb5c: c3 retq --- Sample build failure: https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel-cft/9/overview Change-Id: I03bbd94c6bbc760f29e34353d8ad00ee1eefe1d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4083906 Reviewed-by: Alex Gough <ajgo@chromium.org> Commit-Queue: Takashi Sakamoto <tasak@google.com> Cr-Commit-Position: refs/heads/main@{#1080188}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
998dcf5599
commit
e1c322dae2
@ -8,9 +8,9 @@ namespace mojo {
|
||||
namespace core {
|
||||
namespace ports {
|
||||
|
||||
const PortName kInvalidPortName = {0, 0};
|
||||
constexpr PortName kInvalidPortName = {0, 0};
|
||||
|
||||
const NodeName kInvalidNodeName = {0, 0};
|
||||
constexpr NodeName kInvalidNodeName = {0, 0};
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, const Name& name) {
|
||||
std::ios::fmtflags flags(stream.flags());
|
||||
|
@ -18,7 +18,7 @@ namespace core {
|
||||
namespace ports {
|
||||
|
||||
struct COMPONENT_EXPORT(MOJO_CORE_PORTS) Name {
|
||||
Name(uint64_t v1, uint64_t v2) : v1(v1), v2(v2) {}
|
||||
constexpr Name(uint64_t v1, uint64_t v2) : v1(v1), v2(v2) {}
|
||||
uint64_t v1, v2;
|
||||
};
|
||||
|
||||
@ -38,15 +38,15 @@ COMPONENT_EXPORT(MOJO_CORE_PORTS)
|
||||
std::ostream& operator<<(std::ostream& stream, const Name& name);
|
||||
|
||||
struct COMPONENT_EXPORT(MOJO_CORE_PORTS) PortName : Name {
|
||||
PortName() : Name(0, 0) {}
|
||||
PortName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
|
||||
constexpr PortName() : Name(0, 0) {}
|
||||
constexpr PortName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
|
||||
};
|
||||
|
||||
extern COMPONENT_EXPORT(MOJO_CORE_PORTS) const PortName kInvalidPortName;
|
||||
|
||||
struct COMPONENT_EXPORT(MOJO_CORE_PORTS) NodeName : Name {
|
||||
NodeName() : Name(0, 0) {}
|
||||
NodeName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
|
||||
constexpr NodeName() : Name(0, 0) {}
|
||||
constexpr NodeName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
|
||||
};
|
||||
|
||||
extern COMPONENT_EXPORT(MOJO_CORE_PORTS) const NodeName kInvalidNodeName;
|
||||
|
Reference in New Issue
Block a user