diff options
| author | Jason Molenda <jmolenda@apple.com> | 2012-12-11 01:20:57 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2012-12-11 01:20:57 +0000 |
| commit | 21d1e9e53d150055ead8866d3757cb6c85d02dc7 (patch) | |
| tree | 42f1d901e00ec3808741200cf56b49fd49d33bc8 /lldb | |
| parent | 67408537847323eca86d373916986c0f7d309d7a (diff) | |
| download | bcm5719-llvm-21d1e9e53d150055ead8866d3757cb6c85d02dc7.tar.gz bcm5719-llvm-21d1e9e53d150055ead8866d3757cb6c85d02dc7.zip | |
Update comments around ABISysV_x86_64::RegisterIsCalleeSaved to
make it clear that this is the list of callee-saved registers,
add reference to the ABI doc that this comes from.
llvm-svn: 169807
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index ed86db1fc46..c412c1f6459 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -1153,14 +1153,23 @@ ABISysV_x86_64::RegisterIsVolatile (const RegisterInfo *reg_info) - +// See "Register Usage" in the +// "System V Application Binary Interface" +// "AMD64 Architecture Processor Supplement" +// (or "x86-64(tm) Architecture Processor Supplement" in earlier revisions) +// Edited by Michael Matz, Jan Hubicka, Andreas Jaeger, and Mark Mitchell +// current version is 0.99.6 released 2012-05-15 at http://x86-64.org/documentation/abi.pdf bool ABISysV_x86_64::RegisterIsCalleeSaved (const RegisterInfo *reg_info) { if (reg_info) { - // Volatile registers include: rbx, rbp, rsp, r12, r13, r14, r15, rip + // Preserved registers are : + // rbx, rsp, rbp, r12, r13, r14, r15 + // mxcsr (partially preserved) + // x87 control word + const char *name = reg_info->name; if (name[0] == 'r') { @@ -1198,6 +1207,12 @@ ABISysV_x86_64::RegisterIsCalleeSaved (const RegisterInfo *reg_info) } } + if (name[0] == 's' && name[1] == 'p' && name[2] == '\0') // sp + return true; + if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0') // fp + return true; + if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0') // pc + return true; } return false; } |

