I'm looking into the LLVM source code and I never encountered the following syntax:
class BasicBlock {
public:
typedef iplist<Instruction> InstListType;
private:
InstListType InstList;
static iplist<Instruction> BasicBlock::*getSublistAccess(Instruction*) {
return &BasicBlock::InstList;
}
}
what does the above define? At first it seemed a normal static function but I don't understand the BasicBlock::* part. Seems like a static function which returns a member function pointer and that directly executes that member function's code.
The return type of static member function getSublistAccess is
iplist<Instruction> BasicBlock::*
that is, a pointer to a non-static data member of class BasicBlock, where the data type is iplist<Instruction>.
What getSublistAccess actually returns is &BasicBlock::InstList, that is exactly a non-static data member of class BasicBlock, where the data type is InstListType. i.e., iplist<Instruction>.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With