blob: 430359d8c50c963b433f0e506fdf8cf78c30f452 [file] [log] [blame]
 #ifndef UTILS_H #define UTILS_H inline void break_optimization(void *arg) { __asm__ __volatile__("" : : "r" (arg) : "memory"); } // Tests will instantiate this class to pad out bit sets to test out the // various ways we can represent the bit set (32-bit inline, 64-bit inline, // memory). Instantiating this class will trigger the instantiation of I // templates with I virtual tables for classes deriving from T, I-2 of which // will be of size sizeof(void*) * 5, 1 of which will be of size sizeof(void*) // * 3, and 1 of which will be of size sizeof(void*) * 9. (Under the MS ABI // each virtual table will be sizeof(void*) bytes smaller). Each category // of virtual tables is aligned to a different power of 2, precluding the // all-ones optimization. As a result, the bit vector for the base class will // need to contain at least I*2 entries to accommodate all the derived virtual // tables. template struct Deriver : T { Deriver() { break_optimization(new Deriver); } virtual void f() {} virtual void g() {} virtual void h() {} }; template struct Deriver : T { virtual void f() {} void g() {} }; template struct Deriver : T { Deriver() { break_optimization(new Deriver); } virtual void f() {} virtual void g() {} virtual void h() {} virtual void i() {} virtual void j() {} virtual void k() {} virtual void l() {} }; // Instantiate enough classes to force CFI checks for type T to use bit // vectors of size 32 (if B32 defined), 64 (if B64 defined) or >64 (if BM // defined). template void create_derivers() { #ifdef B32 break_optimization(new Deriver); #endif #ifdef B64 break_optimization(new Deriver); #endif #ifdef BM break_optimization(new Deriver); #endif } #endif
{"ft_lang_label":"__label__en","ft_lang_prob":0.5067887,"math_prob":0.7751845,"size":1847,"snap":"2021-43-2021-49","text_gpt3_token_len":525,"char_repetition_ratio":0.17525773,"word_repetition_ratio":0.13157895,"special_character_ratio":0.345425,"punctuation_ratio":0.11598746,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95937425,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-19T11:09:47Z\",\"WARC-Record-ID\":\"<urn:uuid:b529b86d-a276-4c28-988d-da950cbb1623>\",\"Content-Length\":\"27350\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c16d1bc9-257f-4bdf-ba3a-5e57eb639a11>\",\"WARC-Concurrent-To\":\"<urn:uuid:7fe042a2-e43d-4c33-a2a3-58c15d018eb7>\",\"WARC-IP-Address\":\"173.194.175.82\",\"WARC-Target-URI\":\"https://llvm.googlesource.com/compiler-rt/+/337963066ac61242a234ba0a231656531c1edfed/test/cfi/utils.h\",\"WARC-Payload-Digest\":\"sha1:JRTNXYZT6JHCZCC5AFTMQWZ5BESL7FTL\",\"WARC-Block-Digest\":\"sha1:GWHQ5SALBO3JLN4W3XSEELEZTWVXEMLO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585265.67_warc_CC-MAIN-20211019105138-20211019135138-00272.warc.gz\"}"}