Initial support for the cfi directives. This is just enough to get

f:
        .cfi_startproc
        nop
        .cfi_endproc

assembled (on ELF).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2010-12-09 23:48:29 +00:00
parent 29012319cd
commit 1c952b9cc9
32 changed files with 550 additions and 176 deletions

View File

@@ -24,6 +24,7 @@
#include "llvm/Target/TargetOptions.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Transforms/Scalar.h"
@@ -145,27 +146,12 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
if (ShowMCEncoding)
MCE = getTarget().createCodeEmitter(*this, *Context);
const TargetLoweringObjectFile &TLOF =
getTargetLowering()->getObjFileLowering();
int PointerSize = getTargetData()->getPointerSize();
MCStreamer *S;
if (hasMCUseLoc())
S = getTarget().createAsmStreamer(*Context, Out,
getTargetData()->isLittleEndian(),
getVerboseAsm(),
InstPrinter,
MCE,
ShowMCInst);
else
S = createAsmStreamerNoLoc(*Context, Out,
getTargetData()->isLittleEndian(),
getVerboseAsm(),
&TLOF,
PointerSize,
InstPrinter,
MCE,
ShowMCInst);
MCStreamer *S = getTarget().createAsmStreamer(*Context, Out,
getVerboseAsm(),
hasMCUseLoc(),
InstPrinter,
MCE,
ShowMCInst);
AsmStreamer.reset(S);
break;
}
@@ -344,7 +330,8 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
// Install a MachineModuleInfo class, which is an immutable pass that holds
// all the per-module stuff we're generating, including MCContext.
MachineModuleInfo *MMI = new MachineModuleInfo(*getMCAsmInfo());
TargetAsmInfo *TAI = new TargetAsmInfo(*this);
MachineModuleInfo *MMI = new MachineModuleInfo(*getMCAsmInfo(), TAI);
PM.add(MMI);
OutContext = &MMI->getContext(); // Return the MCContext specifically by-ref.