From 2ede126b1b3fae52cddece5cf1f75b474a9c7932 Mon Sep 17 00:00:00 2001 From: Victor Leschuk Date: Thu, 20 Oct 2016 00:13:12 +0000 Subject: DebugInfo: preparation to implement DW_AT_alignment - Add alignment attribute to DIVariable family - Modify bitcode format to match new DIVariable representation - Update tests to match these changes (also add bitcode upgrade test) - Expect that frontend passes non-zero align value only when it is not default (was forcibly aligned by alignas()/_Alignas()/__atribute__(aligned()) Differential Revision: https://reviews.llvm.org/D25073 llvm-svn: 284678 --- llvm/lib/IR/AsmWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/IR/AsmWriter.cpp') diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 5500e9638b2..ea00baf3d97 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -1822,6 +1822,7 @@ static void writeDIGlobalVariable(raw_ostream &Out, const DIGlobalVariable *N, Printer.printBool("isDefinition", N->isDefinition()); Printer.printMetadata("expr", N->getExpr()); Printer.printMetadata("declaration", N->getRawStaticDataMemberDeclaration()); + Printer.printInt("align", N->getAlignInBits()); Out << ")"; } @@ -1837,6 +1838,7 @@ static void writeDILocalVariable(raw_ostream &Out, const DILocalVariable *N, Printer.printInt("line", N->getLine()); Printer.printMetadata("type", N->getRawType()); Printer.printDIFlags("flags", N->getFlags()); + Printer.printInt("align", N->getAlignInBits()); Out << ")"; } -- cgit v1.2.3