diff options
author | Yuri Gorshenin <ygorshenin@google.com> | 2014-09-10 09:45:49 +0000 |
---|---|---|
committer | Yuri Gorshenin <ygorshenin@google.com> | 2014-09-10 09:45:49 +0000 |
commit | 3939dec1f7cb71f8848a990a03fb82ea588d0ff1 (patch) | |
tree | 8b4b4efa6c16f16caaea98e689eae860862ff81e /llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | |
parent | a2406fa9e5bef08382981e07dc20cccbdfda25d8 (diff) | |
download | bcm5719-llvm-3939dec1f7cb71f8848a990a03fb82ea588d0ff1.tar.gz bcm5719-llvm-3939dec1f7cb71f8848a990a03fb82ea588d0ff1.zip |
[asan-assembly-instrumentation] Added CFI directives to the generated instrumentation code.
Summary: [asan-assembly-instrumentation] Added CFI directives to the generated instrumentation code.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5189
llvm-svn: 217482
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp index 71dca74e64d..cca5f229c2f 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp @@ -33,6 +33,7 @@ #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetSubtargetInfo.h" using namespace llvm; @@ -146,6 +147,10 @@ void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode, " we don't have an asm parser for this target\n"); Parser->setAssemblerDialect(Dialect); Parser->setTargetParser(*TAP.get()); + if (MF) { + const TargetRegisterInfo *TRI = MF->getSubtarget().getRegisterInfo(); + TAP->SetFrameRegister(TRI->getFrameRegister(*MF)); + } // Don't implicitly switch to the text section before the asm. int Res = Parser->Run(/*NoInitialTextSection*/ true, |