aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index c3106f4..d5926f9 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"
+#if !defined(ANDROID_TARGET_BUILD) || defined(ANDROID_ENGINEERING_BUILD)
+# include "DwarfDebug.h"
+# include "DwarfException.h"
+#endif // !ANDROID_TARGET_BUILD || ANDROID_ENGINEERING_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";
@@ -187,6 +190,7 @@ bool AsmPrinter::doInitialization(Module &M) {
OutStreamer.AddBlankLine();
}
+#if !defined(ANDROID_TARGET_BUILD) || defined(ANDROID_ENGINEERING_BUILD)
if (MAI->doesSupportDebugInformation())
DD = new DwarfDebug(this, &M);
@@ -204,6 +208,9 @@ bool AsmPrinter::doInitialization(Module &M) {
DE = new Win64Exception(this);
return false;
}
+#else
+ return false;
+#endif // !ANDROID_TARGET_BUILD || ANDROID_ENGINEERING_BUILD
llvm_unreachable("Unknown exception type.");
}
@@ -460,6 +467,7 @@ void AsmPrinter::EmitFunctionHeader() {
}
// Emit pre-function debug and/or EH information.
+#if !defined(ANDROID_TARGET_BUILD) || defined(ANDROID_ENGINEERING_BUILD)
if (DE) {
NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled);
DE->BeginFunction(MF);
@@ -468,6 +476,7 @@ void AsmPrinter::EmitFunctionHeader() {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->beginFunction(MF);
}
+#endif // !ANDROID_TARGET_BUILD || ANDROID_ENGINEERING_BUILD
}
/// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the
@@ -667,13 +676,15 @@ void AsmPrinter::EmitFunctionBody() {
if (!II->isLabel() && !II->isImplicitDef() && !II->isKill() &&
!II->isDebugValue()) {
HasAnyRealCode = true;
+
++EmittedInsts;
}
-
+#if !defined(ANDROID_TARGET_BUILD) || defined(ANDROID_ENGINEERING_BUILD)
if (ShouldPrintDebugScopes) {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->beginInstruction(II);
}
+#endif // !ANDROID_TARGET_BUILD || ANDROID_ENGINEERING_BUILD
if (isVerbose())
EmitComments(*II, OutStreamer.GetCommentOS());
@@ -710,10 +721,12 @@ void AsmPrinter::EmitFunctionBody() {
break;
}
+#if !defined(ANDROID_TARGET_BUILD) || defined(ANDROID_ENGINEERING_BUILD)
if (ShouldPrintDebugScopes) {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->endInstruction(II);
}
+#endif // !ANDROID_TARGET_BUILD || ANDROID_ENGINEERING_BUILD
}
}
@@ -769,6 +782,7 @@ void AsmPrinter::EmitFunctionBody() {
}
// Emit post-function debug information.
+#if !defined(ANDROID_TARGET_BUILD) || defined(ANDROID_ENGINEERING_BUILD)
if (DD) {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->endFunction(MF);
@@ -777,6 +791,7 @@ void AsmPrinter::EmitFunctionBody() {
NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled);
DE->EndFunction();
}
+#endif // !ANDROID_TARGET_BUILD || ANDROID_ENGINEERING_BUILD
MMI->EndFunction();
// Print out jump tables referenced by the function.
@@ -866,6 +881,7 @@ bool AsmPrinter::doFinalization(Module &M) {
getObjFileLowering().emitModuleFlags(OutStreamer, ModuleFlags, Mang, TM);
// Finalize debug and EH information.
+#if !defined(ANDROID_TARGET_BUILD) || defined(ANDROID_ENGINEERING_BUILD)
if (DE) {
{
NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled);
@@ -880,6 +896,7 @@ bool AsmPrinter::doFinalization(Module &M) {
}
delete DD; DD = 0;
}
+#endif // !ANDROID_TARGET_BUILD || ANDROID_ENGINEERING_BUILD
// If the target wants to know about weak references, print them all.
if (MAI->getWeakRefDirective()) {