diff options
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
| -rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 7f314ee..2cdf272 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/ErrorHandling.h" #include "llvm/Support/Format.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 @@ -657,14 +666,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()); @@ -699,11 +710,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 } } @@ -746,6 +759,7 @@ void AsmPrinter::EmitFunctionBody() { } // Emit post-function debug information. +#ifndef ANDROID_TARGET_BUILD if (DD) { NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); DD->endFunction(MF); @@ -754,6 +768,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. @@ -837,6 +852,7 @@ bool AsmPrinter::doFinalization(Module &M) { } // Finalize debug and EH information. +#ifndef ANDROID_TARGET_BUILD if (DE) { { NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled); @@ -851,7 +867,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 |
