[llvm-commits] [llvm] r56587 - in /llvm/trunk/lib/Target/ARM: ARMTargetAsmInfo.cpp ARMTargetAsmInfo.h ARMTargetMachine.cpp

Bill Wendling isanbard at gmail.com
Wed Sep 24 22:21:38 PDT 2008


Anton,

This patch is causing a failure in the build. Please investigate.  
Reverting just this patch doesn't compile. I may have to revert all of  
your patches.

-bw

llvm[2]: Linking Debug executable llc
Undefined symbols:
    
"llvm::ARMTargetAsmInfo<llvm::TargetAsmInfo>::getInlineAsmLength(char  
const*) const", referenced from:
       vtable for llvm::ARMTargetAsmInfo<llvm::TargetAsmInfo>in  
LLVMARMCodeGen.o
    
"llvm 
::X86TargetAsmInfo 
<llvm::TargetAsmInfo>::ExpandInlineAsm(llvm::CallInst*) const",  
referenced from:
       vtable for llvm::X86COFFTargetAsmInfoin LLVMX86CodeGen.o
       vtable for llvm::X86TargetAsmInfo<llvm::TargetAsmInfo>in  
LLVMX86CodeGen.o
       vtable for llvm::X86WinTargetAsmInfoin LLVMX86CodeGen.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [/Users/void/llvm/llvm.obj/Debug/bin/llc] Error 1
make[1]: *** [llc/.makeall] Error 2
make: *** [all] Error 1


On Sep 24, 2008, at 3:22 PM, Anton Korobeynikov wrote:

> Author: asl
> Date: Wed Sep 24 17:22:27 2008
> New Revision: 56587
>
> URL: http://llvm.org/viewvc/llvm-project?rev=56587&view=rev
> Log:
> Get rid of virtual inheritance for ARM TAI
>
> Modified:
>    llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
>    llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
>    llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
>
> Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=56587&r1=56586&r2=56587&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Wed Sep 24  
> 17:22:27 2008
> @@ -17,7 +17,7 @@
> #include <cctype>
> using namespace llvm;
>
> -static const char *const arm_asm_table[] = {
> +const char *const llvm::arm_asm_table[] = {
>                                       "{r0}", "r0",
>                                       "{r1}", "r1",
>                                       "{r2}", "r2",
> @@ -42,21 +42,10 @@
>                                       "{cc}", "cc",
>                                       0,0};
>
> -ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
> -  AsmTransCBE = arm_asm_table;
> -
> -  AlignmentIsInBytes = false;
> -  Data64bitsDirective = 0;
> -  CommentString = "@";
> -  ConstantPoolSection = "\t.text\n";
> -  COMMDirectiveTakesAlignment = false;
> -  InlineAsmStart = "@ InlineAsm Start";
> -  InlineAsmEnd = "@ InlineAsm End";
> -  LCOMMDirective = "\t.lcomm\t";
> -}
> +TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo<TargetAsmInfo>);
>
> ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const  
> ARMTargetMachine &TM):
> -  ARMTargetAsmInfo(TM), DarwinTargetAsmInfo(TM) {
> +  ARMTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
>   Subtarget = &DTM->getSubtarget<ARMSubtarget>();
>
>   GlobalPrefix = "_";
> @@ -104,7 +93,7 @@
> }
>
> ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM):
> -  ARMTargetAsmInfo(TM), ELFTargetAsmInfo(TM) {
> +  ARMTargetAsmInfo<ELFTargetAsmInfo>(TM) {
>   Subtarget = &ETM->getSubtarget<ARMSubtarget>();
>
>   NeedsSet = false;
> @@ -138,13 +127,15 @@
>
> /// Count the number of comma-separated arguments.
> /// Do not try to detect errors.
> -unsigned ARMTargetAsmInfo::countArguments(const char* p) const {
> +template <class BaseTAI>
> +unsigned ARMTargetAsmInfo<BaseTAI>::countArguments(const char* p)  
> const {
>   unsigned count = 0;
>   while (*p && isspace(*p) && *p != '\n')
>     p++;
>   count++;
> -  while (*p && *p!='\n' &&
> -         strncmp(p, CommentString, strlen(CommentString))!=0) {
> +  while (*p && *p!='\n' &&
> +         strncmp(p, BaseTAI::CommentString,
> +                 strlen(BaseTAI::CommentString))!=0) {
>     if (*p==',')
>       count++;
>     p++;
> @@ -154,7 +145,8 @@
>
> /// Count the length of a string enclosed in quote characters.
> /// Do not try to detect errors.
> -unsigned ARMTargetAsmInfo::countString(const char* p) const {
> +template <class BaseTAI>
> +unsigned ARMTargetAsmInfo<BaseTAI>::countString(const char* p)  
> const {
>   unsigned count = 0;
>   while (*p && isspace(*p) && *p!='\n')
>     p++;
> @@ -166,7 +158,8 @@
> }
>
> /// ARM-specific version of TargetAsmInfo::getInlineAsmLength.
> -unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *s) const {
> +template <class BaseTAI>
> +unsigned ARMTargetAsmInfo<BaseTAI>::getInlineAsmLength(const char  
> *s) const {
>   // Make a lowercase-folded version of s for counting purposes.
>   char *q, *s_copy = (char *)malloc(strlen(s) + 1);
>   strcpy(s_copy, s);
> @@ -192,7 +185,7 @@
>           break;
>         }
>       // Ignore everything from comment char(s) to EOL
> -      if (strncmp(Str, CommentString, strlen(CommentString))==-0)
> +      if (strncmp(Str, BaseTAI::CommentString,  
> strlen(BaseTAI::CommentString))==-0)
>         atInsnStart = false;
>       // FIXME do something like the following for non-Darwin
>       else if (*Str == '.' && Subtarget->isTargetDarwin()) {
> @@ -282,7 +275,7 @@
>           Length += 4;    // ARM
>       }
>     }
> -    if (*Str == '\n' || *Str == SeparatorChar)
> +    if (*Str == '\n' || *Str == BaseTAI::SeparatorChar)
>       atInsnStart = true;
>   }
>   free(s_copy);
>
> Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h?rev=56587&r1=56586&r2=56587&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h (original)
> +++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h Wed Sep 24 17:22:27  
> 2008
> @@ -14,19 +14,31 @@
> #ifndef ARMTARGETASMINFO_H
> #define ARMTARGETASMINFO_H
>
> +#include "ARMTargetMachine.h"
> #include "llvm/Target/TargetAsmInfo.h"
> #include "llvm/Target/ELFTargetAsmInfo.h"
> #include "llvm/Target/DarwinTargetAsmInfo.h"
> -
> -#include "ARMSubtarget.h"
> +#include "llvm/Support/Compiler.h"
>
> namespace llvm {
>
> -  // Forward declaration.
> -  class ARMTargetMachine;
> +  extern const char *const arm_asm_table[];
>
> -  struct ARMTargetAsmInfo : public virtual TargetAsmInfo {
> -    explicit ARMTargetAsmInfo(const ARMTargetMachine &TM);
> +  template <class BaseTAI>
> +  struct ARMTargetAsmInfo : public BaseTAI {
> +    explicit ARMTargetAsmInfo(const ARMTargetMachine &TM):
> +      BaseTAI(TM) {
> +      BaseTAI::AsmTransCBE = arm_asm_table;
> +
> +      BaseTAI::AlignmentIsInBytes = false;
> +      BaseTAI::Data64bitsDirective = 0;
> +      BaseTAI::CommentString = "@";
> +      BaseTAI::ConstantPoolSection = "\t.text\n";
> +      BaseTAI::COMMDirectiveTakesAlignment = false;
> +      BaseTAI::InlineAsmStart = "@ InlineAsm Start";
> +      BaseTAI::InlineAsmEnd = "@ InlineAsm End";
> +      BaseTAI::LCOMMDirective = "\t.lcomm\t";
> +    }
>
>     const ARMSubtarget *Subtarget;
>
> @@ -35,13 +47,15 @@
>     unsigned countString(const char *p) const;
>   };
>
> -  struct ARMDarwinTargetAsmInfo : public virtual ARMTargetAsmInfo,
> -                                  public virtual  
> DarwinTargetAsmInfo {
> +  typedef ARMTargetAsmInfo<TargetAsmInfo> ARMGenericTargetAsmInfo;
> +
> +  EXTERN_TEMPLATE_INSTANTIATION(class  
> ARMTargetAsmInfo<TargetAsmInfo>);
> +
> +  struct ARMDarwinTargetAsmInfo : public  
> ARMTargetAsmInfo<DarwinTargetAsmInfo> {
>     explicit ARMDarwinTargetAsmInfo(const ARMTargetMachine &TM);
>   };
>
> -  struct ARMELFTargetAsmInfo : public virtual ARMTargetAsmInfo,
> -                               public virtual ELFTargetAsmInfo {
> +  struct ARMELFTargetAsmInfo : public  
> ARMTargetAsmInfo<ELFTargetAsmInfo> {
>     explicit ARMELFTargetAsmInfo(const ARMTargetMachine &TM);
>   };
>
>
> Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=56587&r1=56586&r2=56587&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Wed Sep 24  
> 17:22:27 2008
> @@ -120,7 +120,7 @@
>    case ARMSubtarget::isELF:
>     return new ARMELFTargetAsmInfo(*this);
>    default:
> -    return new ARMTargetAsmInfo(*this);
> +    return new ARMGenericTargetAsmInfo(*this);
>   }
> }
>
>
>
> _______________________________________________
> 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