无法从 gcc 的 -fdump-tree-gimple 中找出 /[ex] 运算符
包含以下函数:
std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int, _Alloc = std::allocator<int>] (struct _Vector_base * const this)
{
int * D.8482;
long int D.8483;
int * D.8484;
long int D.8485;
long int D.8486;
long int D.8487;
long unsigned int D.8488;
int * D.8489;
struct _Vector_impl * D.8490;
{
try
{
D.8482 = this->_M_impl._M_end_of_storage;
D.8483 = (long int) D.8482;
D.8484 = this->_M_impl._M_start;
D.8485 = (long int) D.8484;
D.8486 = D.8483 - D.8485;
D.8487 = D.8486 /[ex] 4;
D.8488 = (long unsigned int) D.8487;
D.8489 = this->_M_impl._M_start;
std::_Vector_base<int, std::allocator<int> >::_M_deallocate(this, D.8489, D.8488);
}
finally
{
D.8490 = &this->_M_impl;
std::_Vector_base<int, std::allocator<int>::_Vector_impl::~_Vector_impl (D.8490);
}
}
<D.8393>:
}
当使用 -fdump-tree-gimple 选项(GCC 4.6.1)编译 C++ 时,我得到的代码 int>。无论如何,我不理解的代码部分是 D.8487 = D.8486 /[ex] 4;
行。我查看了 /usr/include/c++/4.6.1/std_vector.h
的源代码,它的析构函数是一个调用 _M_deallocate
的单行函数。有谁知道运算符 /[ex]
代表什么?到目前为止我唯一注意到的是 RHS 操作数是向量参数化类型的大小。
When compiling C++ with the -fdump-tree-gimple option (GCC 4.6.1), I get code that has the following function in it:
std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int, _Alloc = std::allocator<int>] (struct _Vector_base * const this)
{
int * D.8482;
long int D.8483;
int * D.8484;
long int D.8485;
long int D.8486;
long int D.8487;
long unsigned int D.8488;
int * D.8489;
struct _Vector_impl * D.8490;
{
try
{
D.8482 = this->_M_impl._M_end_of_storage;
D.8483 = (long int) D.8482;
D.8484 = this->_M_impl._M_start;
D.8485 = (long int) D.8484;
D.8486 = D.8483 - D.8485;
D.8487 = D.8486 /[ex] 4;
D.8488 = (long unsigned int) D.8487;
D.8489 = this->_M_impl._M_start;
std::_Vector_base<int, std::allocator<int> >::_M_deallocate(this, D.8489, D.8488);
}
finally
{
D.8490 = &this->_M_impl;
std::_Vector_base<int, std::allocator<int>::_Vector_impl::~_Vector_impl (D.8490);
}
}
<D.8393>:
}
You can get this code by making a simple program that uses std::vector<int>
. In any case, the part of the code I do not understand is the line with D.8487 = D.8486 /[ex] 4;
. I looked at the source code for /usr/include/c++/4.6.1/std_vector.h
, and its destructor is a one-liner that calls _M_deallocate
. Does anyone know what the operator /[ex]
stands for? The only thing I have noticed so far is that the RHS operand is the size of the type the vector parameterizes over.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
/[ex]
表示它是一个精确的除法表达式。来自 GCC 内部手册:
/[ex]
means that it's an exact divide expression.From the GCC internals manual: