[PATCH] Correct inaccurate comment in LLParser

Stephen Lin swlin at post.harvard.edu
Tue Apr 9 12:33:15 PDT 2013


See below; I'm about 99% sure the original comment is incorrect, even
though it's apparently been there for awhile.

---------- Forwarded message ----------
From: Stephen Lin <swlin at post.harvard.edu>
Date: Mon, Apr 8, 2013 at 6:22 PM
Subject: Inaccurate comment in LLParser: "align 2" is a synonym for
"alignstack 2"?
To: LLVMdev at cs.uiuc.edu


The following comment:

00881       // As a hack, we allow "align 2" on functions as a synonym
for "alignstack
00882       // 2".

in "lib/AsmParser/LLParser.cpp" appears inaccurate, the "alignment" is
later parsed as the alignment of the function itself, both when
directly placed on the function:

02975   // If the alignment was parsed as an attribute, move to the
alignment field.
02976   if (FuncAttrs.hasAlignmentAttr()) {
02977     Alignment = FuncAttrs.getAlignment();
02978     FuncAttrs.removeAttribute(Attribute::Alignment);
02979   }

and through an attribute group:

00088       // If the alignment was parsed as an attribute, move to
the alignment
00089       // field.
00090       if (FnAttrs.hasAlignmentAttr()) {
00091         Fn->setAlignment(FnAttrs.getAlignment());
00092         FnAttrs.removeAttribute(Attribute::Alignment);
00093       }

Am I missing something or should this be removed or changed? (It's
actually legitimately a hack, just not the one described...)

Stephen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llparser-comment-fix.patch
Type: application/octet-stream
Size: 695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130409/7233af48/attachment.obj>


More information about the llvm-commits mailing list