[PATCH] D32009: Allow attributes with global variables

Jonathan Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 09:44:46 PDT 2017


jroelofs accepted this revision.
jroelofs added a comment.

A few nits, otherwise LGTM.



================
Comment at: lib/AsmParser/LLParser.cpp:965
+    ForwardRefAttrGroups[GV] = FwdRefAttrGrps;
+   }
+
----------------
Too many spaces before this `}`


================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:2834
+
+  if (Record.size() > 12 ) {
+    auto AS = getAttributes(Record[12]).getFnAttributes();
----------------
`12 )` --> `12)`


================
Comment at: lib/Bitcode/Writer/BitcodeWriter.cpp:655
 
+
 void ModuleBitcodeWriter::writeAttributeTable() {
----------------
Delete the extra newline.


================
Comment at: lib/Bitcode/Writer/ValueEnumerator.cpp:321
       EnumerateValue(GV.getInitializer());
+    if ( GV.hasAttributes())
+      EnumerateAttributes(GV.getAttributesAsList(AttributeList::FunctionIndex));
----------------
`if ( GV` --> `if (GV`


================
Comment at: lib/IR/Attributes.cpp:619
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+LLVM_DUMP_METHOD void AttributeSet::dump() const {
+  dbgs() << "AS =\n";
----------------
The declaration for this one must have matching `#if` guards.


https://reviews.llvm.org/D32009





More information about the llvm-commits mailing list