From: Rafael Espindola Date: Fri, 23 Nov 2012 17:37:34 +0000 (+0000) Subject: Add a -disable-cfi option to llvm-mc. This is useful for debugging as X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=985884caf94409373c31f694220720c40460036b;p=oota-llvm.git 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 --- diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index f7c3748f079..8329a41f252 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -68,6 +68,9 @@ OutputAsmVariant("output-asm-variant", static cl::opt RelaxAll("mc-relax-all", cl::desc("Relax all fixups")); +static cl::opt +DisableCFI("disable-cfi", cl::desc("Do not use .cfi_* directives")); + static cl::opt NoExecStack("mc-no-exec-stack", cl::desc("File doesn't need an exec stack")); @@ -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));