<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/146925>146925</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm python pinding not recognizing CXX_METHOD
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
stevescia
</td>
</tr>
</table>
<pre>
I have two methods, one i can parse successfully, identifying a CXX_METHOD cursor kind, and the other,
a similar method, i do not get a CXX_METHOD cursor type. here's details.
the method doe not generate a CXX_METHOD cursor kind:
result_type1
FooListIterator::hasOptions_foo(const std::string& input1,
std::vector<std::string>& options,
std::vector<std::string>& desc_list,
vartype3 op1) const {
FooByNameIterator it2(0);
it2.query_type(ENUMTYPE::_data, ITER::equalTo, true);
// If this is not done, the foo names do not get displayed when TAB is pressed
while(it2.next()) {
options.push_back(it2.toString_foo());
}
if(!options.empty()){
return result_type1::some;
}
else{
return result_type1::none;
}
}
i get the following from a cursor kind dump:
cursor kind is CursorKind.RETURN_STMT
name is:
cursor kind is CursorKind.UNEXPOSED_EXPR
name is:
cursor kind is CursorKind.CSTYLE_CAST_EXPR
name is:
cursor kind is CursorKind.TYPE_REF
name is: enum std::byte
cursor kind is CursorKind.CSTYLE_CAST_EXPR
name is:
cursor kind is CursorKind.PAREN_EXPR
name is:
cursor kind is CursorKind.CALL_EXPR
and bunches more..
======
this method does contain a reported CXX_METHOD Cursor kind:
vartype1 Class1::setType1()
{
LOG_FUNCTION_ENTRY(fooLogger);
vartype1 var1 = vartype1::Ok;
vartype2 var2;
// Get the foo peering type
var1 = foo_config_utils::fooConfigGetSomeType(var2);
if (var1 != vartype1::Ok) {
LOG_ERR(fooLogger, "Failed to get foo some Type err:%s.",
var1.text().c_str());
LOG_FUNCTION_EXIT(fooLogger);
return var1;
}
// code omitted
}
cursor kind dumps as:
name is: setType1
cursor kind is CursorKind.CXX_METHOD
both codes compile.
both methods are declared in a .h file as public methods of the corresponding class.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0Vk9v27gT_TT0ZVBBoiP_Ofjg2HJ_wS91AlsB0pNAiyOLW4lUScpZ76dfkFJkJ01328MGARKTfG-GM28ezYwRR4m4IPEtidcj1tpS6YWxeEKTCzY6KH5e3EHJTgj2RUGNtlTcELoCJREE5ExCw7RBMG2eozFFW1Vnty84SiuKs5BHYLB6fs6-JOn_HtaQt9ooDd-E5O4ckxxsiaBsiZrQFQmXDIyoRcV0H8_TAVcglYUj2g_57LnBAKBEjYRODXC0TFQmIOGShEsXoSMDrrAnkqiZxZ9nN152YI2mrWzmIkQkXG6UuhfG3lkHV9odGy9LZh4aK5Q0WaEUobNcSWPBWN7tG6uFPBI6ASGb1kbdTeFffgb4CXMfavWecJw4TtWF7kl_FcXR5FkljO1xJ6bdHcegmojQOXRXINPbrgwuoY1St-ctq_H19iAsJXQWEjon49v-lLA0-N6iPvuaETpLtk9f0q-PSZdExpllrql3abLrlvB7y6pUuUWrWxzYekJCN4Ru4K4AWwoDwvgOciXRI0qEQimQrEZzrRMuTFOxM3J4KVFCurx10EajMcgd9UspKpefS1jin5bQmQtN5_2tX_vQ1zdoWlNmB5Z_6zFW7X1B-5532L4OZLq-XEAUfjt6JcK6secL4k0wjbbVEt6ormueqvFS5I4fsDL4i3jp6vUOP2QpfMW6UlaVenFzW2hVA7ueCeBt3QyDcb0hDKz8x_8LyYNdkj7tttk-_ZKScOkaA8J0uJ-DnrbJ8-PDPllnyfPj7tdxq3369T7JVst9-ptIp8lsl2zeIABlW1-G6HC2-B-Ff1zuku3vXnZ5f_8KcV4pORxamZdooFYaA2944_X7394FhbmyQeMm3DIhgYHGRmmL_NoLVx94Ye8REawqZsyrMNGmXmadoJ2qvMruHz5nm6ftKr172GbJNt19JXRWKHWvjkdn9leWMfCemI6AjNfDShfi4Vt_tl-m7h_6kUl8HmSsoEF04-kfh0ugjr9QKsuVLMQxa62oTBenUGrl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