Remove support for not using .loc directives.

Clang itself was not using this. The only way to access it was via llc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-02-05 18:00:21 +00:00
parent 9a7cfe5a3a
commit f39297678b
19 changed files with 62 additions and 126 deletions

View File

@ -43,6 +43,10 @@ Non-comprehensive list of changes in this release
* Clang can now successfully self-host itself on Linux/Sparc64 and on * Clang can now successfully self-host itself on Linux/Sparc64 and on
FreeBSD/Sparc64. FreeBSD/Sparc64.
* LLVM now assumes the assembler supports ``.loc`` for generating debug line
numbers. The old support for printing the debug line info directly was only
used by ``llc`` and has been removed.
.. NOTE .. NOTE
For small 1-3 sentence descriptions, just add an entry at the end of For small 1-3 sentence descriptions, just add an entry at the end of
this list. If your description won't fit comfortably in one bullet this list. If your description won't fit comfortably in one bullet

View File

@ -85,9 +85,6 @@ FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile),
"Emit nothing, for performance testing"), "Emit nothing, for performance testing"),
clEnumValEnd)); clEnumValEnd));
cl::opt<bool> DisableDotLoc("disable-dot-loc", cl::Hidden,
cl::desc("Do not use .loc entries"));
cl::opt<bool> DisableCFI("disable-cfi", cl::Hidden, cl::opt<bool> DisableCFI("disable-cfi", cl::Hidden,
cl::desc("Do not use .cfi_* directives")); cl::desc("Do not use .cfi_* directives"));

View File

@ -737,11 +737,10 @@ MCStreamer *createNullStreamer(MCContext &Ctx);
/// \param ShowInst - Whether to show the MCInst representation inline with /// \param ShowInst - Whether to show the MCInst representation inline with
/// the assembly. /// the assembly.
MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI,
bool useDwarfDirectory, bool useDwarfDirectory, MCInstPrinter *InstPrint,
MCInstPrinter *InstPrint = 0, MCCodeEmitter *CE, MCAsmBackend *TAB,
MCCodeEmitter *CE = 0, MCAsmBackend *TAB = 0, bool ShowInst);
bool ShowInst = false);
/// createMachOStreamer - Create a machine code streamer which will generate /// createMachOStreamer - Create a machine code streamer which will generate
/// Mach-O format object files. /// Mach-O format object files.

View File

@ -50,9 +50,8 @@ namespace llvm {
class raw_ostream; class raw_ostream;
class formatted_raw_ostream; class formatted_raw_ostream;
MCStreamer *createAsmStreamer(MCContext &Ctx, MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
formatted_raw_ostream &OS, bool isVerboseAsm, bool isVerboseAsm, bool useCFI,
bool useLoc, bool useCFI,
bool useDwarfDirectory, bool useDwarfDirectory,
MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCInstPrinter *InstPrint, MCCodeEmitter *CE,
MCAsmBackend *TAB, bool ShowInst); MCAsmBackend *TAB, bool ShowInst);
@ -132,7 +131,6 @@ namespace llvm {
typedef MCStreamer *(*AsmStreamerCtorTy)(MCContext &Ctx, typedef MCStreamer *(*AsmStreamerCtorTy)(MCContext &Ctx,
formatted_raw_ostream &OS, formatted_raw_ostream &OS,
bool isVerboseAsm, bool isVerboseAsm,
bool useLoc,
bool useCFI, bool useCFI,
bool useDwarfDirectory, bool useDwarfDirectory,
MCInstPrinter *InstPrint, MCInstPrinter *InstPrint,
@ -432,7 +430,6 @@ namespace llvm {
MCStreamer *createAsmStreamer(MCContext &Ctx, MCStreamer *createAsmStreamer(MCContext &Ctx,
formatted_raw_ostream &OS, formatted_raw_ostream &OS,
bool isVerboseAsm, bool isVerboseAsm,
bool useLoc,
bool useCFI, bool useCFI,
bool useDwarfDirectory, bool useDwarfDirectory,
MCInstPrinter *InstPrint, MCInstPrinter *InstPrint,
@ -440,10 +437,10 @@ namespace llvm {
MCAsmBackend *TAB, MCAsmBackend *TAB,
bool ShowInst) const { bool ShowInst) const {
if (AsmStreamerCtorFn) if (AsmStreamerCtorFn)
return AsmStreamerCtorFn(Ctx, OS, isVerboseAsm, useLoc, useCFI, return AsmStreamerCtorFn(Ctx, OS, isVerboseAsm, useCFI,
useDwarfDirectory, InstPrint, CE, TAB, useDwarfDirectory, InstPrint, CE, TAB,
ShowInst); ShowInst);
return llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useLoc, useCFI, return llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useCFI,
useDwarfDirectory, InstPrint, CE, TAB, useDwarfDirectory, InstPrint, CE, TAB,
ShowInst); ShowInst);
} }

View File

@ -85,7 +85,6 @@ protected: // Can only create subclasses.
unsigned MCRelaxAll : 1; unsigned MCRelaxAll : 1;
unsigned MCNoExecStack : 1; unsigned MCNoExecStack : 1;
unsigned MCSaveTempLabels : 1; unsigned MCSaveTempLabels : 1;
unsigned MCUseLoc : 1;
unsigned MCUseCFI : 1; unsigned MCUseCFI : 1;
unsigned MCUseDwarfDirectory : 1; unsigned MCUseDwarfDirectory : 1;
unsigned RequireStructuredCFG : 1; unsigned RequireStructuredCFG : 1;
@ -182,12 +181,6 @@ public:
/// setMCNoExecStack - Set whether an executabel stack is not needed. /// setMCNoExecStack - Set whether an executabel stack is not needed.
void setMCNoExecStack(bool Value) { MCNoExecStack = Value; } void setMCNoExecStack(bool Value) { MCNoExecStack = Value; }
/// hasMCUseLoc - Check whether we should use dwarf's .loc directive.
bool hasMCUseLoc() const { return MCUseLoc; }
/// setMCUseLoc - Set whether all we should use dwarf's .loc directive.
void setMCUseLoc(bool Value) { MCUseLoc = Value; }
/// hasMCUseCFI - Check whether we should use dwarf's .cfi_* directives. /// hasMCUseCFI - Check whether we should use dwarf's .cfi_* directives.
bool hasMCUseCFI() const { return MCUseCFI; } bool hasMCUseCFI() const { return MCUseCFI; }

View File

@ -765,9 +765,6 @@ void AsmPrinter::EmitFunctionBody() {
if (isVerbose()) emitKill(II, *this); if (isVerbose()) emitKill(II, *this);
break; break;
default: default:
if (!TM.hasMCUseLoc())
MCLineEntry::Make(&OutStreamer, getCurrentSection());
EmitInstruction(II); EmitInstruction(II);
break; break;
} }

View File

@ -688,12 +688,12 @@ DIE *DwarfDebug::constructScopeDIE(DwarfCompileUnit *TheCU,
// as well. // as well.
unsigned DwarfDebug::getOrCreateSourceID(StringRef FileName, StringRef DirName, unsigned DwarfDebug::getOrCreateSourceID(StringRef FileName, StringRef DirName,
unsigned CUID) { unsigned CUID) {
// If we use .loc in assembly, we can't separate .file entries according to // If we print assembly, we can't separate .file entries according to
// compile units. Thus all files will belong to the default compile unit. // compile units. Thus all files will belong to the default compile unit.
// FIXME: add a better feature test than hasRawTextSupport. Even better, // FIXME: add a better feature test than hasRawTextSupport. Even better,
// extend .file to support this. // extend .file to support this.
if (Asm->TM.hasMCUseLoc() && Asm->OutStreamer.hasRawTextSupport()) if (Asm->OutStreamer.hasRawTextSupport())
CUID = 0; CUID = 0;
// If FE did not provide a file name, then assume stdin. // If FE did not provide a file name, then assume stdin.
@ -766,10 +766,9 @@ DwarfCompileUnit *DwarfDebug::constructDwarfCompileUnit(DICompileUnit DIUnit) {
Asm->OutStreamer.getContext().setMCLineTableSymbol(LineTableStartSym, Asm->OutStreamer.getContext().setMCLineTableSymbol(LineTableStartSym,
NewCU->getUniqueID()); NewCU->getUniqueID());
// Use a single line table if we are using .loc and generating assembly. // Use a single line table if we are generating assembly.
bool UseTheFirstCU = bool UseTheFirstCU =
(Asm->TM.hasMCUseLoc() && Asm->OutStreamer.hasRawTextSupport()) || Asm->OutStreamer.hasRawTextSupport() || (NewCU->getUniqueID() == 0);
(NewCU->getUniqueID() == 0);
if (!useSplitDwarf()) { if (!useSplitDwarf()) {
// DW_AT_stmt_list is a offset of line number information for this // DW_AT_stmt_list is a offset of line number information for this
@ -1551,8 +1550,8 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
LexicalScope *FnScope = LScopes.getCurrentFunctionScope(); LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
DwarfCompileUnit *TheCU = SPMap.lookup(FnScope->getScopeNode()); DwarfCompileUnit *TheCU = SPMap.lookup(FnScope->getScopeNode());
assert(TheCU && "Unable to find compile unit!"); assert(TheCU && "Unable to find compile unit!");
if (Asm->TM.hasMCUseLoc() && Asm->OutStreamer.hasRawTextSupport()) if (Asm->OutStreamer.hasRawTextSupport())
// Use a single line table if we are using .loc and generating assembly. // Use a single line table if we are generating assembly.
Asm->OutStreamer.getContext().setDwarfCompileUnitID(0); Asm->OutStreamer.getContext().setDwarfCompileUnitID(0);
else else
Asm->OutStreamer.getContext().setDwarfCompileUnitID(TheCU->getUniqueID()); Asm->OutStreamer.getContext().setDwarfCompileUnitID(TheCU->getUniqueID());

View File

@ -185,7 +185,6 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
TargetCPU); TargetCPU);
MCStreamer *S = getTarget().createAsmStreamer(*Context, Out, MCStreamer *S = getTarget().createAsmStreamer(*Context, Out,
getVerboseAsm(), getVerboseAsm(),
hasMCUseLoc(),
hasMCUseCFI(), hasMCUseCFI(),
hasMCUseDwarfDirectory(), hasMCUseDwarfDirectory(),
InstPrinter, InstPrinter,

View File

@ -50,7 +50,6 @@ private:
unsigned IsVerboseAsm : 1; unsigned IsVerboseAsm : 1;
unsigned ShowInst : 1; unsigned ShowInst : 1;
unsigned UseLoc : 1;
unsigned UseCFI : 1; unsigned UseCFI : 1;
unsigned UseDwarfDirectory : 1; unsigned UseDwarfDirectory : 1;
@ -67,13 +66,13 @@ private:
public: public:
MCAsmStreamer(MCContext &Context, formatted_raw_ostream &os, MCAsmStreamer(MCContext &Context, formatted_raw_ostream &os,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI, bool useDwarfDirectory,
bool useDwarfDirectory, MCInstPrinter *printer, MCInstPrinter *printer, MCCodeEmitter *emitter,
MCCodeEmitter *emitter, MCAsmBackend *asmbackend, bool showInst) MCAsmBackend *asmbackend, bool showInst)
: MCStreamer(Context), OS(os), MAI(Context.getAsmInfo()), : MCStreamer(Context), OS(os), MAI(Context.getAsmInfo()),
InstPrinter(printer), Emitter(emitter), AsmBackend(asmbackend), InstPrinter(printer), Emitter(emitter), AsmBackend(asmbackend),
CommentStream(CommentToEmit), IsVerboseAsm(isVerboseAsm), CommentStream(CommentToEmit), IsVerboseAsm(isVerboseAsm),
ShowInst(showInst), UseLoc(useLoc), UseCFI(useCFI), ShowInst(showInst), UseCFI(useCFI),
UseDwarfDirectory(useDwarfDirectory) { UseDwarfDirectory(useDwarfDirectory) {
if (InstPrinter && IsVerboseAsm) if (InstPrinter && IsVerboseAsm)
InstPrinter->setCommentStream(CommentStream); InstPrinter->setCommentStream(CommentStream);
@ -863,7 +862,6 @@ bool MCAsmStreamer::EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
return EmitDwarfFileDirective(FileNo, "", FullPathName, CUID); return EmitDwarfFileDirective(FileNo, "", FullPathName, CUID);
} }
if (UseLoc) {
OS << "\t.file\t" << FileNo << ' '; OS << "\t.file\t" << FileNo << ' ';
if (!Directory.empty()) { if (!Directory.empty()) {
PrintQuotedString(Directory, OS); PrintQuotedString(Directory, OS);
@ -873,7 +871,7 @@ bool MCAsmStreamer::EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
EmitEOL(); EmitEOL();
// All .file will belong to a single CUID. // All .file will belong to a single CUID.
CUID = 0; CUID = 0;
}
return this->MCStreamer::EmitDwarfFileDirective(FileNo, Directory, Filename, return this->MCStreamer::EmitDwarfFileDirective(FileNo, Directory, Filename,
CUID); CUID);
} }
@ -885,9 +883,6 @@ void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
StringRef FileName) { StringRef FileName) {
this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags, this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags,
Isa, Discriminator, FileName); Isa, Discriminator, FileName);
if (!UseLoc)
return;
OS << "\t.loc\t" << FileNo << " " << Line << " " << Column; OS << "\t.loc\t" << FileNo << " " << Line << " " << Column;
if (Flags & DWARF2_FLAG_BASIC_BLOCK) if (Flags & DWARF2_FLAG_BASIC_BLOCK)
OS << " basic_block"; OS << " basic_block";
@ -1395,15 +1390,9 @@ void MCAsmStreamer::EmitRawTextImpl(StringRef String) {
} }
void MCAsmStreamer::FinishImpl() { void MCAsmStreamer::FinishImpl() {
// FIXME: This header is duplicated with MCObjectStreamer
// Dump out the dwarf file & directory tables and line tables.
const MCSymbol *LineSectionSymbol = NULL;
if (getContext().hasDwarfFiles() && !UseLoc)
LineSectionSymbol = MCDwarfFileTable::Emit(this);
// If we are generating dwarf for assembly source files dump out the sections. // If we are generating dwarf for assembly source files dump out the sections.
if (getContext().getGenDwarfForAssembly()) if (getContext().getGenDwarfForAssembly())
MCGenDwarfInfo::Emit(this, LineSectionSymbol); MCGenDwarfInfo::Emit(this, NULL);
if (!UseCFI) if (!UseCFI)
EmitFrames(AsmBackend.get(), false); EmitFrames(AsmBackend.get(), false);
@ -1411,10 +1400,10 @@ void MCAsmStreamer::FinishImpl() {
MCStreamer *llvm::createAsmStreamer(MCContext &Context, MCStreamer *llvm::createAsmStreamer(MCContext &Context,
formatted_raw_ostream &OS, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI,
bool useDwarfDirectory, MCInstPrinter *IP, bool useDwarfDirectory, MCInstPrinter *IP,
MCCodeEmitter *CE, MCAsmBackend *MAB, MCCodeEmitter *CE, MCAsmBackend *MAB,
bool ShowInst) { bool ShowInst) {
return new MCAsmStreamer(Context, OS, isVerboseAsm, useLoc, return new MCAsmStreamer(Context, OS, isVerboseAsm, useCFI, useDwarfDirectory,
useCFI, useDwarfDirectory, IP, CE, MAB, ShowInst); IP, CE, MAB, ShowInst);
} }

View File

@ -1293,13 +1293,13 @@ void ARMELFStreamer::emitUnwindRaw(int64_t Offset,
namespace llvm { namespace llvm {
MCStreamer *createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, MCStreamer *createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI,
bool useDwarfDirectory, bool useDwarfDirectory,
MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCInstPrinter *InstPrint, MCCodeEmitter *CE,
MCAsmBackend *TAB, bool ShowInst) { MCAsmBackend *TAB, bool ShowInst) {
MCStreamer *S = MCStreamer *S =
llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useLoc, useCFI, llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useCFI, useDwarfDirectory,
useDwarfDirectory, InstPrint, CE, TAB, ShowInst); InstPrint, CE, TAB, ShowInst);
new ARMTargetAsmStreamer(*S, OS, *InstPrint, isVerboseAsm); new ARMTargetAsmStreamer(*S, OS, *InstPrint, isVerboseAsm);
return S; return S;
} }

View File

@ -46,7 +46,7 @@ namespace ARM_MC {
} }
MCStreamer *createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, MCStreamer *createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI,
bool useDwarfDirectory, bool useDwarfDirectory,
MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCInstPrinter *InstPrint, MCCodeEmitter *CE,
MCAsmBackend *TAB, bool ShowInst); MCAsmBackend *TAB, bool ShowInst);

View File

@ -140,12 +140,12 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
static MCStreamer * static MCStreamer *
createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI, bool useDwarfDirectory,
bool useDwarfDirectory, MCInstPrinter *InstPrint, MCInstPrinter *InstPrint, MCCodeEmitter *CE,
MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) { MCAsmBackend *TAB, bool ShowInst) {
MCStreamer *S = MCStreamer *S =
llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useLoc, useCFI, llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useCFI, useDwarfDirectory,
useDwarfDirectory, InstPrint, CE, TAB, ShowInst); InstPrint, CE, TAB, ShowInst);
new MipsTargetAsmStreamer(*S, OS); new MipsTargetAsmStreamer(*S, OS);
return S; return S;
} }

View File

@ -175,13 +175,13 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
static MCStreamer * static MCStreamer *
createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI, bool useDwarfDirectory,
bool useDwarfDirectory, MCInstPrinter *InstPrint, MCInstPrinter *InstPrint, MCCodeEmitter *CE,
MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) { MCAsmBackend *TAB, bool ShowInst) {
MCStreamer *S = MCStreamer *S =
llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useLoc, useCFI, llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useCFI, useDwarfDirectory,
useDwarfDirectory, InstPrint, CE, TAB, ShowInst); InstPrint, CE, TAB, ShowInst);
new PPCTargetAsmStreamer(*S, OS); new PPCTargetAsmStreamer(*S, OS);
return S; return S;
} }

View File

@ -133,13 +133,13 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
static MCStreamer * static MCStreamer *
createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, createMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI, bool useDwarfDirectory,
bool useDwarfDirectory, MCInstPrinter *InstPrint, MCInstPrinter *InstPrint, MCCodeEmitter *CE,
MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) { MCAsmBackend *TAB, bool ShowInst) {
MCStreamer *S = MCStreamer *S =
llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useLoc, useCFI, llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useCFI, useDwarfDirectory,
useDwarfDirectory, InstPrint, CE, TAB, ShowInst); InstPrint, CE, TAB, ShowInst);
new SparcTargetAsmStreamer(*S, OS); new SparcTargetAsmStreamer(*S, OS);
return S; return S;
} }

View File

@ -52,7 +52,6 @@ TargetMachine::TargetMachine(const Target &T,
MCRelaxAll(false), MCRelaxAll(false),
MCNoExecStack(false), MCNoExecStack(false),
MCSaveTempLabels(false), MCSaveTempLabels(false),
MCUseLoc(true),
MCUseCFI(true), MCUseCFI(true),
MCUseDwarfDirectory(false), MCUseDwarfDirectory(false),
RequireStructuredCFG(false), RequireStructuredCFG(false),

View File

@ -128,12 +128,12 @@ void XCoreTargetAsmStreamer::emitCCBottomFunction(StringRef Name) {
static MCStreamer * static MCStreamer *
createXCoreMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS, createXCoreMCAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc, bool useCFI, bool isVerboseAsm, bool useCFI, bool useDwarfDirectory,
bool useDwarfDirectory, MCInstPrinter *InstPrint, MCInstPrinter *InstPrint, MCCodeEmitter *CE,
MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst) { MCAsmBackend *TAB, bool ShowInst) {
MCStreamer *S = MCStreamer *S =
llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useLoc, useCFI, llvm::createAsmStreamer(Ctx, OS, isVerboseAsm, useCFI, useDwarfDirectory,
useDwarfDirectory, InstPrint, CE, TAB, ShowInst); InstPrint, CE, TAB, ShowInst);
new XCoreTargetAsmStreamer(*S, OS); new XCoreTargetAsmStreamer(*S, OS);
return S; return S;
} }

View File

@ -1,27 +0,0 @@
; RUN: llc < %s -disable-dot-loc -mtriple=x86_64-apple-darwin -O0 | FileCheck %s
define void @foo() nounwind ssp {
entry:
ret void, !dbg !5
}
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!10}
!7 = metadata !{metadata !0}
!0 = metadata !{i32 786478, metadata !9, metadata !1, metadata !"foo", metadata !"foo", metadata !"", i32 3, metadata !3, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @foo, null, null, null, i32 0} ; [ DW_TAG_subprogram ]
!1 = metadata !{i32 786473, metadata !9} ; [ DW_TAG_file_type ]
!2 = metadata !{i32 786449, metadata !9, i32 12, metadata !"clang version 2.9 (trunk 120563)", i1 false, metadata !"", i32 0, metadata !8, metadata !8, metadata !7, null, null, metadata !""} ; [ DW_TAG_compile_unit ]
!3 = metadata !{i32 786453, metadata !9, metadata !1, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !4, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
!4 = metadata !{null}
!5 = metadata !{i32 5, i32 1, metadata !6, null}
!6 = metadata !{i32 786443, metadata !9, metadata !0, i32 3, i32 16, i32 0} ; [ DW_TAG_lexical_block ]
!8 = metadata !{i32 0}
!9 = metadata !{metadata !"e.c", metadata !"/private/tmp"}
; CHECK: .subsections_via_symbols
; CHECK-NEXT: __debug_line
; CHECK-NEXT: Lline_table_start0
; CHECK-NEXT: Ltmp{{[0-9]}} = (Ltmp
!10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}

View File

@ -288,9 +288,6 @@ static int compileModule(char **argv, LLVMContext &Context) {
assert(mod && "Should have exited after outputting help!"); assert(mod && "Should have exited after outputting help!");
TargetMachine &Target = *target.get(); TargetMachine &Target = *target.get();
if (DisableDotLoc)
Target.setMCUseLoc(false);
if (DisableCFI) if (DisableCFI)
Target.setMCUseCFI(false); Target.setMCUseCFI(false);
@ -300,11 +297,6 @@ static int compileModule(char **argv, LLVMContext &Context) {
if (GenerateSoftFloatCalls) if (GenerateSoftFloatCalls)
FloatABIForCalls = FloatABI::Soft; FloatABIForCalls = FloatABI::Soft;
// Disable .loc support for older OS X versions.
if (TheTriple.isMacOSX() &&
TheTriple.isMacOSXVersionLT(10, 6))
Target.setMCUseLoc(false);
// Figure out where we are going to send the output. // Figure out where we are going to send the output.
OwningPtr<tool_output_file> Out OwningPtr<tool_output_file> Out
(GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0])); (GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0]));

View File

@ -435,11 +435,9 @@ int main(int argc, char **argv) {
MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU); MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU);
} }
bool UseCFI = !DisableCFI; bool UseCFI = !DisableCFI;
Str.reset(TheTarget->createAsmStreamer(Ctx, FOS, /*asmverbose*/true, Str.reset(TheTarget->createAsmStreamer(
/*useLoc*/ true, Ctx, FOS, /*asmverbose*/ true, UseCFI,
UseCFI, /*useDwarfDirectory*/ true, IP, CE, MAB, ShowInst));
/*useDwarfDirectory*/ true,
IP, CE, MAB, ShowInst));
} else if (FileType == OFT_Null) { } else if (FileType == OFT_Null) {
Str.reset(createNullStreamer(Ctx)); Str.reset(createNullStreamer(Ctx));