11/* 
22 * The MIT License (MIT) 
33 * 
4-  * Copyright (c) 2015-2023  Advanced Micro Devices, Inc. All rights reserved. 
4+  * Copyright (c) 2015-2025  Advanced Micro Devices, Inc. All rights reserved. 
55 * 
66 * Permission is hereby granted, free of charge, to any person obtaining a copy 
77 * of this software and associated documentation files (the "Software"), to deal 
@@ -33,7 +33,15 @@ namespace migraphx {
3333inline  namespace  MIGRAPHX_INLINE_NS  {
3434
3535struct  instruction ;
36- #if  defined(_WIN32) && !defined(NDEBUG) && !defined(CPPCHECK)
36+ 
37+ MIGRAPHX_EXPORT migraphx::instruction*
38+ as_address (const  std::list<instruction>::iterator& ins) noexcept ;
39+ MIGRAPHX_EXPORT const  migraphx::instruction*
40+ as_address (const  std::list<instruction>::const_iterator& ins) noexcept ;
41+ 
42+ #if  defined(CPPCHECK)
43+ using  instruction_ref = std::list<instruction>::iterator;
44+ #else 
3745struct  instruction_ref  : std::list<instruction>::iterator
3846{
3947    using  instruction_iter       = std::list<instruction>::iterator;
@@ -48,7 +56,7 @@ struct instruction_ref : std::list<instruction>::iterator
4856                                std::is_same<U, instruction_ref>{})>
4957    friend bool operator==(const  T& x, const  U& y)
5058    {
51-         return  x. _Unwrapped (). _Ptr  == y. _Unwrapped (). _Ptr ;
59+         return  as_address (x)  == as_address (y) ;
5260    }
5361
5462    template  <class  T ,
@@ -60,18 +68,14 @@ struct instruction_ref : std::list<instruction>::iterator
6068        return  not (x == y);
6169    }
6270};
63- #else 
64- using  instruction_ref = std::list<instruction>::iterator;
6571#endif 
6672
67- MIGRAPHX_EXPORT migraphx::instruction* as_address (const  instruction_ref& ins) noexcept ;
68- 
6973} //  namespace MIGRAPHX_INLINE_NS
7074} //  namespace migraphx
7175
7276namespace  std  {
7377template  <>
74- struct  hash <migraphx::instruction_ref>  //  NOLINT 
78+ struct  hash <migraphx::instruction_ref>
7579{
7680    using  argument_type = migraphx::instruction_ref;
7781    using  result_type   = std::size_t ;
@@ -81,18 +85,6 @@ struct hash<migraphx::instruction_ref> // NOLINT
8185    }
8286};
8387
84- template  <>
85- struct  equal_to <migraphx::instruction_ref> //  NOLINT
86- {
87-     using  argument_type = migraphx::instruction_ref;
88-     using  result_type   = bool ;
89-     result_type operator ()(const  migraphx::instruction_ref& x,
90-                            const  migraphx::instruction_ref& y) const  noexcept 
91-     {
92-         return  migraphx::as_address (x) == migraphx::as_address (y);
93-     }
94- };
95- 
9688} //  namespace std
9789
9890#ifdef  _MSC_VER
0 commit comments