summaryrefslogtreecommitdiff
path: root/tools/llvm-mc/llvm-mc.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-11-23 17:37:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-11-23 17:37:34 +0000
commit985884caf94409373c31f694220720c40460036b (patch)
tree7dadfefb4c17a5e278f4352df41354bc690ab024 /tools/llvm-mc/llvm-mc.cpp
parentc8fec7e21f5c24303eab8a8592f3b8faff347d86 (diff)
downloadllvm-985884caf94409373c31f694220720c40460036b.tar.gz
llvm-985884caf94409373c31f694220720c40460036b.tar.bz2
llvm-985884caf94409373c31f694220720c40460036b.tar.xz
Add a -disable-cfi option to llvm-mc. This is useful for debugging as
it will expand any .cfi_* directives in the input assembly. Unfortunately this cannot replace elf-dump in tests as the asm streamer cannot relax the line advance opcodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index f7c3748f07..8329a41f25 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -69,6 +69,9 @@ static cl::opt<bool>
RelaxAll("mc-relax-all", cl::desc("Relax all fixups"));
static cl::opt<bool>
+DisableCFI("disable-cfi", cl::desc("Do not use .cfi_* directives"));
+
+static cl::opt<bool>
NoExecStack("mc-no-exec-stack", cl::desc("File doesn't need an exec stack"));
enum OutputFileType {
@@ -415,9 +418,10 @@ int main(int argc, char **argv) {
CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx);
MAB = TheTarget->createMCAsmBackend(TripleName, MCPU);
}
+ bool UseCFI = !DisableCFI;
Str.reset(TheTarget->createAsmStreamer(Ctx, FOS, /*asmverbose*/true,
/*useLoc*/ true,
- /*useCFI*/ true,
+ UseCFI,
/*useDwarfDirectory*/ true,
IP, CE, MAB, ShowInst));