diff options
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index d1d01b630a..8fb8918719 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" @@ -43,6 +45,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" #include "llvm/Support/Timer.h" +#include <ctype.h> using namespace llvm; static const char *DWARFGroupName = "DWARF Emission"; @@ -183,11 +186,13 @@ bool AsmPrinter::doInitialization(Module &M) { OutStreamer.AddBlankLine(); } +#ifndef ANDROID_TARGET_BUILD if (MAI->doesSupportDebugInformation()) DD = new DwarfDebug(this, &M); if (MAI->doesSupportExceptionHandling()) DE = new DwarfException(this); +#endif // ANDROID_TARGET_BUILD return false; } @@ -448,6 +453,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); @@ -456,6 +462,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 @@ -633,13 +640,15 @@ 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()); @@ -670,10 +679,12 @@ void AsmPrinter::EmitFunctionBody() { break; } +#ifndef ANDROID_TARGET_BUILD if (ShouldPrintDebugScopes) { NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); DD->endInstruction(II); } +#endif // ANDROID_TARGET_BUILD } } @@ -716,6 +727,7 @@ void AsmPrinter::EmitFunctionBody() { } // Emit post-function debug information. +#ifndef ANDROID_TARGET_BUILD if (DD) { NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); DD->endFunction(MF); @@ -724,6 +736,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. @@ -746,6 +759,7 @@ bool AsmPrinter::doFinalization(Module &M) { EmitGlobalVariable(I); // Finalize debug and EH information. +#ifndef ANDROID_TARGET_BUILD if (DE) { { NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled); @@ -760,6 +774,7 @@ 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()) { |