<div dir="ltr">Sorry, never mind, Benjamin did it in r284707.<div><br></div><div>Peter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 4:03 PM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Victor, can you please also update the Go bindings?<div><br></div><div><div># <a href="http://llvm.org/llvm/bindings/go/llvm" target="_blank">llvm.org/llvm/bindings/go/llvm</a></div><div>[...]/llvm/bindings/go/llvm/<wbr>DIBuilderBindings.cpp:113:65: error: too many arguments to function call, expected 3, have 4</div><div>[...]/llvm/include/llvm/IR/<wbr>DIBuilder.h:124:5: note: 'createBasicType' declared here</div></div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Oct 19, 2016 at 5:13 PM, Victor Leschuk via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: vleschuk<br>
Date: Wed Oct 19 19:13:12 2016<br>
New Revision: 284678<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=284678&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=284678&view=rev</a><br>
Log:<br>
DebugInfo: preparation to implement DW_AT_alignment<br>
<br>
- Add alignment attribute to DIVariable family<br>
- Modify bitcode format to match new DIVariable representation<br>
- Update tests to match these changes (also add bitcode upgrade test)<br>
- Expect that frontend passes non-zero align value only when it is not default<br>
(was forcibly aligned by alignas()/_Alignas()/__atribut<wbr>e__(aligned())<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D25073" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2507<wbr>3</a><br>
<br>
Added:<br>
llvm/trunk/test/Bitcode/diloca<wbr>lvariable-3.9.ll<br>
llvm/trunk/test/Bitcode/diloca<wbr>lvariable-3.9.ll.bc<br>
Modified:<br>
llvm/trunk/include/llvm/IR/DIB<wbr>uilder.h<br>
llvm/trunk/include/llvm/IR/Deb<wbr>ugInfoMetadata.h<br>
llvm/trunk/lib/AsmParser/LLPar<wbr>ser.cpp<br>
llvm/trunk/lib/Bitcode/Reader/<wbr>BitcodeReader.cpp<br>
llvm/trunk/lib/Bitcode/Writer/<wbr>BitcodeWriter.cpp<br>
llvm/trunk/lib/CodeGen/AsmPrin<wbr>ter/DwarfUnit.cpp<br>
llvm/trunk/lib/IR/AsmWriter.cp<wbr>p<br>
llvm/trunk/lib/IR/DIBuilder.cp<wbr>p<br>
llvm/trunk/lib/IR/DebugInfoMet<wbr>adata.cpp<br>
llvm/trunk/lib/IR/LLVMContextI<wbr>mpl.h<br>
llvm/trunk/test/Assembler/digl<wbr>obalvariable.ll<br>
llvm/trunk/test/Assembler/dilo<wbr>calvariable.ll<br>
llvm/trunk/test/DebugInfo/AArc<wbr>h64/bitfields.ll<br>
llvm/trunk/test/DebugInfo/ARM/<wbr>big-endian-bitfield.ll<br>
llvm/trunk/test/DebugInfo/COFF<wbr>/bitfields.ll<br>
llvm/trunk/test/DebugInfo/X86/<wbr>bitfields-dwarf4.ll<br>
llvm/trunk/test/DebugInfo/X86/<wbr>bitfields.ll<br>
llvm/trunk/test/DebugInfo/X86/<wbr>debug-info-packed-struct.ll<br>
llvm/trunk/unittests/IR/Metada<wbr>taTest.cpp<br>
llvm/trunk/unittests/Transform<wbr>s/Utils/Cloning.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/IR/DIB<wbr>uilder.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DIBuilder.h?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/include/llvm/<wbr>IR/DIBuilder.h?rev=284678&r1=<wbr>284677&r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/include/llvm/IR/DIB<wbr>uilder.h (original)<br>
+++ llvm/trunk/include/llvm/IR/DIB<wbr>uilder.h Wed Oct 19 19:13:12 2016<br>
@@ -120,10 +120,9 @@ namespace llvm {<br>
/// type.<br>
/// \param Name Type name.<br>
/// \param SizeInBits Size of the type.<br>
- /// \param AlignInBits Type alignment.<br>
/// \param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.<br>
DIBasicType *createBasicType(StringRef Name, uint64_t SizeInBits,<br>
- uint32_t AlignInBits, unsigned Encoding);<br>
+ unsigned Encoding);<br>
<br>
/// Create debugging information entry for a qualified<br>
/// type, e.g. 'const int'.<br>
@@ -209,7 +208,7 @@ namespace llvm {<br>
/// \param Ty Parent type.<br>
DIDerivedType *createBitFieldMemberType(<br>
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,<br>
- uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,<br>
+ uint64_t SizeInBits, uint64_t OffsetInBits,<br>
uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty);<br>
<br>
/// Create debugging information entry for a<br>
@@ -221,10 +220,12 @@ namespace llvm {<br>
/// \param Ty Type of the static member.<br>
/// \param Flags Flags to encode member attribute, e.g. private.<br>
/// \param Val Const initializer of the member.<br>
+ /// \param AlignInBits Member alignment.<br>
DIDerivedType *createStaticMemberType(DIScop<wbr>e *Scope, StringRef Name,<br>
DIFile *File, unsigned LineNo,<br>
DIType *Ty, DINode::DIFlags Flags,<br>
- llvm::Constant *Val);<br>
+ llvm::Constant *Val,<br>
+ uint32_t AlignInBits = 0);<br>
<br>
/// Create debugging information entry for Objective-C<br>
/// instance variable.<br>
@@ -458,19 +459,22 @@ namespace llvm {<br>
/// \param Expr The location of the global relative to the attached<br>
/// GlobalVariable.<br>
/// \param Decl Reference to the corresponding declaration.<br>
+ /// \param AlignInBits Variable alignment(or 0 if no alignment attr was<br>
+ /// specified)<br>
DIGlobalVariable *createGlobalVariable(DIScope *Context, StringRef Name,<br>
StringRef LinkageName, DIFile *File,<br>
unsigned LineNo, DIType *Ty,<br>
bool isLocalToUnit,<br>
DIExpression *Expr = nullptr,<br>
- MDNode *Decl = nullptr);<br>
+ MDNode *Decl = nullptr,<br>
+ uint32_t AlignInBits = 0);<br>
<br>
/// Identical to createGlobalVariable<br>
/// except that the resulting DbgNode is temporary and meant to be RAUWed.<br>
DIGlobalVariable *createTempGlobalVariableFwdDe<wbr>cl(<br>
DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,<br>
unsigned LineNo, DIType *Ty, bool isLocalToUnit, DIExpression *Expr,<br>
- MDNode *Decl = nullptr);<br>
+ MDNode *Decl = nullptr, uint32_t AlignInBits = 0);<br>
<br>
/// Create a new descriptor for an auto variable. This is a local variable<br>
/// that is not a subprogram parameter.<br>
@@ -483,7 +487,8 @@ namespace llvm {<br>
DILocalVariable *<br>
createAutoVariable(DIScope *Scope, StringRef Name, DIFile *File,<br>
unsigned LineNo, DIType *Ty, bool AlwaysPreserve = false,<br>
- DINode::DIFlags Flags = DINode::FlagZero);<br>
+ DINode::DIFlags Flags = DINode::FlagZero,<br>
+ uint32_t AlignInBits = 0);<br>
<br>
/// Create a new descriptor for a parameter variable.<br>
///<br>
<br>
Modified: llvm/trunk/include/llvm/IR/Deb<wbr>ugInfoMetadata.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/include/llvm/<wbr>IR/DebugInfoMetadata.h?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/include/llvm/IR/Deb<wbr>ugInfoMetadata.h (original)<br>
+++ llvm/trunk/include/llvm/IR/Deb<wbr>ugInfoMetadata.h Wed Oct 19 19:13:12 2016<br>
@@ -549,7 +549,8 @@ public:<br>
<br>
unsigned getLine() const { return Line; }<br>
uint64_t getSizeInBits() const { return SizeInBits; }<br>
- uint64_t getAlignInBits() const { return AlignInBits; }<br>
+ uint32_t getAlignInBits() const { return AlignInBits; }<br>
+ uint32_t getAlignInBytes() const { return getAlignInBits() / CHAR_BIT; }<br>
uint64_t getOffsetInBits() const { return OffsetInBits; }<br>
DIFlags getFlags() const { return Flags; }<br>
<br>
@@ -1826,11 +1827,13 @@ public:<br>
/// \brief Base class for variables.<br>
class DIVariable : public DINode {<br>
unsigned Line;<br>
+ uint64_t AlignInBits;<br>
<br>
protected:<br>
DIVariable(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Line,<br>
- ArrayRef<Metadata *> Ops)<br>
- : DINode(C, ID, Storage, dwarf::DW_TAG_variable, Ops), Line(Line) {}<br>
+ ArrayRef<Metadata *> Ops, uint64_t AlignInBits = 0)<br>
+ : DINode(C, ID, Storage, dwarf::DW_TAG_variable, Ops), Line(Line),<br>
+ AlignInBits(AlignInBits) {}<br>
~DIVariable() = default;<br>
<br>
public:<br>
@@ -1839,6 +1842,8 @@ public:<br>
StringRef getName() const { return getStringOperand(1); }<br>
DIFile *getFile() const { return cast_or_null<DIFile>(getRawFil<wbr>e()); }<br>
DITypeRef getType() const { return DITypeRef(getRawType()); }<br>
+ uint64_t getAlignInBits() const { return AlignInBits; }<br>
+ uint64_t getAlignInBytes() const { return getAlignInBits() / CHAR_BIT; }<br>
<br>
StringRef getFilename() const {<br>
if (auto *F = getFile())<br>
@@ -2026,9 +2031,9 @@ class DIGlobalVariable : public DIVariab<br>
bool IsDefinition;<br>
<br>
DIGlobalVariable(LLVMContext &C, StorageType Storage, unsigned Line,<br>
- bool IsLocalToUnit, bool IsDefinition,<br>
+ bool IsLocalToUnit, bool IsDefinition, uint64_t AlignInBits,<br>
ArrayRef<Metadata *> Ops)<br>
- : DIVariable(C, DIGlobalVariableKind, Storage, Line, Ops),<br>
+ : DIVariable(C, DIGlobalVariableKind, Storage, Line, Ops, AlignInBits),<br>
IsLocalToUnit(IsLocalToUnit), IsDefinition(IsDefinition) {}<br>
~DIGlobalVariable() = default;<br>
<br>
@@ -2036,42 +2041,48 @@ class DIGlobalVariable : public DIVariab<br>
getImpl(LLVMContext &Context, DIScope *Scope, StringRef Name,<br>
StringRef LinkageName, DIFile *File, unsigned Line, DITypeRef Type,<br>
bool IsLocalToUnit, bool IsDefinition, DIExpression *Expr,<br>
- DIDerivedType *StaticDataMemberDeclaration, StorageType Storage,<br>
- bool ShouldCreate = true) {<br>
+ DIDerivedType *StaticDataMemberDeclaration, uint64_t AlignInBits,<br>
+ StorageType Storage, bool ShouldCreate = true) {<br>
return getImpl(Context, Scope, getCanonicalMDString(Context, Name),<br>
getCanonicalMDString(Context, LinkageName), File, Line, Type,<br>
IsLocalToUnit, IsDefinition, Expr,<br>
- StaticDataMemberDeclaration, Storage, ShouldCreate);<br>
+ StaticDataMemberDeclaration, AlignInBits, Storage,<br>
+ ShouldCreate);<br>
}<br>
static DIGlobalVariable *<br>
getImpl(LLVMContext &Context, Metadata *Scope, MDString *Name,<br>
MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type,<br>
bool IsLocalToUnit, bool IsDefinition, Metadata *Expr,<br>
- Metadata *StaticDataMemberDeclaration, StorageType Storage,<br>
- bool ShouldCreate = true);<br>
+ Metadata *StaticDataMemberDeclaration, uint64_t AlignInBits,<br>
+ StorageType Storage, bool ShouldCreate = true);<br>
<br>
TempDIGlobalVariable cloneImpl() const {<br>
return getTemporary(getContext(), getScope(), getName(), getLinkageName(),<br>
getFile(), getLine(), getType(), isLocalToUnit(),<br>
isDefinition(), getExpr(),<br>
- getStaticDataMemberDeclaration<wbr>());<br>
+ getStaticDataMemberDeclaration<wbr>(), getAlignInBits());<br>
}<br>
<br>
public:<br>
DEFINE_MDNODE_GET(DIGlobalVar<wbr>iable,<br>
(DIScope * Scope, StringRef Name, StringRef LinkageName,<br>
DIFile *File, unsigned Line, DITypeRef Type,<br>
- bool IsLocalToUnit, bool IsDefinition, DIExpression *Expr,<br>
- DIDerivedType *StaticDataMemberDeclaration),<br>
+ bool IsLocalToUnit, bool IsDefinition,<br>
+ DIExpression *Expr,<br>
+ DIDerivedType *StaticDataMemberDeclaration,<br>
+ uint64_t AlignInBits),<br>
(Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit,<br>
- IsDefinition, Expr, StaticDataMemberDeclaration))<br>
+ IsDefinition, Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits))<br>
DEFINE_MDNODE_GET(DIGlobalVar<wbr>iable,<br>
(Metadata * Scope, MDString *Name, MDString *LinkageName,<br>
Metadata *File, unsigned Line, Metadata *Type,<br>
- bool IsLocalToUnit, bool IsDefinition, Metadata *Expr,<br>
- Metadata *StaticDataMemberDeclaration),<br>
+ bool IsLocalToUnit, bool IsDefinition,<br>
+ Metadata *Expr, Metadata *StaticDataMemberDeclaration,<br>
+ uint64_t AlignInBits),<br>
(Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit,<br>
- IsDefinition, Expr, StaticDataMemberDeclaration))<br>
+ IsDefinition, Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits))<br>
<br>
TempDIGlobalVariable clone() const { return cloneImpl(); }<br>
<br>
@@ -2109,9 +2120,10 @@ class DILocalVariable : public DIVariabl<br>
DIFlags Flags;<br>
<br>
DILocalVariable(LLVMContext &C, StorageType Storage, unsigned Line,<br>
- unsigned Arg, DIFlags Flags, ArrayRef<Metadata *> Ops)<br>
- : DIVariable(C, DILocalVariableKind, Storage, Line, Ops), Arg(Arg),<br>
- Flags(Flags) {<br>
+ unsigned Arg, DIFlags Flags, uint64_t AlignInBits,<br>
+ ArrayRef<Metadata *> Ops)<br>
+ : DIVariable(C, DILocalVariableKind, Storage, Line, Ops, AlignInBits),<br>
+ Arg(Arg), Flags(Flags) {<br>
assert(Arg < (1 << 16) && "DILocalVariable: Arg out of range");<br>
}<br>
~DILocalVariable() = default;<br>
@@ -2119,33 +2131,34 @@ class DILocalVariable : public DIVariabl<br>
static DILocalVariable *getImpl(LLVMContext &Context, DIScope *Scope,<br>
StringRef Name, DIFile *File, unsigned Line,<br>
DITypeRef Type, unsigned Arg, DIFlags Flags,<br>
- StorageType Storage,<br>
+ uint64_t AlignInBits, StorageType Storage,<br>
bool ShouldCreate = true) {<br>
return getImpl(Context, Scope, getCanonicalMDString(Context, Name), File,<br>
- Line, Type, Arg, Flags, Storage, ShouldCreate);<br>
+ Line, Type, Arg, Flags, AlignInBits, Storage, ShouldCreate);<br>
}<br>
static DILocalVariable *getImpl(LLVMContext &Context, Metadata *Scope,<br>
MDString *Name, Metadata *File, unsigned Line,<br>
Metadata *Type, unsigned Arg, DIFlags Flags,<br>
- StorageType Storage,<br>
+ uint64_t AlignInBits, StorageType Storage,<br>
bool ShouldCreate = true);<br>
<br>
TempDILocalVariable cloneImpl() const {<br>
return getTemporary(getContext(), getScope(), getName(), getFile(),<br>
- getLine(), getType(), getArg(), getFlags());<br>
+ getLine(), getType(), getArg(), getFlags(),<br>
+ getAlignInBits());<br>
}<br>
<br>
public:<br>
DEFINE_MDNODE_GET(DILocalVari<wbr>able,<br>
(DILocalScope * Scope, StringRef Name, DIFile *File,<br>
unsigned Line, DITypeRef Type, unsigned Arg,<br>
- DIFlags Flags),<br>
- (Scope, Name, File, Line, Type, Arg, Flags))<br>
+ DIFlags Flags, uint64_t AlignInBits),<br>
+ (Scope, Name, File, Line, Type, Arg, Flags, AlignInBits))<br>
DEFINE_MDNODE_GET(DILocalVari<wbr>able,<br>
(Metadata * Scope, MDString *Name, Metadata *File,<br>
unsigned Line, Metadata *Type, unsigned Arg,<br>
- DIFlags Flags),<br>
- (Scope, Name, File, Line, Type, Arg, Flags))<br>
+ DIFlags Flags, uint64_t AlignInBits),<br>
+ (Scope, Name, File, Line, Type, Arg, Flags, AlignInBits))<br>
<br>
TempDILocalVariable clone() const { return cloneImpl(); }<br>
<br>
<br>
Modified: llvm/trunk/lib/AsmParser/LLPar<wbr>ser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/AsmParser<wbr>/LLParser.cpp?rev=284678&r1=<wbr>284677&r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/AsmParser/LLPar<wbr>ser.cpp (original)<br>
+++ llvm/trunk/lib/AsmParser/LLPar<wbr>ser.cpp Wed Oct 19 19:13:12 2016<br>
@@ -4186,7 +4186,7 @@ bool LLParser::ParseDITemplateValue<wbr>Param<br>
/// ::= !DIGlobalVariable(scope: !0, name: "foo", linkageName: "foo",<br>
/// file: !1, line: 7, type: !2, isLocal: false,<br>
/// isDefinition: true, variable: i32* @foo,<br>
-/// declaration: !3)<br>
+/// declaration: !3, align: 8)<br>
bool LLParser::ParseDIGlobalVariabl<wbr>e(MDNode *&Result, bool IsDistinct) {<br>
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \<br>
REQUIRED(name, MDStringField, (/* AllowEmpty */ false)); \<br>
@@ -4198,22 +4198,26 @@ bool LLParser::ParseDIGlobalVariabl<wbr>e(MDN<br>
OPTIONAL(isLocal, MDBoolField, ); \<br>
OPTIONAL(isDefinition, MDBoolField, (true)); \<br>
OPTIONAL(expr, MDField, ); \<br>
- OPTIONAL(declaration, MDField, );<br>
+ OPTIONAL(declaration, MDField, ); \<br>
+ OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX));<br>
PARSE_MD_FIELDS();<br>
#undef VISIT_MD_FIELDS<br>
<br>
Result = GET_OR_DISTINCT(DIGlobalVariab<wbr>le,<br>
(Context, scope.Val, name.Val, linkageName.Val,<br>
file.Val, line.Val, type.Val, isLocal.Val,<br>
- isDefinition.Val, expr.Val, declaration.Val));<br>
+ isDefinition.Val, expr.Val, declaration.Val,<br>
+ align.Val));<br>
return false;<br>
}<br>
<br>
/// ParseDILocalVariable:<br>
/// ::= !DILocalVariable(arg: 7, scope: !0, name: "foo",<br>
-/// file: !1, line: 7, type: !2, arg: 2, flags: 7)<br>
+/// file: !1, line: 7, type: !2, arg: 2, flags: 7,<br>
+/// align: 8)<br>
/// ::= !DILocalVariable(scope: !0, name: "foo",<br>
-/// file: !1, line: 7, type: !2, arg: 2, flags: 7)<br>
+/// file: !1, line: 7, type: !2, arg: 2, flags: 7,<br>
+/// align: 8)<br>
bool LLParser::ParseDILocalVariable<wbr>(MDNode *&Result, bool IsDistinct) {<br>
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \<br>
REQUIRED(scope, MDField, (/* AllowNull */ false)); \<br>
@@ -4222,13 +4226,14 @@ bool LLParser::ParseDILocalVariable<wbr>(MDNo<br>
OPTIONAL(file, MDField, ); \<br>
OPTIONAL(line, LineField, ); \<br>
OPTIONAL(type, MDField, ); \<br>
- OPTIONAL(flags, DIFlagField, );<br>
+ OPTIONAL(flags, DIFlagField, ); \<br>
+ OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX));<br>
PARSE_MD_FIELDS();<br>
#undef VISIT_MD_FIELDS<br>
<br>
Result = GET_OR_DISTINCT(DILocalVariabl<wbr>e,<br>
(Context, scope.Val, name.Val, file.Val, line.Val,<br>
- type.Val, arg.Val, flags.Val));<br>
+ type.Val, arg.Val, flags.Val, align.Val));<br>
return false;<br>
}<br>
<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Reader/<wbr>BitcodeReader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/Bitcode/<wbr>Reader/BitcodeReader.cpp?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Bitcode/Reader/<wbr>BitcodeReader.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Reader/<wbr>BitcodeReader.cpp Wed Oct 19 19:13:12 2016<br>
@@ -2734,7 +2734,7 @@ std::error_code BitcodeReader::parseMeta<br>
break;<br>
}<br>
case bitc::METADATA_GLOBAL_VAR: {<br>
- if (Record.size() != 11)<br>
+ if (Record.size() < 11 || Record.size() > 12)<br>
return error("Invalid record");<br>
<br>
IsDistinct = Record[0];<br>
@@ -2742,6 +2742,7 @@ std::error_code BitcodeReader::parseMeta<br>
// Upgrade old metadata, which stored a global variable reference or a<br>
// ConstantInt here.<br>
Metadata *Expr = getMDOrNull(Record[9]);<br>
+ uint64_t AlignInBits = (Record.size() > 11) ? Record[11] : 0;<br>
GlobalVariable *Attach = nullptr;<br>
if (auto *CMD = dyn_cast_or_null<ConstantAsMet<wbr>adata>(Expr)) {<br>
if (auto *GV = dyn_cast<GlobalVariable>(CMD-><wbr>getValue())) {<br>
@@ -2761,7 +2762,7 @@ std::error_code BitcodeReader::parseMeta<br>
(Context, getMDOrNull(Record[1]), getMDString(Record[2]),<br>
getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],<br>
getDITypeRefOrNull(Record[6]), Record[7], Record[8], Expr,<br>
- getMDOrNull(Record[10])));<br>
+ getMDOrNull(Record[10]), AlignInBits));<br>
MetadataList.assignValue(DGV, NextMetadataNo++);<br>
<br>
if (Attach)<br>
@@ -2774,18 +2775,21 @@ std::error_code BitcodeReader::parseMeta<br>
if (Record.size() < 8 || Record.size() > 10)<br>
return error("Invalid record");<br>
<br>
+ IsDistinct = Record[0] & 1;<br>
+ bool HasAlignment = Record[0] & 2;<br>
// 2nd field used to be an artificial tag, either DW_TAG_auto_variable or<br>
- // DW_TAG_arg_variable.<br>
- IsDistinct = Record[0];<br>
- bool HasTag = Record.size() > 8;<br>
+ // DW_TAG_arg_variable, if we have alignment flag encoded it means, that<br>
+ // this is newer version of record which doesn't have artifical tag.<br>
+ bool HasTag = !HasAlignment && Record.size() > 8;<br>
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(R<wbr>ecord[7 + HasTag]);<br>
+ uint64_t AlignInBits = HasAlignment ? Record[8 + HasTag] : 0;<br>
MetadataList.assignValue(<br>
GET_OR_DISTINCT(DILocalVariab<wbr>le,<br>
(Context, getMDOrNull(Record[1 + HasTag]),<br>
getMDString(Record[2 + HasTag]),<br>
getMDOrNull(Record[3 + HasTag]), Record[4 + HasTag],<br>
getDITypeRefOrNull(Record[5 + HasTag]),<br>
- Record[6 + HasTag], Flags)),<br>
+ Record[6 + HasTag], Flags, AlignInBits)),<br>
NextMetadataNo++);<br>
break;<br>
}<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Writer/<wbr>BitcodeWriter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/Bitcode/<wbr>Writer/BitcodeWriter.cpp?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Bitcode/Writer/<wbr>BitcodeWriter.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Writer/<wbr>BitcodeWriter.cpp Wed Oct 19 19:13:12 2016<br>
@@ -1712,6 +1712,7 @@ void ModuleBitcodeWriter::writeDIGl<wbr>obalV<br>
Record.push_back(N->isDefinit<wbr>ion());<br>
Record.push_back(VE.getMetada<wbr>taOrNullID(N->getRawExpr()));<br>
Record.push_back(VE.getMetada<wbr>taOrNullID(N->getStaticDataMem<wbr>berDeclaration()));<br>
+ Record.push_back(N->getAlignIn<wbr>Bits());<br>
<br>
Stream.EmitRecord(bitc::METAD<wbr>ATA_GLOBAL_VAR, Record, Abbrev);<br>
Record.clear();<br>
@@ -1720,7 +1721,21 @@ void ModuleBitcodeWriter::writeDIGl<wbr>obalV<br>
void ModuleBitcodeWriter::writeDILo<wbr>calVariable(<br>
const DILocalVariable *N, SmallVectorImpl<uint64_t> &Record,<br>
unsigned Abbrev) {<br>
- Record.push_back(N->isDistinct<wbr>());<br>
+ // In order to support all possible bitcode formats in BitcodeReader we need<br>
+ // to distiguish the following cases:<br>
+ // 1) Record has no artificial tag (Record[1]),<br>
+ // has no obsolete inlinedAt field (Record[9]).<br>
+ // In this case Record size will be 8, HasAlignment flag is false.<br>
+ // 2) Record has artificial tag (Record[1]),<br>
+ // has no obsolete inlignedAt field (Record[9]).<br>
+ // In this case Record size will be 9, HasAlignment flag is false.<br>
+ // 3) Record has both artificial tag (Record[1]) and<br>
+ // obsolete inlignedAt field (Record[9]).<br>
+ // In this case Record size will be 10, HasAlignment flag is false.<br>
+ // 4) Record has neither artificial tag, nor inlignedAt field, but<br>
+ // HasAlignment flag is true and Record[8] contains alignment value.<br>
+ const uint64_t HasAlignmentFlag = 1 << 1;<br>
+ Record.push_back(N->isDistinct<wbr>() | HasAlignmentFlag);<br>
Record.push_back(VE.getMetada<wbr>taOrNullID(N->getScope()));<br>
Record.push_back(VE.getMetada<wbr>taOrNullID(N->getRawName()));<br>
Record.push_back(VE.getMetada<wbr>taOrNullID(N->getFile()));<br>
@@ -1728,6 +1743,7 @@ void ModuleBitcodeWriter::writeDILo<wbr>calVa<br>
Record.push_back(VE.getMetada<wbr>taOrNullID(N->getType()));<br>
Record.push_back(N->getArg())<wbr>;<br>
Record.push_back(N->getFlags(<wbr>));<br>
+ Record.push_back(N->getAlignIn<wbr>Bits());<br>
<br>
Stream.EmitRecord(bitc::METAD<wbr>ATA_LOCAL_VAR, Record, Abbrev);<br>
Record.clear();<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrin<wbr>ter/DwarfUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/CodeGen/<wbr>AsmPrinter/DwarfUnit.cpp?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/CodeGen/AsmPrin<wbr>ter/DwarfUnit.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrin<wbr>ter/DwarfUnit.cpp Wed Oct 19 19:13:12 2016<br>
@@ -1404,9 +1404,11 @@ void DwarfUnit::constructMemberDIE(<wbr>DIE &<br>
addUInt(MemberDie, dwarf::DW_AT_bit_size, None, Size);<br>
<br>
uint64_t Offset = DT->getOffsetInBits();<br>
- uint32_t Align = DT->getAlignInBits() ? DT->getAlignInBits()<br>
- : FieldSize;<br>
- uint32_t AlignMask = ~(Align - 1);<br>
+ // We can't use DT->getAlignInBits() here: AlignInBits for member type<br>
+ // is non-zero if and only if alignment was forced (e.g. _Alignas()),<br>
+ // which can't be done with bitfields. Thus we use FieldSize here.<br>
+ uint32_t AlignInBits = FieldSize;<br>
+ uint32_t AlignMask = ~(AlignInBits - 1);<br>
// The bits from the start of the storage unit to the start of the field.<br>
uint64_t StartBitOffset = Offset - (Offset & AlignMask);<br>
// The byte offset of the field's aligned storage unit inside the struct.<br>
<br>
Modified: llvm/trunk/lib/IR/AsmWriter.cp<wbr>p<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/IR/AsmWri<wbr>ter.cpp?rev=284678&r1=284677&<wbr>r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/IR/AsmWriter.cp<wbr>p (original)<br>
+++ llvm/trunk/lib/IR/AsmWriter.cp<wbr>p Wed Oct 19 19:13:12 2016<br>
@@ -1822,6 +1822,7 @@ static void writeDIGlobalVariable(raw_os<br>
Printer.printBool("isDefiniti<wbr>on", N->isDefinition());<br>
Printer.printMetadata("expr", N->getExpr());<br>
Printer.printMetadata("declar<wbr>ation", N->getRawStaticDataMemberDecla<wbr>ration());<br>
+ Printer.printInt("align", N->getAlignInBits());<br>
Out << ")";<br>
}<br>
<br>
@@ -1837,6 +1838,7 @@ static void writeDILocalVariable(raw_ost<br>
Printer.printInt("line", N->getLine());<br>
Printer.printMetadata("type", N->getRawType());<br>
Printer.printDIFlags("flags", N->getFlags());<br>
+ Printer.printInt("align", N->getAlignInBits());<br>
Out << ")";<br>
}<br>
<br>
<br>
Modified: llvm/trunk/lib/IR/DIBuilder.cp<wbr>p<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/IR/DIBuil<wbr>der.cpp?rev=284678&r1=284677&<wbr>r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/IR/DIBuilder.cp<wbr>p (original)<br>
+++ llvm/trunk/lib/IR/DIBuilder.cp<wbr>p Wed Oct 19 19:13:12 2016<br>
@@ -195,11 +195,10 @@ DIBasicType *DIBuilder::createNullPtrTyp<br>
}<br>
<br>
DIBasicType *DIBuilder::createBasicType(St<wbr>ringRef Name, uint64_t SizeInBits,<br>
- uint32_t AlignInBits,<br>
unsigned Encoding) {<br>
assert(!Name.empty() && "Unable to create type without name");<br>
return DIBasicType::get(VMContext, dwarf::DW_TAG_base_type, Name, SizeInBits,<br>
- AlignInBits, Encoding);<br>
+ 0, Encoding);<br>
}<br>
<br>
DIDerivedType *DIBuilder::createQualifiedTyp<wbr>e(unsigned Tag, DIType *FromTy) {<br>
@@ -277,24 +276,26 @@ static ConstantAsMetadata *getConstantOr<br>
<br>
DIDerivedType *DIBuilder::createBitFieldMemb<wbr>erType(<br>
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,<br>
- uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,<br>
- uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty) {<br>
+ uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits,<br>
+ DINode::DIFlags Flags, DIType *Ty) {<br>
Flags |= DINode::FlagBitField;<br>
return DIDerivedType::get(<br>
VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,<br>
- getNonCompileUnitScope(Scope), Ty, SizeInBits, AlignInBits, OffsetInBits,<br>
- Flags, ConstantAsMetadata::get(Consta<wbr>ntInt::get(<br>
- IntegerType::get(VMContext, 64), StorageOffsetInBits)));<br>
+ getNonCompileUnitScope(Scope), Ty, SizeInBits, /* AlignInBits */ 0,<br>
+ OffsetInBits, Flags,<br>
+ ConstantAsMetadata::get(Consta<wbr>ntInt::get(IntegerType::get(<wbr>VMContext, 64),<br>
+ StorageOffsetInBits)));<br>
}<br>
<br>
DIDerivedType *<br>
DIBuilder::createStaticMember<wbr>Type(DIScope *Scope, StringRef Name, DIFile *File,<br>
unsigned LineNumber, DIType *Ty,<br>
- DINode::DIFlags Flags, llvm::Constant *Val) {<br>
+ DINode::DIFlags Flags, llvm::Constant *Val,<br>
+ uint32_t AlignInBits) {<br>
Flags |= DINode::FlagStaticMember;<br>
return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,<br>
- LineNumber, getNonCompileUnitScope(Scope), Ty, 0, 0,<br>
- 0, Flags, getConstantOrNull(Val));<br>
+ LineNumber, getNonCompileUnitScope(Scope), Ty, 0,<br>
+ AlignInBits, 0, Flags, getConstantOrNull(Val));<br>
}<br>
<br>
DIDerivedType *<br>
@@ -535,28 +536,28 @@ static void checkGlobalVariableScope(DIS<br>
<br>
DIGlobalVariable *DIBuilder::createGlobalVariab<wbr>le(<br>
DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *F,<br>
- unsigned LineNumber, DIType *Ty, bool isLocalToUnit, DIExpression *Expr,<br>
- MDNode *Decl) {<br>
+ unsigned LineNumber, DIType *Ty, bool isLocalToUnit,<br>
+ DIExpression *Expr, MDNode *Decl, uint32_t AlignInBits) {<br>
checkGlobalVariableScope(Cont<wbr>ext);<br>
<br>
auto *N = DIGlobalVariable::getDistinct(<br>
VMContext, cast_or_null<DIScope>(Context)<wbr>, Name, LinkageName, F,<br>
LineNumber, Ty, isLocalToUnit, true, Expr,<br>
- cast_or_null<DIDerivedType>(De<wbr>cl));<br>
+ cast_or_null<DIDerivedType>(De<wbr>cl), AlignInBits);<br>
AllGVs.push_back(N);<br>
return N;<br>
}<br>
<br>
DIGlobalVariable *DIBuilder::createTempGlobalVa<wbr>riableFwdDecl(<br>
DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *F,<br>
- unsigned LineNumber, DIType *Ty, bool isLocalToUnit, DIExpression *Expr,<br>
- MDNode *Decl) {<br>
+ unsigned LineNumber, DIType *Ty, bool isLocalToUnit,<br>
+ DIExpression *Expr, MDNode *Decl, uint32_t AlignInBits) {<br>
checkGlobalVariableScope(Cont<wbr>ext);<br>
<br>
return DIGlobalVariable::getTemporary<wbr>(<br>
VMContext, cast_or_null<DIScope>(Context)<wbr>, Name, LinkageName, F,<br>
LineNumber, Ty, isLocalToUnit, false, Expr,<br>
- cast_or_null<DIDerivedType>(D<wbr>ecl))<br>
+ cast_or_null<DIDerivedType>(D<wbr>ecl), AlignInBits)<br>
.release();<br>
}<br>
<br>
@@ -564,7 +565,8 @@ static DILocalVariable *createLocalVaria<br>
LLVMContext &VMContext,<br>
DenseMap<MDNode *, SmallVector<TrackingMDNodeRef, 1>> &PreservedVariables,<br>
DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File,<br>
- unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags) {<br>
+ unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags,<br>
+ uint32_t AlignInBits) {<br>
// FIXME: Why getNonCompileUnitScope()?<br>
// FIXME: Why is "!Context" okay here?<br>
// FIXME: Why doesn't this check for a subprogram or lexical block (AFAICT<br>
@@ -573,7 +575,7 @@ static DILocalVariable *createLocalVaria<br>
<br>
auto *Node =<br>
DILocalVariable::get(VMContex<wbr>t, cast_or_null<DILocalScope>(Con<wbr>text), Name,<br>
- File, LineNo, Ty, ArgNo, Flags);<br>
+ File, LineNo, Ty, ArgNo, Flags, AlignInBits);<br>
if (AlwaysPreserve) {<br>
// The optimizer may remove local variables. If there is an interest<br>
// to preserve variable info in such situation then stash it in a<br>
@@ -588,10 +590,11 @@ static DILocalVariable *createLocalVaria<br>
DILocalVariable *DIBuilder::createAutoVariable<wbr>(DIScope *Scope, StringRef Name,<br>
DIFile *File, unsigned LineNo,<br>
DIType *Ty, bool AlwaysPreserve,<br>
- DINode::DIFlags Flags) {<br>
+ DINode::DIFlags Flags,<br>
+ uint32_t AlignInBits) {<br>
return createLocalVariable(VMContext, PreservedVariables, Scope, Name,<br>
/* ArgNo */ 0, File, LineNo, Ty, AlwaysPreserve,<br>
- Flags);<br>
+ Flags, AlignInBits);<br>
}<br>
<br>
DILocalVariable *DIBuilder::createParameterVar<wbr>iable(<br>
@@ -599,7 +602,8 @@ DILocalVariable *DIBuilder::createParame<br>
unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags) {<br>
assert(ArgNo && "Expected non-zero argument number for parameter");<br>
return createLocalVariable(VMContext, PreservedVariables, Scope, Name, ArgNo,<br>
- File, LineNo, Ty, AlwaysPreserve, Flags);<br>
+ File, LineNo, Ty, AlwaysPreserve, Flags,<br>
+ /* AlignInBits */0);<br>
}<br>
<br>
DIExpression *DIBuilder::createExpression(A<wbr>rrayRef<uint64_t> Addr) {<br>
<br>
Modified: llvm/trunk/lib/IR/DebugInfoMet<wbr>adata.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfoMetadata.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/IR/DebugI<wbr>nfoMetadata.cpp?rev=284678&r1=<wbr>284677&r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/IR/DebugInfoMet<wbr>adata.cpp (original)<br>
+++ llvm/trunk/lib/IR/DebugInfoMet<wbr>adata.cpp Wed Oct 19 19:13:12 2016<br>
@@ -510,16 +510,18 @@ DIGlobalVariable::getImpl(LLVM<wbr>Context &C<br>
Metadata *Type, bool IsLocalToUnit, bool IsDefinition,<br>
Metadata *Variable,<br>
Metadata *StaticDataMemberDeclaration,<br>
+ uint64_t AlignInBits,<br>
StorageType Storage, bool ShouldCreate) {<br>
assert(isCanonical(Name) && "Expected canonical MDString");<br>
assert(isCanonical(LinkageNam<wbr>e) && "Expected canonical MDString");<br>
DEFINE_GETIMPL_LOOKUP(DIGloba<wbr>lVariable,<br>
(Scope, Name, LinkageName, File, Line, Type,<br>
IsLocalToUnit, IsDefinition, Variable,<br>
- StaticDataMemberDeclaration))<wbr>;<br>
+ StaticDataMemberDeclaration, AlignInBits));<br>
Metadata *Ops[] = {Scope, Name, File, Type,<br>
Name, LinkageName, Variable, StaticDataMemberDeclaration};<br>
- DEFINE_GETIMPL_STORE(DIGlobalV<wbr>ariable, (Line, IsLocalToUnit, IsDefinition),<br>
+ DEFINE_GETIMPL_STORE(DIGlobalV<wbr>ariable,<br>
+ (Line, IsLocalToUnit, IsDefinition, AlignInBits),<br>
Ops);<br>
}<br>
<br>
@@ -527,6 +529,7 @@ DILocalVariable *DILocalVariable::getImp<br>
MDString *Name, Metadata *File,<br>
unsigned Line, Metadata *Type,<br>
unsigned Arg, DIFlags Flags,<br>
+ uint64_t AlignInBits,<br>
StorageType Storage,<br>
bool ShouldCreate) {<br>
// 64K ought to be enough for any frontend.<br>
@@ -535,9 +538,10 @@ DILocalVariable *DILocalVariable::getImp<br>
assert(Scope && "Expected scope");<br>
assert(isCanonical(Name) && "Expected canonical MDString");<br>
DEFINE_GETIMPL_LOOKUP(DILocal<wbr>Variable,<br>
- (Scope, Name, File, Line, Type, Arg, Flags));<br>
+ (Scope, Name, File, Line, Type, Arg, Flags,<br>
+ AlignInBits));<br>
Metadata *Ops[] = {Scope, Name, File, Type};<br>
- DEFINE_GETIMPL_STORE(DILocalVa<wbr>riable, (Line, Arg, Flags), Ops);<br>
+ DEFINE_GETIMPL_STORE(DILocalVa<wbr>riable, (Line, Arg, Flags, AlignInBits), Ops);<br>
}<br>
<br>
DIExpression *DIExpression::getImpl(LLVMCon<wbr>text &Context,<br>
<br>
Modified: llvm/trunk/lib/IR/LLVMContextI<wbr>mpl.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/IR/LLVMCo<wbr>ntextImpl.h?rev=284678&r1=<wbr>284677&r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/IR/LLVMContextI<wbr>mpl.h (original)<br>
+++ llvm/trunk/lib/IR/LLVMContextI<wbr>mpl.h Wed Oct 19 19:13:12 2016<br>
@@ -761,22 +761,26 @@ template <> struct MDNodeKeyImpl<DIGloba<br>
bool IsDefinition;<br>
Metadata *Expr;<br>
Metadata *StaticDataMemberDeclaration;<br>
+ uint64_t AlignInBits;<br>
<br>
MDNodeKeyImpl(Metadata *Scope, MDString *Name, MDString *LinkageName,<br>
Metadata *File, unsigned Line, Metadata *Type,<br>
- bool IsLocalToUnit, bool IsDefinition, Metadata *Expr,<br>
- Metadata *StaticDataMemberDeclaration)<br>
+ bool IsLocalToUnit, bool IsDefinition,<br>
+ Metadata *Expr, Metadata *StaticDataMemberDeclaration,<br>
+ uint64_t AlignInBits)<br>
: Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),<br>
Line(Line), Type(Type), IsLocalToUnit(IsLocalToUnit),<br>
IsDefinition(IsDefinition), Expr(Expr),<br>
- StaticDataMemberDeclaration(St<wbr>aticDataMemberDeclaration) {}<br>
+ StaticDataMemberDeclaration(St<wbr>aticDataMemberDeclaration),<br>
+ AlignInBits(AlignInBits) {}<br>
MDNodeKeyImpl(const DIGlobalVariable *N)<br>
: Scope(N->getRawScope()), Name(N->getRawName()),<br>
LinkageName(N->getRawLinkageN<wbr>ame()), File(N->getRawFile()),<br>
Line(N->getLine()), Type(N->getRawType()),<br>
IsLocalToUnit(N->isLocalToUni<wbr>t()), IsDefinition(N->isDefinition()<wbr>),<br>
Expr(N->getRawExpr()),<br>
- StaticDataMemberDeclaration(N-<wbr>>getRawStaticDataMemberDeclara<wbr>tion()) {}<br>
+ StaticDataMemberDeclaration(N-<wbr>>getRawStaticDataMemberDeclara<wbr>tion()),<br>
+ AlignInBits(N->getAlignInBits(<wbr>)) {}<br>
<br>
bool isKeyOf(const DIGlobalVariable *RHS) const {<br>
return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&<br>
@@ -786,11 +790,19 @@ template <> struct MDNodeKeyImpl<DIGloba<br>
IsDefinition == RHS->isDefinition() &&<br>
Expr == RHS->getRawExpr() &&<br>
StaticDataMemberDeclaration ==<br>
- RHS->getRawStaticDataMemberDe<wbr>claration();<br>
+ RHS->getRawStaticDataMemberDe<wbr>claration() &&<br>
+ AlignInBits == RHS->getAlignInBits();<br>
}<br>
unsigned getHashValue() const {<br>
+ // We do not use AlignInBits in hashing function here on purpose:<br>
+ // in most cases this param for local variable is zero (for function param<br>
+ // it is always zero). This leads to lots of hash collisions and errors on<br>
+ // cases with lots of similar variables.<br>
+ // clang/test/CodeGen/debug-info-<wbr>257-args.c is an example of this problem,<br>
+ // generated IR is random for each run and test fails with Align included.<br>
+ // TODO: make hashing work fine with such situations<br>
return hash_combine(Scope, Name, LinkageName, File, Line, Type,<br>
- IsLocalToUnit, IsDefinition, Expr,<br>
+ IsLocalToUnit, IsDefinition, /* AlignInBits, */ Expr,<br>
StaticDataMemberDeclaration);<br>
}<br>
};<br>
@@ -803,23 +815,32 @@ template <> struct MDNodeKeyImpl<DILocal<br>
Metadata *Type;<br>
unsigned Arg;<br>
unsigned Flags;<br>
+ uint64_t AlignInBits;<br>
<br>
MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line,<br>
- Metadata *Type, unsigned Arg, unsigned Flags)<br>
+ Metadata *Type, unsigned Arg, unsigned Flags,<br>
+ uint64_t AlignInBits)<br>
: Scope(Scope), Name(Name), File(File), Line(Line), Type(Type), Arg(Arg),<br>
- Flags(Flags) {}<br>
+ Flags(Flags), AlignInBits(AlignInBits) {}<br>
MDNodeKeyImpl(const DILocalVariable *N)<br>
: Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()),<br>
Line(N->getLine()), Type(N->getRawType()), Arg(N->getArg()),<br>
- Flags(N->getFlags()) {}<br>
+ Flags(N->getFlags()), AlignInBits(N->getAlignInBits(<wbr>)) {}<br>
<br>
bool isKeyOf(const DILocalVariable *RHS) const {<br>
return Scope == RHS->getRawScope() && Name == RHS->getRawName() &&<br>
File == RHS->getRawFile() && Line == RHS->getLine() &&<br>
Type == RHS->getRawType() && Arg == RHS->getArg() &&<br>
- Flags == RHS->getFlags();<br>
+ Flags == RHS->getFlags() && AlignInBits == RHS->getAlignInBits();<br>
}<br>
unsigned getHashValue() const {<br>
+ // We do not use AlignInBits in hashing function here on purpose:<br>
+ // in most cases this param for local variable is zero (for function param<br>
+ // it is always zero). This leads to lots of hash collisions and errors on<br>
+ // cases with lots of similar variables.<br>
+ // clang/test/CodeGen/debug-info-<wbr>257-args.c is an example of this problem,<br>
+ // generated IR is random for each run and test fails with Align included.<br>
+ // TODO: make hashing work fine with such situations<br>
return hash_combine(Scope, Name, File, Line, Type, Arg, Flags);<br>
}<br>
};<br>
<br>
Modified: llvm/trunk/test/Assembler/digl<wbr>obalvariable.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/diglobalvariable.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/Assemble<wbr>r/diglobalvariable.ll?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Assembler/digl<wbr>obalvariable.ll (original)<br>
+++ llvm/trunk/test/Assembler/digl<wbr>obalvariable.ll Wed Oct 19 19:13:12 2016<br>
@@ -12,10 +12,10 @@<br>
!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
!4 = distinct !{}<br>
<br>
-; CHECK: !5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false)<br>
+; CHECK: !5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0, file: !2, line: 7, type: !3, isLocal: true, isDefinition: false, align: 32)<br>
!5 = !DIGlobalVariable(name: "foo", linkageName: "foo", scope: !0,<br>
file: !2, line: 7, type: !3, isLocal: true,<br>
- isDefinition: false)<br>
+ isDefinition: false, align: 32)<br>
<br>
; CHECK: !6 = !DIGlobalVariable(name: "foo", scope: !0, isLocal: false, isDefinition: true, expr: !7)<br>
; CHECK: !7 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)<br>
<br>
Modified: llvm/trunk/test/Assembler/dilo<wbr>calvariable.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/dilocalvariable.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/Assemble<wbr>r/dilocalvariable.ll?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Assembler/dilo<wbr>calvariable.ll (original)<br>
+++ llvm/trunk/test/Assembler/dilo<wbr>calvariable.ll Wed Oct 19 19:13:12 2016<br>
@@ -18,11 +18,11 @@<br>
!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
!4 = !DILocation(scope: !0)<br>
<br>
-; CHECK: !5 = !DILocalVariable(name: "foo", arg: 3, scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial)<br>
+; CHECK: !5 = !DILocalVariable(name: "foo", arg: 3, scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial, align: 32)<br>
; CHECK: !6 = !DILocalVariable(name: "foo", scope: !0, file: !2, line: 7, type: !3, flags: DIFlagArtificial)<br>
!5 = !DILocalVariable(name: "foo", arg: 3,<br>
scope: !0, file: !2, line: 7, type: !3,<br>
- flags: DIFlagArtificial)<br>
+ flags: DIFlagArtificial, align: 32)<br>
!6 = !DILocalVariable(name: "foo", scope: !0,<br>
file: !2, line: 7, type: !3, flags: DIFlagArtificial)<br>
<br>
<br>
Added: llvm/trunk/test/Bitcode/diloca<wbr>lvariable-3.9.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/dilocalvariable-3.9.ll?rev=284678&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/Bitcode/<wbr>dilocalvariable-3.9.ll?rev=<wbr>284678&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Bitcode/diloca<wbr>lvariable-3.9.ll (added)<br>
+++ llvm/trunk/test/Bitcode/diloca<wbr>lvariable-3.9.ll Wed Oct 19 19:13:12 2016<br>
@@ -0,0 +1,43 @@<br>
+; RUN: llvm-dis -o - %s.bc | FileCheck %s<br>
+<br>
+; CHECK: !9 = !DILocalVariable(name: "i", scope: !6, file: !1, line: 3, type: !10)<br>
+; CHECK: !10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+<br>
+source_filename = "test.cpp"<br>
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32<wbr>:64-S128"<br>
+target triple = "x86_64-unknown-linux-gnu"<br>
+<br>
+; Function Attrs: nounwind uwtable<br>
+define void @_Z1fv() #0 !dbg !6 {<br>
+entry:<br>
+ %i = alloca i32, align 4<br>
+ call void @llvm.dbg.declare(metadata i32* %i, metadata !10, metadata !12), !dbg !13<br>
+ store i32 42, i32* %i, align 4, !dbg !13<br>
+ ret void, !dbg !14<br>
+}<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1<br>
+<br>
+attributes #0 = { nounwind uwtable }<br>
+attributes #1 = { nounwind readnone }<br>
+<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
+!llvm.module.flags = !{!3, !4}<br>
+!llvm.ident = !{!5}<br>
+<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.1 (<a href="http://llvm.org/git/clang.git" rel="noreferrer" target="_blank">http://llvm.org/git/clang.git</a> c3709e72d22432f53f8e2f14354def<wbr>31a96734fe)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)<br>
+!1 = !DIFile(filename: "test.cpp", directory: "/tmp")<br>
+!2 = !{}<br>
+!3 = !{i32 2, !"Dwarf Version", i32 4}<br>
+!4 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!5 = !{!"clang version 3.9.1 (<a href="http://llvm.org/git/clang.git" rel="noreferrer" target="_blank">http://llvm.org/git/clang.git</a> c3709e72d22432f53f8e2f14354def<wbr>31a96734fe)"}<br>
+!6 = distinct !DISubprogram(name: "f", linkageName: "_Z1fv", scope: !7, file: !7, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)<br>
+!7 = !DIFile(filename: "test.cpp", directory: "/tmp")<br>
+!8 = !DISubroutineType(types: !9)<br>
+!9 = !{null}<br>
+!10 = !DILocalVariable(name: "i", scope: !6, file: !7, line: 3, type: !11)<br>
+!11 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+!12 = !DIExpression()<br>
+!13 = !DILocation(line: 3, column: 7, scope: !6)<br>
+!14 = !DILocation(line: 4, column: 1, scope: !6)<br>
<br>
Added: llvm/trunk/test/Bitcode/diloca<wbr>lvariable-3.9.ll.bc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/dilocalvariable-3.9.ll.bc?rev=284678&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/Bitcode/<wbr>dilocalvariable-3.9.ll.bc?rev=<wbr>284678&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
(empty)<br>
<br>
Modified: llvm/trunk/test/DebugInfo/AArc<wbr>h64/bitfields.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/AArch64/bitfields.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/DebugInf<wbr>o/AArch64/bitfields.ll?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/DebugInfo/AArc<wbr>h64/bitfields.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/AArc<wbr>h64/bitfields.ll Wed Oct 19 19:13:12 2016<br>
@@ -60,13 +60,13 @@ target triple = "aarch64_be--linux-gnu"<br>
!3 = !{!4}<br>
!4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true)<br>
!5 = !DIFile(filename: "bitfields.c", directory: "/")<br>
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, align: 32, elements: !7)<br>
+!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, elements: !7)<br>
!7 = !{!8, !10, !11, !12}<br>
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !5, line: 2, baseType: !9, size: 2, align: 32)<br>
-!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !5, line: 3, baseType: !9, size: 32, align: 32, offset: 32)<br>
-!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !5, line: 4, baseType: !9, size: 1, align: 32, offset: 64)<br>
-!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 5, baseType: !9, size: 28, align: 32, offset: 65)<br>
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !5, line: 2, baseType: !9, size: 2)<br>
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br>
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !5, line: 3, baseType: !9, size: 32, offset: 32)<br>
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !5, line: 4, baseType: !9, size: 1, offset: 64)<br>
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 5, baseType: !9, size: 28, offset: 65)<br>
!13 = !{i32 2, !"Dwarf Version", i32 2}<br>
!14 = !{i32 2, !"Debug Info Version", i32 3}<br>
!15 = !{i32 1, !"PIC Level", i32 2}<br>
<br>
Modified: llvm/trunk/test/DebugInfo/ARM/<wbr>big-endian-bitfield.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/ARM/big-endian-bitfield.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/DebugInf<wbr>o/ARM/big-endian-bitfield.ll?<wbr>rev=284678&r1=284677&r2=<wbr>284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/DebugInfo/ARM/<wbr>big-endian-bitfield.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/ARM/<wbr>big-endian-bitfield.ll Wed Oct 19 19:13:12 2016<br>
@@ -23,29 +23,29 @@ target datalayout = "E-m:e-p:32:32-i64:6<br>
!2 = !{}<br>
!3 = !{!4}<br>
!4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 6, type: !5, isLocal: false, isDefinition: true)<br>
-!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 1, size: 32, align: 32, elements: !6)<br>
+!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 1, size: 32, elements: !6)<br>
!6 = !{!7, !9, !10, !11}<br>
; CHECK: DW_TAG_member<br>
; CHECK-NEXT: DW_AT_name{{.*}}"j"<br>
; CHECK-NOT: DW_TAG<br>
; CHECK: DW_AT_data_bit_offset [DW_FORM_data1] (0x00)<br>
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "j", scope: !5, file: !1, line: 2, baseType: !8, size: 5, align: 32)<br>
-!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+!7 = !DIDerivedType(tag: DW_TAG_member, name: "j", scope: !5, file: !1, line: 2, baseType: !8, size: 5)<br>
+!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br>
; CHECK: DW_TAG_member<br>
; CHECK-NEXT: DW_AT_name{{.*}}"k"<br>
; CHECK-NOT: DW_TAG<br>
; CHECK: DW_AT_data_bit_offset [DW_FORM_data1] (0x05)<br>
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "k", scope: !5, file: !1, line: 3, baseType: !8, size: 6, align: 32, offset: 5)<br>
+!9 = !DIDerivedType(tag: DW_TAG_member, name: "k", scope: !5, file: !1, line: 3, baseType: !8, size: 6, offset: 5)<br>
; CHECK: DW_TAG_member<br>
; CHECK-NEXT: DW_AT_name{{.*}}"m"<br>
; CHECK-NOT: DW_TAG<br>
; CHECK: DW_AT_data_bit_offset [DW_FORM_data1] (0x0b)<br>
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !5, file: !1, line: 4, baseType: !8, size: 5, align: 32, offset: 11)<br>
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "m", scope: !5, file: !1, line: 4, baseType: !8, size: 5, offset: 11)<br>
; CHECK: DW_TAG_member<br>
; CHECK-NEXT: DW_AT_name{{.*}}"n"<br>
; CHECK-NOT: DW_TAG<br>
; CHECK: DW_AT_data_bit_offset [DW_FORM_data1] (0x10)<br>
-!11 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !5, file: !1, line: 5, baseType: !8, size: 8, align: 32, offset: 16)<br>
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !5, file: !1, line: 5, baseType: !8, size: 8, offset: 16)<br>
!12 = !{i32 2, !"Dwarf Version", i32 4}<br>
!13 = !{i32 2, !"Debug Info Version", i32 3}<br>
!14 = !{i32 1, !"PIC Level", i32 2}<br>
<br>
Modified: llvm/trunk/test/DebugInfo/COFF<wbr>/bitfields.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/bitfields.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/DebugInf<wbr>o/COFF/bitfields.ll?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/DebugInfo/COFF<wbr>/bitfields.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/COFF<wbr>/bitfields.ll Wed Oct 19 19:13:12 2016<br>
@@ -195,33 +195,33 @@ target triple = "x86_64-pc-windows-msvc1<br>
!3 = !{!4, !10, !29}<br>
!4 = distinct !DIGlobalVariable(name: "s0", scope: !0, file: !5, line: 7, type: !6, isLocal: false, isDefinition: true)<br>
!5 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/majnem<wbr>er/llvm/src")<br>
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !5, line: 3, size: 24, align: 8, elements: !7)<br>
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !5, line: 3, size: 24, elements: !7)<br>
!7 = !{!8}<br>
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !5, line: 6, baseType: !9, size: 8, align: 16, offset: 16, flags: DIFlagBitField, extraData: i64 8)<br>
-!9 = !DIBasicType(name: "short", size: 16, align: 16, encoding: DW_ATE_signed)<br>
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !5, line: 6, baseType: !9, size: 8, offset: 16, flags: DIFlagBitField, extraData: i64 8)<br>
+!9 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)<br>
!10 = distinct !DIGlobalVariable(name: "s1", scope: !0, file: !5, line: 18, type: !11, isLocal: false, isDefinition: true)<br>
-!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S1", file: !5, line: 10, size: 128, align: 8, elements: !12)<br>
+!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S1", file: !5, line: 10, size: 128, elements: !12)<br>
!12 = !{!13, !18, !19, !21, !22, !23, !28}<br>
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "x1", scope: !11, file: !5, line: 11, baseType: !14, size: 16, align: 8)<br>
-!14 = !DICompositeType(tag: DW_TAG_array_type, baseType: !15, size: 16, align: 8, elements: !16)<br>
-!15 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)<br>
+!13 = !DIDerivedType(tag: DW_TAG_member, name: "x1", scope: !11, file: !5, line: 11, baseType: !14, size: 16)<br>
+!14 = !DICompositeType(tag: DW_TAG_array_type, baseType: !15, size: 16, elements: !16)<br>
+!15 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)<br>
!16 = !{!17}<br>
!17 = !DISubrange(count: 2)<br>
-!18 = !DIDerivedType(tag: DW_TAG_member, name: "x2", scope: !11, file: !5, line: 12, baseType: !15, size: 8, align: 8, offset: 16)<br>
-!19 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !11, file: !5, line: 13, baseType: !20, size: 23, align: 32, offset: 24, flags: DIFlagBitField, extraData: i64 24)<br>
-!20 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
-!21 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !11, file: !5, line: 14, baseType: !20, size: 23, align: 32, offset: 56, flags: DIFlagBitField, extraData: i64 56)<br>
-!22 = !DIDerivedType(tag: DW_TAG_member, name: "w", scope: !11, file: !5, line: 15, baseType: !20, size: 2, align: 32, offset: 79, flags: DIFlagBitField, extraData: i64 56)<br>
-!23 = !DIDerivedType(tag: DW_TAG_member, name: "v", scope: !11, file: !5, line: 16, baseType: !24, size: 24, align: 8, offset: 88)<br>
-!24 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !11, file: !5, line: 16, size: 24, align: 8, elements: !25)<br>
+!18 = !DIDerivedType(tag: DW_TAG_member, name: "x2", scope: !11, file: !5, line: 12, baseType: !15, size: 8, offset: 16)<br>
+!19 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !11, file: !5, line: 13, baseType: !20, size: 23, offset: 24, flags: DIFlagBitField, extraData: i64 24)<br>
+!20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br>
+!21 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !11, file: !5, line: 14, baseType: !20, size: 23, offset: 56, flags: DIFlagBitField, extraData: i64 56)<br>
+!22 = !DIDerivedType(tag: DW_TAG_member, name: "w", scope: !11, file: !5, line: 15, baseType: !20, size: 2, offset: 79, flags: DIFlagBitField, extraData: i64 56)<br>
+!23 = !DIDerivedType(tag: DW_TAG_member, name: "v", scope: !11, file: !5, line: 16, baseType: !24, size: 24, offset: 88)<br>
+!24 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !11, file: !5, line: 16, size: 24, elements: !25)<br>
!25 = !{!26, !27}<br>
-!26 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !24, file: !5, line: 16, baseType: !15, size: 8, align: 8)<br>
-!27 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !24, file: !5, line: 16, baseType: !9, size: 16, align: 16, offset: 8)<br>
-!28 = !DIDerivedType(tag: DW_TAG_member, name: "u", scope: !11, file: !5, line: 17, baseType: !9, size: 3, align: 16, offset: 112, flags: DIFlagBitField, extraData: i64 112)<br>
+!26 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !24, file: !5, line: 16, baseType: !15, size: 8)<br>
+!27 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !24, file: !5, line: 16, baseType: !9, size: 16, offset: 8)<br>
+!28 = !DIDerivedType(tag: DW_TAG_member, name: "u", scope: !11, file: !5, line: 17, baseType: !9, size: 3, offset: 112, flags: DIFlagBitField, extraData: i64 112)<br>
!29 = distinct !DIGlobalVariable(name: "s2", scope: !0, file: !5, line: 24, type: !30, isLocal: false, isDefinition: true)<br>
-!30 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S2", file: !5, line: 21, size: 32, align: 8, elements: !31)<br>
+!30 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S2", file: !5, line: 21, size: 32, elements: !31)<br>
!31 = !{!32}<br>
-!32 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !30, file: !5, line: 23, baseType: !20, size: 1, align: 32, flags: DIFlagBitField, extraData: i64 0)<br>
+!32 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !30, file: !5, line: 23, baseType: !20, size: 1, flags: DIFlagBitField, extraData: i64 0)<br>
!33 = !{i32 2, !"CodeView", i32 1}<br>
!34 = !{i32 2, !"Debug Info Version", i32 3}<br>
!35 = !{i32 1, !"PIC Level", i32 2}<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/<wbr>bitfields-dwarf4.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/bitfields-dwarf4.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/DebugInf<wbr>o/X86/bitfields-dwarf4.ll?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/DebugInfo/X86/<wbr>bitfields-dwarf4.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/<wbr>bitfields-dwarf4.ll Wed Oct 19 19:13:12 2016<br>
@@ -32,7 +32,7 @@ target triple = "x86_64-apple-macosx"<br>
!2 = !{}<br>
!3 = !{!4}<br>
!4 = distinct !DIGlobalVariable(name: "s", scope: !0, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true)<br>
-!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "PackedBits", file: !1, line: 3, size: 40, align: 8, elements: !6)<br>
+!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "PackedBits", file: !1, line: 3, size: 40, elements: !6)<br>
!6 = !{!7, !9, !13}<br>
<br>
; CHECK: DW_TAG_member<br>
@@ -41,9 +41,9 @@ target triple = "x86_64-apple-macosx"<br>
; CHECK-NOT: DW_AT_bit_offset<br>
; CHECK-NOT: DW_AT_data_bit_offset<br>
; CHECK: DW_AT_data_member_location [DW_FORM_data1] (0x00)<br>
-!7 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !5, file: !1, line: 5, baseType: !8, size: 8, align: 8)<br>
+!7 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !5, file: !1, line: 5, baseType: !8, size: 8)<br>
<br>
-!8 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)<br>
+!8 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)<br>
<br>
; CHECK: DW_TAG_member<br>
; CHECK-NEXT: DW_AT_name{{.*}}"b"<br>
@@ -54,11 +54,11 @@ target triple = "x86_64-apple-macosx"<br>
; CHECK-NOT: DW_AT_byte_size<br>
; CHECK-NEXT: DW_AT_data_bit_offset [DW_FORM_data1] (0x08)<br>
; CHECK-NOT: DW_AT_data_member_location<br>
-!9 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !5, file: !1, line: 6, baseType: !10, size: 5, align: 32, offset: 8)<br>
+!9 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !5, file: !1, line: 6, baseType: !10, size: 5, offset: 8)<br>
<br>
!10 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint32_t", file: !11, line: 183, baseType: !12)<br>
!11 = !DIFile(filename: "/Volumes/Data/llvm/_build.nin<wbr>ja.release/bin/../lib/clang/3.<wbr>9.0/include/stdint.h", directory: "/Volumes/Data/llvm")<br>
-!12 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)<br>
+!12 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)<br>
<br>
; CHECK: DW_TAG_member<br>
; CHECK-NEXT: DW_AT_name{{.*}}"c"<br>
@@ -69,7 +69,7 @@ target triple = "x86_64-apple-macosx"<br>
; CHECK-NEXT: DW_AT_data_bit_offset [DW_FORM_data1] (0x0d)<br>
; CHECK-NOT: DW_AT_data_member_location<br>
; CHECK: DW_TAG<br>
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !1, line: 7, baseType: !10, size: 27, align: 32, offset: 13)<br>
+!13 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !5, file: !1, line: 7, baseType: !10, size: 27, offset: 13)<br>
<br>
!14 = !{i32 2, !"Dwarf Version", i32 4}<br>
!15 = !{i32 2, !"Debug Info Version", i32 3}<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/<wbr>bitfields.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/bitfields.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/DebugInf<wbr>o/X86/bitfields.ll?rev=284678&<wbr>r1=284677&r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/DebugInfo/X86/<wbr>bitfields.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/<wbr>bitfields.ll Wed Oct 19 19:13:12 2016<br>
@@ -60,13 +60,13 @@ target triple = "x86_64-apple-macosx"<br>
!3 = !{!4}<br>
!4 = !DIGlobalVariable(name: "b", scope: !0, file: !5, line: 8, type: !6, isLocal: false, isDefinition: true)<br>
!5 = !DIFile(filename: "bitfields.c", directory: "/")<br>
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, align: 32, elements: !7)<br>
+!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !5, line: 1, size: 96, elements: !7)<br>
!7 = !{!8, !10, !11, !12}<br>
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !5, line: 2, baseType: !9, size: 2, align: 32)<br>
-!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !5, line: 3, baseType: !9, size: 32, align: 32, offset: 32)<br>
-!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !5, line: 4, baseType: !9, size: 1, align: 32, offset: 64)<br>
-!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 5, baseType: !9, size: 28, align: 32, offset: 65)<br>
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !5, line: 2, baseType: !9, size: 2)<br>
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br>
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !5, line: 3, baseType: !9, size: 32, offset: 32)<br>
+!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !5, line: 4, baseType: !9, size: 1, offset: 64)<br>
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !5, line: 5, baseType: !9, size: 28, offset: 65)<br>
!13 = !{i32 2, !"Dwarf Version", i32 2}<br>
!14 = !{i32 2, !"Debug Info Version", i32 3}<br>
!15 = !{i32 1, !"PIC Level", i32 2}<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/<wbr>debug-info-packed-struct.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/debug-info-packed-struct.ll?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/test/DebugInf<wbr>o/X86/debug-info-packed-<wbr>struct.ll?rev=284678&r1=<wbr>284677&r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/DebugInfo/X86/<wbr>debug-info-packed-struct.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/<wbr>debug-info-packed-struct.ll Wed Oct 19 19:13:12 2016<br>
@@ -154,45 +154,45 @@ target triple = "x86_64-apple-darwin"<br>
!3 = !{!4, !18, !25, !35}<br>
!4 = !DIGlobalVariable(name: "l0", scope: !0, file: !5, line: 88, type: !6, isLocal: false, isDefinition: true)<br>
!5 = !DIFile(filename: "/llvm/tools/clang/test/CodeGe<wbr>n/debug-info-packed-struct.c", directory: "/llvm/_build.ninja.release")<br>
-!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout0", file: !5, line: 15, size: 192, align: 64, elements: !7)<br>
+!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout0", file: !5, line: 15, size: 192, elements: !7)<br>
!7 = !{!8, !10, !17}<br>
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs0", scope: !6, file: !5, line: 16, baseType: !9, size: 8, align: 8)<br>
-!9 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)<br>
-!10 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs8", scope: !6, file: !5, line: 17, baseType: !11, size: 64, align: 64, offset: 64)<br>
-!11 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8", file: !5, line: 11, size: 64, align: 64, elements: !12)<br>
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs0", scope: !6, file: !5, line: 16, baseType: !9, size: 8)<br>
+!9 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)<br>
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs8", scope: !6, file: !5, line: 17, baseType: !11, size: 64, offset: 64)<br>
+!11 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8", file: !5, line: 11, size: 64, elements: !12)<br>
!12 = !{!13, !15}<br>
-!13 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !11, file: !5, line: 12, baseType: !14, size: 4, align: 32)<br>
-!14 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+!13 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !11, file: !5, line: 12, baseType: !14, size: 4)<br>
+!14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br>
!15 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !11, file: !5, line: 13, baseType: !16, size: 60, offset: 4)<br>
-!16 = !DIBasicType(name: "long long int", size: 64, align: 64, encoding: DW_ATE_signed)<br>
-!17 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs16", scope: !6, file: !5, line: 18, baseType: !14, size: 1, align: 32, offset: 128)<br>
+!16 = !DIBasicType(name: "long long int", size: 64, encoding: DW_ATE_signed)<br>
+!17 = !DIDerivedType(tag: DW_TAG_member, name: "l0_ofs16", scope: !6, file: !5, line: 18, baseType: !14, size: 1, offset: 128)<br>
!18 = !DIGlobalVariable(name: "l1", scope: !0, file: !5, line: 89, type: !19, isLocal: false, isDefinition: true)<br>
-!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout1", file: !5, line: 34, size: 96, align: 32, elements: !20)<br>
+!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout1", file: !5, line: 34, size: 96, elements: !20)<br>
!20 = !{!21, !22, !24}<br>
-!21 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs0", scope: !19, file: !5, line: 35, baseType: !9, size: 8, align: 8)<br>
-!22 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs1", scope: !19, file: !5, line: 36, baseType: !23, size: 64, align: 8, offset: 8)<br>
-!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_anon", file: !5, line: 30, size: 64, align: 8, elements: !2)<br>
-!24 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs9", scope: !19, file: !5, line: 37, baseType: !14, size: 1, align: 32, offset: 72)<br>
+!21 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs0", scope: !19, file: !5, line: 35, baseType: !9, size: 8)<br>
+!22 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs1", scope: !19, file: !5, line: 36, baseType: !23, size: 64, offset: 8)<br>
+!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_anon", file: !5, line: 30, size: 64, elements: !2)<br>
+!24 = !DIDerivedType(tag: DW_TAG_member, name: "l1_ofs9", scope: !19, file: !5, line: 37, baseType: !14, size: 1, offset: 72)<br>
!25 = !DIGlobalVariable(name: "l2", scope: !0, file: !5, line: 90, type: !26, isLocal: false, isDefinition: true)<br>
-!26 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout2", file: !5, line: 54, size: 80, align: 8, elements: !27)<br>
+!26 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout2", file: !5, line: 54, size: 80, elements: !27)<br>
!27 = !{!28, !29, !34}<br>
-!28 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs0", scope: !26, file: !5, line: 55, baseType: !9, size: 8, align: 8)<br>
-!29 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs1", scope: !26, file: !5, line: 56, baseType: !30, size: 64, align: 8, offset: 8)<br>
-!30 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack1", file: !5, line: 50, size: 64, align: 8, elements: !31)<br>
+!28 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs0", scope: !26, file: !5, line: 55, baseType: !9, size: 8)<br>
+!29 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs1", scope: !26, file: !5, line: 56, baseType: !30, size: 64, offset: 8)<br>
+!30 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack1", file: !5, line: 50, size: 64, elements: !31)<br>
!31 = !{!32, !33}<br>
-!32 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !30, file: !5, line: 51, baseType: !14, size: 4, align: 32)<br>
+!32 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !30, file: !5, line: 51, baseType: !14, size: 4)<br>
!33 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !30, file: !5, line: 52, baseType: !16, size: 60, offset: 4)<br>
-!34 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs9", scope: !26, file: !5, line: 57, baseType: !14, size: 1, align: 32, offset: 72)<br>
+!34 = !DIDerivedType(tag: DW_TAG_member, name: "l2_ofs9", scope: !26, file: !5, line: 57, baseType: !14, size: 1, offset: 72)<br>
!35 = !DIGlobalVariable(name: "l3", scope: !0, file: !5, line: 91, type: !36, isLocal: false, isDefinition: true)<br>
-!36 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout3", file: !5, line: 76, size: 128, align: 32, elements: !37)<br>
+!36 = !DICompositeType(tag: DW_TAG_structure_type, name: "layout3", file: !5, line: 76, size: 128, elements: !37)<br>
!37 = !{!38, !39, !44}<br>
-!38 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs0", scope: !36, file: !5, line: 77, baseType: !9, size: 8, align: 8)<br>
-!39 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs4", scope: !36, file: !5, line: 78, baseType: !40, size: 64, align: 32, offset: 32)<br>
-!40 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack4", file: !5, line: 72, size: 64, align: 32, elements: !41)<br>
+!38 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs0", scope: !36, file: !5, line: 77, baseType: !9, size: 8)<br>
+!39 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs4", scope: !36, file: !5, line: 78, baseType: !40, size: 64, offset: 32)<br>
+!40 = !DICompositeType(tag: DW_TAG_structure_type, name: "size8_pack4", file: !5, line: 72, size: 64, elements: !41)<br>
!41 = !{!42, !43}<br>
-!42 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !40, file: !5, line: 73, baseType: !14, size: 4, align: 32)<br>
+!42 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !40, file: !5, line: 73, baseType: !14, size: 4)<br>
!43 = !DIDerivedType(tag: DW_TAG_member, name: "l", scope: !40, file: !5, line: 74, baseType: !16, size: 60, offset: 4)<br>
-!44 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs12", scope: !36, file: !5, line: 79, baseType: !14, size: 1, align: 32, offset: 96)<br>
+!44 = !DIDerivedType(tag: DW_TAG_member, name: "l3_ofs12", scope: !36, file: !5, line: 79, baseType: !14, size: 1, offset: 96)<br>
!45 = !{i32 2, !"Dwarf Version", i32 2}<br>
!46 = !{i32 2, !"Debug Info Version", i32 3}<br>
!47 = !{!"clang version 3.7.0 (trunk 240791) (llvm/trunk 240790)"}<br>
<br>
Modified: llvm/trunk/unittests/IR/Metada<wbr>taTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/MetadataTest.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/unittests/IR/<wbr>MetadataTest.cpp?rev=284678&<wbr>r1=284677&r2=284678&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/unittests/IR/Metada<wbr>taTest.cpp (original)<br>
+++ llvm/trunk/unittests/IR/Metada<wbr>taTest.cpp Wed Oct 19 19:13:12 2016<br>
@@ -1824,10 +1824,12 @@ TEST_F(DIGlobalVariableTest, get) {<br>
auto *Expr2 = DIExpression::get(Context, {1, 2, 3});<br>
DIDerivedType *StaticDataMemberDeclaration =<br>
cast<DIDerivedType>(getDerive<wbr>dType());<br>
+ uint64_t AlignInBits = 8;<br>
<br>
auto *N = DIGlobalVariable::get(Context, Scope, Name, LinkageName, File, Line,<br>
Type, IsLocalToUnit, IsDefinition,<br>
- Expr, StaticDataMemberDeclaration);<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits);<br>
EXPECT_EQ(dwarf::DW_TAG_varia<wbr>ble, N->getTag());<br>
EXPECT_EQ(Scope, N->getScope());<br>
EXPECT_EQ(Name, N->getName());<br>
@@ -1839,45 +1841,61 @@ TEST_F(DIGlobalVariableTest, get) {<br>
EXPECT_EQ(IsDefinition, N->isDefinition());<br>
EXPECT_EQ(Expr, N->getExpr());<br>
EXPECT_EQ(StaticDataMemberDec<wbr>laration, N->getStaticDataMemberDeclarat<wbr>ion());<br>
+ EXPECT_EQ(AlignInBits, N->getAlignInBits());<br>
EXPECT_EQ(N, DIGlobalVariable::get(Context, Scope, Name, LinkageName, File,<br>
Line, Type, IsLocalToUnit, IsDefinition,<br>
- Expr, StaticDataMemberDeclaration));<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
<br>
EXPECT_NE(N,<br>
DIGlobalVariable::get(<wbr>Context, getSubprogram(), Name, LinkageName,<br>
File, Line, Type, IsLocalToUnit, IsDefinition,<br>
- Expr, StaticDataMemberDeclaration));<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N, DIGlobalVariable::get(Context, Scope, "other", LinkageName, File,<br>
Line, Type, IsLocalToUnit, IsDefinition,<br>
- Expr, StaticDataMemberDeclaration));<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N, DIGlobalVariable::get(Context, Scope, Name, "other", File, Line,<br>
Type, IsLocalToUnit, IsDefinition, Expr,<br>
- StaticDataMemberDeclaration))<wbr>;<br>
+ StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N,<br>
DIGlobalVariable::get(<wbr>Context, Scope, Name, LinkageName, getFile(),<br>
Line, Type, IsLocalToUnit, IsDefinition, Expr,<br>
- StaticDataMemberDeclaration));<br>
+ StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N,<br>
DIGlobalVariable::get(<wbr>Context, Scope, Name, LinkageName, File,<br>
Line + 1, Type, IsLocalToUnit, IsDefinition,<br>
- Expr, StaticDataMemberDeclaration));<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N,<br>
DIGlobalVariable::get(<wbr>Context, Scope, Name, LinkageName, File, Line,<br>
getDerivedType(), IsLocalToUnit, IsDefinition,<br>
- Expr, StaticDataMemberDeclaration));<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N, DIGlobalVariable::get(Context, Scope, Name, LinkageName, File,<br>
Line, Type, !IsLocalToUnit, IsDefinition,<br>
- Expr, StaticDataMemberDeclaration));<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N, DIGlobalVariable::get(Context, Scope, Name, LinkageName, File,<br>
Line, Type, IsLocalToUnit, !IsDefinition,<br>
- Expr, StaticDataMemberDeclaration));<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N, DIGlobalVariable::get(Context, Scope, Name, LinkageName, File,<br>
Line, Type, IsLocalToUnit, IsDefinition,<br>
- Expr2, StaticDataMemberDeclaration));<br>
+ Expr2, StaticDataMemberDeclaration,<br>
+ AlignInBits));<br>
EXPECT_NE(N,<br>
DIGlobalVariable::get(<wbr>Context, Scope, Name, LinkageName, File, Line,<br>
Type, IsLocalToUnit, IsDefinition, Expr,<br>
- cast<DIDerivedType>(getDerived<wbr>Type())));<br>
+ cast<DIDerivedType>(getDerived<wbr>Type()),<br>
+ AlignInBits));<br>
+ EXPECT_NE(N, DIGlobalVariable::get(Context, Scope, Name, LinkageName, File,<br>
+ Line, Type, IsLocalToUnit, IsDefinition,<br>
+ Expr, StaticDataMemberDeclaration,<br>
+ (AlignInBits << 1)));<br>
<br>
TempDIGlobalVariable Temp = N->clone();<br>
EXPECT_EQ(N, MDNode::replaceWithUniqued(std<wbr>::move(Temp)));<br>
@@ -1893,9 +1911,11 @@ TEST_F(DILocalVariableTest, get) {<br>
DIType *Type = getDerivedType();<br>
unsigned Arg = 6;<br>
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(7<wbr>);<br>
+ uint64_t AlignInBits = 8;<br>
<br>
auto *N =<br>
- DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg, Flags);<br>
+ DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg, Flags,<br>
+ AlignInBits);<br>
EXPECT_TRUE(N->isParameter())<wbr>;<br>
EXPECT_EQ(Scope, N->getScope());<br>
EXPECT_EQ(Name, N->getName());<br>
@@ -1904,24 +1924,27 @@ TEST_F(DILocalVariableTest, get) {<br>
EXPECT_EQ(Type, N->getType());<br>
EXPECT_EQ(Arg, N->getArg());<br>
EXPECT_EQ(Flags, N->getFlags());<br>
+ EXPECT_EQ(AlignInBits, N->getAlignInBits());<br>
EXPECT_EQ(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg,<br>
- Flags));<br>
+ Flags, AlignInBits));<br>
<br>
EXPECT_FALSE(<br>
- DILocalVariable::get(Context, Scope, Name, File, Line, Type, 0, Flags)<br>
- ->isParameter());<br>
+ DILocalVariable::get(Context, Scope, Name, File, Line, Type, 0, Flags,<br>
+ AlignInBits)->isParameter());<br>
EXPECT_NE(N, DILocalVariable::get(Context, getSubprogram(), Name, File, Line,<br>
- Type, Arg, Flags));<br>
+ Type, Arg, Flags, AlignInBits));<br>
EXPECT_NE(N, DILocalVariable::get(Context, Scope, "other", File, Line, Type,<br>
- Arg, Flags));<br>
+ Arg, Flags, AlignInBits));<br>
EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, getFile(), Line, Type,<br>
- Arg, Flags));<br>
+ Arg, Flags, AlignInBits));<br>
EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line + 1, Type,<br>
- Arg, Flags));<br>
+ Arg, Flags, AlignInBits));<br>
EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line,<br>
- getDerivedType(), Arg, Flags));<br>
+ getDerivedType(), Arg, Flags, AlignInBits));<br>
+ EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type,<br>
+ Arg + 1, Flags, AlignInBits));<br>
EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type,<br>
- Arg + 1, Flags));<br>
+ Arg, Flags, (AlignInBits << 1)));<br>
<br>
TempDILocalVariable Temp = N->clone();<br>
EXPECT_EQ(N, MDNode::replaceWithUniqued(std<wbr>::move(Temp)));<br>
@@ -1929,17 +1952,17 @@ TEST_F(DILocalVariableTest, get) {<br>
<br>
TEST_F(DILocalVariableTest, getArg256) {<br>
EXPECT_EQ(255u, DILocalVariable::get(Context, getSubprogram(), "", getFile(),<br>
- 0, nullptr, 255, DINode::FlagZero)<br>
+ 0, nullptr, 255, DINode::FlagZero, 0)<br>
->getArg());<br>
EXPECT_EQ(256u, DILocalVariable::get(Context, getSubprogram(), "", getFile(),<br>
- 0, nullptr, 256, DINode::FlagZero)<br>
+ 0, nullptr, 256, DINode::FlagZero, 0)<br>
->getArg());<br>
EXPECT_EQ(257u, DILocalVariable::get(Context, getSubprogram(), "", getFile(),<br>
- 0, nullptr, 257, DINode::FlagZero)<br>
+ 0, nullptr, 257, DINode::FlagZero, 0)<br>
->getArg());<br>
unsigned Max = UINT16_MAX;<br>
EXPECT_EQ(Max, DILocalVariable::get(Context, getSubprogram(), "", getFile(),<br>
- 0, nullptr, Max, DINode::FlagZero)<br>
+ 0, nullptr, Max, DINode::FlagZero, 0)<br>
->getArg());<br>
}<br>
<br>
<br>
Modified: llvm/trunk/unittests/Transform<wbr>s/Utils/Cloning.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Transforms/Utils/Cloning.cpp?rev=284678&r1=284677&r2=284678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/unittests/Tra<wbr>nsforms/Utils/Cloning.cpp?rev=<wbr>284678&r1=284677&r2=284678&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/unittests/Transform<wbr>s/Utils/Cloning.cpp (original)<br>
+++ llvm/trunk/unittests/Transform<wbr>s/Utils/Cloning.cpp Wed Oct 19 19:13:12 2016<br>
@@ -253,8 +253,7 @@ protected:<br>
Instruction* Terminator = IBuilder.CreateRetVoid();<br>
<br>
// Create a local variable around the alloca<br>
- auto *IntType =<br>
- DBuilder.createBasicType("int"<wbr>, 32, 0, dwarf::DW_ATE_signed);<br>
+ auto *IntType = DBuilder.createBasicType("int"<wbr>, 32, dwarf::DW_ATE_signed);<br>
auto *E = DBuilder.createExpression();<br>
auto *Variable =<br>
DBuilder.createAutoVariable(S<wbr>ubprogram, "x", File, 5, IntType, true);<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_2207923702212882206gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div>