summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser
diff options
context:
space:
mode:
authorVictor Leschuk <vleschuk@accesssoftek.com>2016-10-20 00:13:12 +0000
committerVictor Leschuk <vleschuk@accesssoftek.com>2016-10-20 00:13:12 +0000
commit2ede126b1b3fae52cddece5cf1f75b474a9c7932 (patch)
tree0733b4b810dc87c85fda4f44bfa3e74b59cc1e2f /llvm/lib/AsmParser
parent7edf93bc5b2bbed4ff9b34ac5126eb210fbbff3c (diff)
downloadbcm5719-llvm-2ede126b1b3fae52cddece5cf1f75b474a9c7932.tar.gz
bcm5719-llvm-2ede126b1b3fae52cddece5cf1f75b474a9c7932.zip
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
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 959501fc04f..961ae65425b 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -4186,7 +4186,7 @@ bool LLParser::ParseDITemplateValueParameter(MDNode *&Result, bool IsDistinct) {
/// ::= !DIGlobalVariable(scope: !0, name: "foo", linkageName: "foo",
/// file: !1, line: 7, type: !2, isLocal: false,
/// isDefinition: true, variable: i32* @foo,
-/// declaration: !3)
+/// declaration: !3, align: 8)
bool LLParser::ParseDIGlobalVariable(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
REQUIRED(name, MDStringField, (/* AllowEmpty */ false)); \
@@ -4198,22 +4198,26 @@ bool LLParser::ParseDIGlobalVariable(MDNode *&Result, bool IsDistinct) {
OPTIONAL(isLocal, MDBoolField, ); \
OPTIONAL(isDefinition, MDBoolField, (true)); \
OPTIONAL(expr, MDField, ); \
- OPTIONAL(declaration, MDField, );
+ OPTIONAL(declaration, MDField, ); \
+ OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX));
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS
Result = GET_OR_DISTINCT(DIGlobalVariable,
(Context, scope.Val, name.Val, linkageName.Val,
file.Val, line.Val, type.Val, isLocal.Val,
- isDefinition.Val, expr.Val, declaration.Val));
+ isDefinition.Val, expr.Val, declaration.Val,
+ align.Val));
return false;
}
/// ParseDILocalVariable:
/// ::= !DILocalVariable(arg: 7, scope: !0, name: "foo",
-/// file: !1, line: 7, type: !2, arg: 2, flags: 7)
+/// file: !1, line: 7, type: !2, arg: 2, flags: 7,
+/// align: 8)
/// ::= !DILocalVariable(scope: !0, name: "foo",
-/// file: !1, line: 7, type: !2, arg: 2, flags: 7)
+/// file: !1, line: 7, type: !2, arg: 2, flags: 7,
+/// align: 8)
bool LLParser::ParseDILocalVariable(MDNode *&Result, bool IsDistinct) {
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \
REQUIRED(scope, MDField, (/* AllowNull */ false)); \
@@ -4222,13 +4226,14 @@ bool LLParser::ParseDILocalVariable(MDNode *&Result, bool IsDistinct) {
OPTIONAL(file, MDField, ); \
OPTIONAL(line, LineField, ); \
OPTIONAL(type, MDField, ); \
- OPTIONAL(flags, DIFlagField, );
+ OPTIONAL(flags, DIFlagField, ); \
+ OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX));
PARSE_MD_FIELDS();
#undef VISIT_MD_FIELDS
Result = GET_OR_DISTINCT(DILocalVariable,
(Context, scope.Val, name.Val, file.Val, line.Val,
- type.Val, arg.Val, flags.Val));
+ type.Val, arg.Val, flags.Val, align.Val));
return false;
}
OpenPOWER on IntegriCloud