From ba4733d901b1c2b994f66707657342b8c81c92bc Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 15 Jul 2006 01:24:23 +0000 Subject: Remove what little AIX support we have. It has never been tested and isn't complete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29156 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPC.h | 1 - lib/Target/PowerPC/PPCAsmPrinter.cpp | 154 -------------------------------- lib/Target/PowerPC/PPCSubtarget.cpp | 7 +- lib/Target/PowerPC/PPCSubtarget.h | 2 - lib/Target/PowerPC/PPCTargetMachine.cpp | 7 +- 5 files changed, 2 insertions(+), 169 deletions(-) (limited to 'lib') diff --git a/lib/Target/PowerPC/PPC.h b/lib/Target/PowerPC/PPC.h index fb64a93..5e8e15c 100644 --- a/lib/Target/PowerPC/PPC.h +++ b/lib/Target/PowerPC/PPC.h @@ -24,7 +24,6 @@ class PPCTargetMachine; FunctionPass *createPPCBranchSelectionPass(); FunctionPass *createPPCISelDag(PPCTargetMachine &TM); FunctionPass *createDarwinAsmPrinter(std::ostream &OS, PPCTargetMachine &TM); -FunctionPass *createAIXAsmPrinter(std::ostream &OS, PPCTargetMachine &TM); } // end namespace llvm; // GCC #defines PPC on Linux but we use it as our namespace name diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 40cbd93..cbadca8 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -306,32 +306,6 @@ namespace { } }; - - /// AIXAsmPrinter - PowerPC assembly printer, customized for AIX - /// - struct VISIBILITY_HIDDEN AIXAsmPrinter : public PPCAsmPrinter { - /// Map for labels corresponding to global variables - /// - std::map GVToLabelMap; - - AIXAsmPrinter(std::ostream &O, TargetMachine &TM) - : PPCAsmPrinter(O, TM) { - CommentString = "#"; - GlobalPrefix = "."; - ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. - Data64bitsDirective = 0; // we can't emit a 64-bit unit - AlignmentIsInBytes = false; // Alignment is by power of 2. - ConstantPoolSection = "\t.const\t"; - } - - virtual const char *getPassName() const { - return "AIX PPC Assembly Printer"; - } - - bool runOnMachineFunction(MachineFunction &F); - bool doInitialization(Module &M); - bool doFinalization(Module &M); - }; } // end of anonymous namespace /// createDarwinAsmPrinterPass - Returns a pass that prints the PPC assembly @@ -343,14 +317,6 @@ FunctionPass *llvm::createDarwinAsmPrinter(std::ostream &o, return new DarwinAsmPrinter(o, tm); } -/// createAIXAsmPrinterPass - Returns a pass that prints the PPC assembly code -/// for a MachineFunction to the given output stream, in a format that the -/// AIX 5L assembler can deal with. -/// -FunctionPass *llvm::createAIXAsmPrinter(std::ostream &o, PPCTargetMachine &tm) { - return new AIXAsmPrinter(o, tm); -} - // Include the auto-generated portion of the assembly writer #include "PPCGenAsmWriter.inc" @@ -717,123 +683,3 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { return false; // success } -/// runOnMachineFunction - This uses the printMachineInstruction() -/// method to print assembly for each instruction. -/// -bool AIXAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - SetupMachineFunction(MF); - - // Print out constants referenced by the function - EmitConstantPool(MF.getConstantPool()); - - // Print out header for the function. - O << "\t.csect .text[PR]\n" - << "\t.align 2\n" - << "\t.globl " << CurrentFnName << '\n' - << "\t.globl ." << CurrentFnName << '\n' - << "\t.csect " << CurrentFnName << "[DS],3\n" - << CurrentFnName << ":\n" - << "\t.llong ." << CurrentFnName << ", TOC[tc0], 0\n" - << "\t.csect .text[PR]\n" - << '.' << CurrentFnName << ":\n"; - - // Print out code for the function. - for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); - I != E; ++I) { - printBasicBlockLabel(I); - O << '\n'; - for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); - II != E; ++II) { - // Print the assembly for the instruction. - O << "\t"; - printMachineInstruction(II); - } - } - - O << "LT.." << CurrentFnName << ":\n" - << "\t.long 0\n" - << "\t.byte 0,0,32,65,128,0,0,0\n" - << "\t.long LT.." << CurrentFnName << "-." << CurrentFnName << '\n' - << "\t.short 3\n" - << "\t.byte \"" << CurrentFnName << "\"\n" - << "\t.align 2\n"; - - // We didn't modify anything. - return false; -} - -bool AIXAsmPrinter::doInitialization(Module &M) { - SwitchToDataSection("", 0); - - O << "\t.machine \"ppc64\"\n" - << "\t.toc\n" - << "\t.csect .text[PR]\n"; - - // Print out module-level global variables - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) { - if (!I->hasInitializer()) - continue; - - std::string Name = I->getName(); - Constant *C = I->getInitializer(); - // N.B.: We are defaulting to writable strings - if (I->hasExternalLinkage()) { - O << "\t.globl " << Name << '\n' - << "\t.csect .data[RW],3\n"; - } else { - O << "\t.csect _global.rw_c[RW],3\n"; - } - O << Name << ":\n"; - EmitGlobalConstant(C); - } - - // Output labels for globals - if (M.global_begin() != M.global_end()) O << "\t.toc\n"; - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) { - const GlobalVariable *GV = I; - // Do not output labels for unused variables - if (GV->isExternal() && GV->use_begin() == GV->use_end()) - continue; - - IncrementFunctionNumber(); - std::string Name = GV->getName(); - std::string Label = "LC.." + utostr(getFunctionNumber()); - GVToLabelMap[GV] = Label; - O << Label << ":\n" - << "\t.tc " << Name << "[TC]," << Name; - if (GV->isExternal()) O << "[RW]"; - O << '\n'; - } - - AsmPrinter::doInitialization(M); - return false; // success -} - -bool AIXAsmPrinter::doFinalization(Module &M) { - const TargetData *TD = TM.getTargetData(); - // Print out module-level global variables - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) { - if (I->hasInitializer() || I->hasExternalLinkage()) - continue; - - std::string Name = I->getName(); - if (I->hasInternalLinkage()) { - O << "\t.lcomm " << Name << ",16,_global.bss_c"; - } else { - O << "\t.comm " << Name << "," << TD->getTypeSize(I->getType()) - << "," << Log2_32((unsigned)TD->getTypeAlignment(I->getType())); - } - O << "\t\t" << CommentString << " "; - WriteAsOperand(O, I, false, true, &M); - O << "\n"; - } - - O << "_section_.text:\n" - << "\t.csect .data[RW],3\n" - << "\t.llong _section_.text\n"; - AsmPrinter::doFinalization(M); - return false; // success -} diff --git a/lib/Target/PowerPC/PPCSubtarget.cpp b/lib/Target/PowerPC/PPCSubtarget.cpp index 2b78f9e..643acc2 100644 --- a/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/lib/Target/PowerPC/PPCSubtarget.cpp @@ -66,7 +66,6 @@ PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS, bool is64Bit) , HasAltivec(false) , HasFSQRT(false) , HasSTFIWX(false) - , IsAIX(false) , IsDarwin(false) { // Determine default and user specified characteristics @@ -102,12 +101,8 @@ PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS, bool is64Bit) const std::string& TT = M.getTargetTriple(); if (TT.length() > 5) { IsDarwin = TT.find("-darwin") != std::string::npos; - if (!IsDarwin) - IsAIX = TT.find("-aix") != std::string::npos; } else if (TT.empty()) { -#if defined(_POWER) - IsAIX = true; -#elif defined(__APPLE__) +#if defined(__APPLE__) IsDarwin = true; #endif } diff --git a/lib/Target/PowerPC/PPCSubtarget.h b/lib/Target/PowerPC/PPCSubtarget.h index 2c5c6ba..1851024 100644 --- a/lib/Target/PowerPC/PPCSubtarget.h +++ b/lib/Target/PowerPC/PPCSubtarget.h @@ -39,7 +39,6 @@ protected: bool HasAltivec; bool HasFSQRT; bool HasSTFIWX; - bool IsAIX; bool IsDarwin; public: /// This constructor initializes the data members to match that @@ -86,7 +85,6 @@ public: bool hasAltivec() const { return HasAltivec; } bool isGigaProcessor() const { return IsGigaProcessor; } - bool isAIX() const { return IsAIX; } bool isDarwin() const { return IsDarwin; } }; } // End llvm namespace diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 0bc9e7e..12c22e7 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -146,12 +146,7 @@ bool PPCTargetMachine::addPassesToEmitFile(PassManager &PM, // Must run branch selection immediately preceding the asm printer PM.add(createPPCBranchSelectionPass()); - // Decide which asm printer to use. If the user has not specified one on - // the command line, choose whichever one matches the default (current host). - if (Subtarget.isAIX()) - PM.add(createAIXAsmPrinter(Out, *this)); - else - PM.add(createDarwinAsmPrinter(Out, *this)); + PM.add(createDarwinAsmPrinter(Out, *this)); PM.add(createMachineCodeDeleter()); return false; -- cgit v1.1