[patch] Don't rauw an alias in llvm.used (v2)
Nick Lewycky
nlewycky at google.com
Tue May 7 14:42:50 PDT 2013
On 7 May 2013 13:21, Rafael EspĂndola <rafael.espindola at gmail.com> wrote:
> Thanks a lot for the review. A new patch is attached. I have moved
> into LLVMUsed only the functionally that I think might be used by
> other passes, so I have left the checks/patching to make sure that
> llvm.compiler_used and llvm.used are disjoint out of it.
>
This looks much better. Thanks!
+class LLVMUsed {
+ SmallPtrSet<GlobalValue *, 8> Used;
+ SmallPtrSet<GlobalValue *, 8> CompilerUsed;
+ GlobalVariable *UsedV;
+ GlobalVariable *CompilerUsedV;
Doxy-strings please! :)
+static int compareNames(const void *A, const void *B) {
+ const GlobalValue *VA = *reinterpret_cast<GlobalValue* const*>(A);
+ const GlobalValue *VB = *reinterpret_cast<GlobalValue* const*>(B);
+ if (VA->getName() < VB->getName())
+ return -1;
+ if (VB->getName() < VA->getName())
+ return 1;
+ return 0;
+}
Say, what *does* happen if you have unnamed global values?
Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130507/59fa28d4/attachment.html>
More information about the llvm-commits
mailing list