blob: a6556525ee5ccf772746ef267724bb44a2c3544b [file] [log] [blame]
David Reiss9e7ba8c2010-10-05 16:39:27 +00001#include "t_type.h"
David Reiss41d30582010-10-05 16:39:29 +00002#include "t_typedef.h"
David Reiss9e7ba8c2010-10-05 16:39:27 +00003
4#include "md5.h"
5
6void t_type::generate_fingerprint() {
7 std::string material = get_fingerprint_material();
8 md5_state_t ctx;
9 md5_init(&ctx);
10 md5_append(&ctx, (md5_byte_t*)(material.data()), (int)material.size());
11 md5_finish(&ctx, (md5_byte_t*)fingerprint_);
12}
David Reiss41d30582010-10-05 16:39:29 +000013
14t_type* t_type::get_true_type() {
15 t_type* type = this;
16 while (type->is_typedef()) {
17 type = ((t_typedef*)type)->get_type();
18 }
19 return type;
20}