[llvm-commits] [llvm] r79877 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp test/CodeGen/Generic/2009-08-23-linkerprivate.ll

Chris Lattner clattner at apple.com
Sun Aug 23 19:09:09 PDT 2009


On Aug 23, 2009, at 6:03 PM, Dale Johannesen wrote:

> Author: johannes
> Date: Sun Aug 23 20:03:42 2009
> New Revision: 79877
>
> URL: http://llvm.org/viewvc/llvm-project?rev=79877&view=rev
> Log:
> Make linkerprivate work for ARM and PPC.  Testcase covers
> all Darwin targets; could be split into separate tests for
> the chip subdirectories, but from Chris' last mail on testing
> I assume he'd rather have only one test.  Generic seems to be
> the best available, maybe there should be a Darwin subdirectory?

I would prefer that, but unfortunately it is not safe.  The problem  
occurs when people build llvm without all the targets.  Unfortunately  
tests that require a specific -march need to be in their target- 
specific directory.  Otherwise, if you build without the arm target  
configured in, the Generic/*.ll test will fail.

I think the best thing to do is to replicate this into the various  
target directories, thanks for trying to unify them!

-Chris

>
>
> Added:
>    llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll
> Modified:
>    llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
>    llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
>
> Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=79877&r1=79876&r2=79877&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Sun Aug  
> 23 20:03:42 2009
> @@ -266,12 +266,12 @@
>   switch (F->getLinkage()) {
>   default: llvm_unreachable("Unknown linkage type!");
>   case Function::PrivateLinkage:
> -  case Function::LinkerPrivateLinkage:
>   case Function::InternalLinkage:
>     break;
>   case Function::ExternalLinkage:
>     O << "\t.globl\t" << CurrentFnName << "\n";
>     break;
> +  case Function::LinkerPrivateLinkage:
>   case Function::WeakAnyLinkage:
>   case Function::WeakODRLinkage:
>   case Function::LinkOnceAnyLinkage:
> @@ -1234,6 +1234,7 @@
>   case GlobalValue::LinkOnceODRLinkage:
>   case GlobalValue::WeakAnyLinkage:
>   case GlobalValue::WeakODRLinkage:
> +  case GlobalValue::LinkerPrivateLinkage:
>     if (isDarwin) {
>       O << "\t.globl " << name << "\n"
>         << "\t.weak_definition " << name << "\n";
> @@ -1248,7 +1249,6 @@
>     O << "\t.globl " << name << "\n";
>     break;
>   case GlobalValue::PrivateLinkage:
> -  case GlobalValue::LinkerPrivateLinkage:
>   case GlobalValue::InternalLinkage:
>     break;
>   default:
>
> Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=79877&r1=79876&r2=79877&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp  
> (original)
> +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Sun  
> Aug 23 20:03:42 2009
> @@ -620,13 +620,13 @@
>   switch (F->getLinkage()) {
>   default: llvm_unreachable("Unknown linkage type!");
>   case Function::PrivateLinkage:
> -  case Function::LinkerPrivateLinkage:
>   case Function::InternalLinkage:  // Symbols default to internal.
>     break;
>   case Function::ExternalLinkage:
>     O << "\t.global\t" << CurrentFnName << '\n'
>       << "\t.type\t" << CurrentFnName << ", @function\n";
>     break;
> +  case Function::LinkerPrivateLinkage:
>   case Function::WeakAnyLinkage:
>   case Function::WeakODRLinkage:
>   case Function::LinkOnceAnyLinkage:
> @@ -738,6 +738,7 @@
>    case GlobalValue::WeakAnyLinkage:
>    case GlobalValue::WeakODRLinkage:
>    case GlobalValue::CommonLinkage:
> +   case GlobalValue::LinkerPrivateLinkage:
>     O << "\t.global " << name << '\n'
>       << "\t.type " << name << ", @object\n"
>       << "\t.weak " << name << '\n';
> @@ -752,7 +753,6 @@
>     // FALL THROUGH
>    case GlobalValue::InternalLinkage:
>    case GlobalValue::PrivateLinkage:
> -   case GlobalValue::LinkerPrivateLinkage:
>     break;
>    default:
>     llvm_unreachable("Unknown linkage type!");
> @@ -809,7 +809,6 @@
>   switch (F->getLinkage()) {
>   default: llvm_unreachable("Unknown linkage type!");
>   case Function::PrivateLinkage:
> -  case Function::LinkerPrivateLinkage:
>   case Function::InternalLinkage:  // Symbols default to internal.
>     break;
>   case Function::ExternalLinkage:
> @@ -819,6 +818,7 @@
>   case Function::WeakODRLinkage:
>   case Function::LinkOnceAnyLinkage:
>   case Function::LinkOnceODRLinkage:
> +  case Function::LinkerPrivateLinkage:
>     O << "\t.globl\t" << CurrentFnName << '\n';
>     O << "\t.weak_definition\t" << CurrentFnName << '\n';
>     break;
> @@ -992,6 +992,7 @@
>    case GlobalValue::WeakAnyLinkage:
>    case GlobalValue::WeakODRLinkage:
>    case GlobalValue::CommonLinkage:
> +   case GlobalValue::LinkerPrivateLinkage:
>     O << "\t.globl " << name << '\n'
>       << "\t.weak_definition " << name << '\n';
>     break;
> @@ -1004,7 +1005,6 @@
>     // FALL THROUGH
>    case GlobalValue::InternalLinkage:
>    case GlobalValue::PrivateLinkage:
> -   case GlobalValue::LinkerPrivateLinkage:
>     break;
>    default:
>     llvm_unreachable("Unknown linkage type!");
>
> Added: llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll?rev=79877&view=auto
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll  
> (added)
> +++ llvm/trunk/test/CodeGen/Generic/2009-08-23-linkerprivate.ll Sun  
> Aug 23 20:03:42 2009
> @@ -0,0 +1,10 @@
> +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin |  
> FileCheck %s
> +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=ppc-apple-darwin |  
> FileCheck %s
> +; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-apple-darwin |  
> FileCheck %s
> +
> +; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ 
> ProfilerServer.mm'
> +
> +@"\01l_objc_msgSend_fixup_alloc" = linker_private hidden global i32  
> 0, section "__DATA, __objc_msgrefs, coalesced", align 16		; <i32*>  
> [#uses=0]
> +
> +; CHECK: .globl l_objc_msgSend_fixup_alloc
> +; CHECK: .weak_definition l_objc_msgSend_fixup_alloc
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list