[PATCH] sectiongroup support

kledzik at apple.com kledzik at apple.com
Thu Mar 6 16:16:56 PST 2014



================
Comment at: test/core/sectiongroup.test:2-12
@@ +1,13 @@
+# Test section groups
+
+RUN: lld -core %p/Inputs/simple-group.yaml | FileCheck -check-prefix=CHECKPARSE %s
+RUN: lld -core %p/Inputs/simple-group.yaml %p/Inputs/simple-group.yaml | FileCheck -check-prefix=CHECKPARSE %s
+RUN: not lld -core %p/Inputs/simple-group.yaml %p/Inputs/group-with-extrachild.yaml > %t.log 2>&1
+RUN: FileCheck -check-prefix=CHECKEXTRACHILDERROR %s < %t.log
+RUN: not lld -core %p/Inputs/groupchild-with-noparent.yaml > %t1.log 2>&1
+RUN: FileCheck -check-prefix=CHECKEXTRACHILDERROR %s < %t1.log
+RUN: not lld -core %p/Inputs/groupchild-with-mergecontent.yaml > %t2.log 2>&1
+RUN: FileCheck -check-prefix=CHECKMERGEBYCONTENT %s < %t2.log
+RUN: lld -core %p/Inputs/simple-group-rearrange.yaml | FileCheck -check-prefix=CHECKPARSEREARRANGE %s
+RUN: lld -core %p/Inputs/simple-group-rearrange.yaml %p/Inputs/simple-group.yaml | FileCheck -check-prefix=CHECKPARSEREARRANGE %s
+
----------------
Wouldn't it be simpler to push these RUN: lines into each test file.  I like the run and test input in one file. 

================
Comment at: lib/Core/SymbolTable.cpp:61
@@ +60,3 @@
+        if (r->kindValue() == Reference::kindGroupParent) {
+          addGroupChild(atom, *(r->target()));
+          return;
----------------
Shankar Kalpathi Easwaran wrote:
> Rui Ueyama wrote:
> > *r->target()
> ok.
Why is addGroupChild() called here, and what does it do? Scanning all references of all atoms will slow things down.

Instead, inside addGroup(), if the group name already exists, you choose one of the groups to use (first one?), then mark it to be replaced.   Later in Resolver::removeCoalescedAwayAtoms() you can find the child of coalesced away groups.


http://llvm-reviews.chandlerc.com/D2961



More information about the llvm-commits mailing list