Clang TargetInfo
has a method called getClobbers
:
Returns a string of target-specific clobbers, in LLVM format.
So, what is a clobber?
clobber in British English (ˈklɒbə ) noun. British slang. personal belongings, such as clothes and accessories. Word origin.
clobber (v.) British slang an identical word principally had to do with clothing, as in clobber (n.) "clothes," (v.) "to dress smartly;" clobber up "to patch old clothes for reuse, conceal defects" (1851). The source of these seems to have been 19c.
The word clobber was originally World War II British air force slang, in the 1940s, and usually referred to aerial bombing. Definitions of clobber. verb. beat thoroughly and conclusively in a competition or fight.
You can refer to someone's possessions, especially their clothes, as their clobber.
A clobbered register is a register which is trashed i.e. modified in unpredictable way by inline assembler. This usually happens when you need a temp. register or use particular instruction which happens to modify some register as a by-product.
Usually programmer explicitly declares registers which are clobbered by his inline asm code but some may be considered to be trashed by default and that's where getClobbers
come into play.
getClobbers
returns empty result for most targets. On MIPS GCC has historically not used $1
in generated code so most programmers didn't bother to declare it as clobbered. To reduce portability costs, LLVM considers $1
to be always clobbered in inline asm. Another example is arithmetic flags register (cc) which is considered to be always clobbered by inline asm by GCC on i386 and x86_64 targets.
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