uint256 CBlockHeader::GetHash() const
{
return SerializeHash(*this);
}
https://github.com/bitcoin/bitcoin/blob/master/src/primitives/block.cpp#L13
Which return the value of SerializeHash(*this), That is declared on the file hash.h
/** Compute the 256-bit hash of an object's serialization. */
template
uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
{
CHashWriter ss(nType, nVersion);
ss << obj;
return ss.GetHash();
}
And according to the comment above it,
/** Compute the 256-bit hash of an object's serialization. */
The SerializeHash will call CHashWriter and return the value of GetHash which is a simple sha256d hashing algorithm result
(Please, let me know if I'm wrong, I'm still studying bitcoin code)