diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/Android.mk | 124 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/Android.mk | 44 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 29 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/Android.mk | 52 |
5 files changed, 247 insertions, 6 deletions
diff --git a/lib/CodeGen/Android.mk b/lib/CodeGen/Android.mk new file mode 100644 index 0000000000..86bc3ed860 --- /dev/null +++ b/lib/CodeGen/Android.mk @@ -0,0 +1,124 @@ +LOCAL_PATH:= $(call my-dir) + +codegen_SRC_FILES := \ + AggressiveAntiDepBreaker.cpp \ + AllocationOrder.cpp \ + Analysis.cpp \ + BranchFolding.cpp \ + CalcSpillWeights.cpp \ + CallingConvLower.cpp \ + CodePlacementOpt.cpp \ + CriticalAntiDepBreaker.cpp \ + DeadMachineInstructionElim.cpp \ + DwarfEHPrepare.cpp \ + EdgeBundles.cpp \ + ELFCodeEmitter.cpp \ + ELFWriter.cpp \ + ExpandISelPseudos.cpp \ + GCMetadata.cpp \ + GCMetadataPrinter.cpp \ + GCStrategy.cpp \ + IfConversion.cpp \ + InlineSpiller.cpp \ + InterferenceCache.cpp \ + IntrinsicLowering.cpp \ + LLVMTargetMachine.cpp \ + LatencyPriorityQueue.cpp \ + LiveDebugVariables.cpp \ + LiveInterval.cpp \ + LiveIntervalUnion.cpp \ + LiveIntervalAnalysis.cpp \ + LiveRangeEdit.cpp \ + LiveStackAnalysis.cpp \ + LiveVariables.cpp \ + LocalStackSlotAllocation.cpp \ + LowerSubregs.cpp \ + MachineBasicBlock.cpp \ + MachineBranchProbabilityInfo.cpp \ + MachineCSE.cpp \ + MachineDominators.cpp \ + MachineFunction.cpp \ + MachineFunctionAnalysis.cpp \ + MachineFunctionPass.cpp \ + MachineFunctionPrinterPass.cpp \ + MachineBlockFrequency.cpp \ + MachineInstr.cpp \ + MachineLICM.cpp \ + MachineLoopInfo.cpp \ + MachineLoopRanges.cpp \ + MachineModuleInfo.cpp \ + MachineModuleInfoImpls.cpp \ + MachinePassRegistry.cpp \ + MachineRegisterInfo.cpp \ + MachineSSAUpdater.cpp \ + MachineSink.cpp \ + MachineVerifier.cpp \ + ObjectCodeEmitter.cpp \ + OcamlGC.cpp \ + OptimizePHIs.cpp \ + PHIElimination.cpp \ + PHIEliminationUtils.cpp \ + Passes.cpp \ + PeepholeOptimizer.cpp \ + PostRASchedulerList.cpp \ + ProcessImplicitDefs.cpp \ + PrologEpilogInserter.cpp \ + PseudoSourceValue.cpp \ + RegAllocBasic.cpp \ + RegAllocFast.cpp \ + RegAllocGreedy.cpp \ + RegAllocLinearScan.cpp \ + RegAllocPBQP.cpp \ + RegisterCoalescer.cpp \ + RegisterClassInfo.cpp \ + RegisterScavenging.cpp \ + RenderMachineFunction.cpp \ + ScheduleDAG.cpp \ + ScheduleDAGEmit.cpp \ + ScheduleDAGInstrs.cpp \ + ScheduleDAGPrinter.cpp \ + ScoreboardHazardRecognizer.cpp \ + ShadowStackGC.cpp \ + ShrinkWrapping.cpp \ + SjLjEHPrepare.cpp \ + SlotIndexes.cpp \ + Spiller.cpp \ + SpillPlacement.cpp \ + SplitKit.cpp \ + Splitter.cpp \ + StackProtector.cpp \ + StackSlotColoring.cpp \ + StrongPHIElimination.cpp \ + TailDuplication.cpp \ + TargetInstrInfoImpl.cpp \ + TargetLoweringObjectFileImpl.cpp \ + TwoAddressInstructionPass.cpp \ + UnreachableBlockElim.cpp \ + VirtRegMap.cpp \ + VirtRegRewriter.cpp + +# For the host +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(codegen_SRC_FILES) +LOCAL_MODULE:= libLLVMCodeGen + +LOCAL_MODULE_TAGS := optional + +include $(LLVM_HOST_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_HOST_STATIC_LIBRARY) + +# For the device +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(codegen_SRC_FILES) +LOCAL_MODULE:= libLLVMCodeGen + +LOCAL_MODULE_TAGS := optional + +include $(LLVM_DEVICE_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_STATIC_LIBRARY) diff --git a/lib/CodeGen/AsmPrinter/Android.mk b/lib/CodeGen/AsmPrinter/Android.mk new file mode 100644 index 0000000000..47cb637ce4 --- /dev/null +++ b/lib/CodeGen/AsmPrinter/Android.mk @@ -0,0 +1,44 @@ +LOCAL_PATH := $(call my-dir) + +codegen_asmprinter_SRC_FILES := \ + AsmPrinter.cpp + +# For the host +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + AsmPrinter.cpp \ + AsmPrinterDwarf.cpp \ + AsmPrinterInlineAsm.cpp \ + ARMException.cpp \ + DIE.cpp \ + DwarfCFIException.cpp \ + DwarfCompileUnit.cpp \ + DwarfDebug.cpp \ + DwarfException.cpp \ + OcamlGCPrinter.cpp \ + Win64Exception.cpp + +LOCAL_MODULE:= libLLVMAsmPrinter + +LOCAL_MODULE_TAGS := optional + +include $(LLVM_HOST_BUILD_MK) +include $(BUILD_HOST_STATIC_LIBRARY) + +# For the device +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + AsmPrinter.cpp \ + AsmPrinterDwarf.cpp \ + AsmPrinterInlineAsm.cpp + +LOCAL_MODULE:= libLLVMAsmPrinter + +LOCAL_MODULE_TAGS := optional + +include $(LLVM_DEVICE_BUILD_MK) +include $(BUILD_STATIC_LIBRARY) diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 1999f36087..c9de6d238c 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -13,8 +13,10 @@ #define DEBUG_TYPE "asm-printer" #include "llvm/CodeGen/AsmPrinter.h" -#include "DwarfDebug.h" -#include "DwarfException.h" +#ifndef ANDROID_TARGET_BUILD +# include "DwarfDebug.h" +# include "DwarfException.h" +#endif // ANDROID_TARGET_BUILD #include "llvm/Module.h" #include "llvm/CodeGen/GCMetadataPrinter.h" #include "llvm/CodeGen/MachineConstantPool.h" @@ -46,6 +48,7 @@ #include "llvm/Support/Format.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Timer.h" +#include <ctype.h> using namespace llvm; static const char *DWARFGroupName = "DWARF Emission"; @@ -186,6 +189,7 @@ bool AsmPrinter::doInitialization(Module &M) { OutStreamer.AddBlankLine(); } +#ifndef ANDROID_TARGET_BUILD if (MAI->doesSupportDebugInformation()) DD = new DwarfDebug(this, &M); @@ -203,6 +207,9 @@ bool AsmPrinter::doInitialization(Module &M) { DE = new Win64Exception(this); return false; } +#else + return false; +#endif // ANDROID_TARGET_BUILD llvm_unreachable("Unknown exception type."); } @@ -459,6 +466,7 @@ void AsmPrinter::EmitFunctionHeader() { } // Emit pre-function debug and/or EH information. +#ifndef ANDROID_TARGET_BUILD if (DE) { NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled); DE->BeginFunction(MF); @@ -467,6 +475,7 @@ void AsmPrinter::EmitFunctionHeader() { NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); DD->beginFunction(MF); } +#endif // ANDROID_TARGET_BUILD } /// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the @@ -662,14 +671,16 @@ void AsmPrinter::EmitFunctionBody() { if (!II->isLabel() && !II->isImplicitDef() && !II->isKill() && !II->isDebugValue()) { HasAnyRealCode = true; + ++EmittedInsts; } - +#ifndef ANDROID_TARGET_BUILD if (ShouldPrintDebugScopes) { NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); DD->beginInstruction(II); } - +#endif // ANDROID_TARGET_BUILD + if (isVerbose()) EmitComments(*II, OutStreamer.GetCommentOS()); @@ -704,11 +715,13 @@ void AsmPrinter::EmitFunctionBody() { EmitInstruction(II); break; } - + +#ifndef ANDROID_TARGET_BUILD if (ShouldPrintDebugScopes) { NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); DD->endInstruction(II); } +#endif // ANDROID_TARGET_BUILD } } @@ -751,6 +764,7 @@ void AsmPrinter::EmitFunctionBody() { } // Emit post-function debug information. +#ifndef ANDROID_TARGET_BUILD if (DD) { NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); DD->endFunction(MF); @@ -759,6 +773,7 @@ void AsmPrinter::EmitFunctionBody() { NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled); DE->EndFunction(); } +#endif // ANDROID_TARGET_BUILD MMI->EndFunction(); // Print out jump tables referenced by the function. @@ -842,6 +857,7 @@ bool AsmPrinter::doFinalization(Module &M) { } // Finalize debug and EH information. +#ifndef ANDROID_TARGET_BUILD if (DE) { { NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled); @@ -856,7 +872,8 @@ bool AsmPrinter::doFinalization(Module &M) { } delete DD; DD = 0; } - +#endif // ANDROID_TARGET_BUILD + // If the target wants to know about weak references, print them all. if (MAI->getWeakRefDirective()) { // FIXME: This is not lazy, it would be nice to only print weak references diff --git a/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp index 8eda889155..89e6cd1970 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp @@ -69,6 +69,7 @@ static void SrcMgrDiagHandler(const SMDiagnostic &Diag, void *diagInfo) { /// EmitInlineAsm - Emit a blob of inline asm to the output streamer. void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode) const { +#ifndef ANDROID_TARGET_BUILD assert(!Str.empty() && "Can't emit empty inline asm block"); // Remember if the buffer is nul terminated or not so we can avoid a copy. @@ -133,12 +134,14 @@ void AsmPrinter::EmitInlineAsm(StringRef Str, const MDNode *LocMDNode) const { /*NoFinalize*/ true); if (Res && !HasDiagHandler) report_fatal_error("Error parsing inline asm\n"); +#endif // ANDROID_TARGET_BUILD } /// EmitInlineAsm - This method formats and emits the specified machine /// instruction that is an inline asm. void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const { +#ifndef ANDROID_TARGET_BUILD assert(MI->isInlineAsm() && "printInlineAsm only works on inline asms"); unsigned NumOperands = MI->getNumOperands(); @@ -366,6 +369,7 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const { if (OutStreamer.hasRawTextSupport()) OutStreamer.EmitRawText(Twine("\t")+MAI->getCommentString()+ MAI->getInlineAsmEnd()); +#endif // ANDROID_TARGET_BUILD } diff --git a/lib/CodeGen/SelectionDAG/Android.mk b/lib/CodeGen/SelectionDAG/Android.mk new file mode 100644 index 0000000000..d3522fea6f --- /dev/null +++ b/lib/CodeGen/SelectionDAG/Android.mk @@ -0,0 +1,52 @@ +LOCAL_PATH:= $(call my-dir) + +codegen_selectiondag_SRC_FILES := \ + DAGCombiner.cpp \ + FastISel.cpp \ + FunctionLoweringInfo.cpp \ + InstrEmitter.cpp \ + LegalizeDAG.cpp \ + LegalizeFloatTypes.cpp \ + LegalizeIntegerTypes.cpp \ + LegalizeTypes.cpp \ + LegalizeTypesGeneric.cpp \ + LegalizeVectorOps.cpp \ + LegalizeVectorTypes.cpp \ + ScheduleDAGFast.cpp \ + ScheduleDAGList.cpp \ + ScheduleDAGRRList.cpp \ + ScheduleDAGSDNodes.cpp \ + SelectionDAG.cpp \ + SelectionDAGBuilder.cpp \ + SelectionDAGISel.cpp \ + SelectionDAGPrinter.cpp \ + TargetLowering.cpp \ + TargetSelectionDAGInfo.cpp + +# For the host +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(codegen_selectiondag_SRC_FILES) + +LOCAL_MODULE:= libLLVMSelectionDAG + +LOCAL_MODULE_TAGS := optional + +include $(LLVM_HOST_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_HOST_STATIC_LIBRARY) + +# For the device +# ===================================================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(codegen_selectiondag_SRC_FILES) + +LOCAL_MODULE:= libLLVMSelectionDAG + +LOCAL_MODULE_TAGS := optional + +include $(LLVM_DEVICE_BUILD_MK) +include $(LLVM_GEN_INTRINSICS_MK) +include $(BUILD_STATIC_LIBRARY) |