From 3b64c6bc2916bc62a99ef8a2995a426d994e1a04 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 23 Jan 2009 22:33:47 +0000 Subject: Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags. DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way. DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by a project, irrespective of whether the project used makefile, Xcode or something else. llvm-gcc patch is next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62888 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index 6bbb5bb..4b19d06 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -2781,6 +2781,11 @@ private: AddString(Die, DW_AT_name, DW_FORM_string, DIUnit.getFilename()); if (!DIUnit.getDirectory().empty()) AddString(Die, DW_AT_comp_dir, DW_FORM_string, DIUnit.getDirectory()); + if (DIUnit.isOptimized()) + AddUInt(Die, DW_AT_APPLE_optimized, DW_FORM_flag, 1); + const std::string &Flags = DIUnit.getFlags(); + if (!Flags.empty()) + AddString(Die, DW_AT_APPLE_flags, DW_FORM_string, Flags); CompileUnit *Unit = new CompileUnit(ID, Die); DW_CUs[DIUnit.getGV()] = Unit; -- cgit v1.1