#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"
#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";
OutStreamer.AddBlankLine();
}
+#ifndef ANDROID_TARGET_BUILD
if (MAI->doesSupportDebugInformation())
DD = new DwarfDebug(this, &M);
DE = new Win64Exception(this);
return false;
}
+#else
+ return false;
+#endif // ANDROID_TARGET_BUILD
llvm_unreachable("Unknown exception type.");
}
}
// Emit pre-function debug and/or EH information.
+#ifndef ANDROID_TARGET_BUILD
if (DE) {
NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled);
DE->BeginFunction(MF);
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->beginFunction(MF);
}
+#endif // ANDROID_TARGET_BUILD
}
/// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the
void AsmPrinter::EmitFunctionEntryLabel() {
// The function label could have already been emitted if two symbols end up
// conflicting due to asm renaming. Detect this and emit an error.
- if (CurrentFnSym->isUndefined())
+ if (CurrentFnSym->isUndefined()) {
+ OutStreamer.ForceCodeRegion();
return OutStreamer.EmitLabel(CurrentFnSym);
+ }
report_fatal_error("'" + Twine(CurrentFnSym->getName()) +
"' label emitted multiple times to assembly file");
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());
EmitInstruction(II);
break;
}
-
+
+#ifndef ANDROID_TARGET_BUILD
if (ShouldPrintDebugScopes) {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->endInstruction(II);
}
+#endif // ANDROID_TARGET_BUILD
}
}
}
// Emit post-function debug information.
+#ifndef ANDROID_TARGET_BUILD
if (DD) {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
DD->endFunction(MF);
NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled);
DE->EndFunction();
}
+#endif // ANDROID_TARGET_BUILD
MMI->EndFunction();
// Print out jump tables referenced by the function.
}
// Finalize debug and EH information.
+#ifndef ANDROID_TARGET_BUILD
if (DE) {
{
NamedRegionTimer T(EHTimerName, DWARFGroupName, TimePassesIsEnabled);
}
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
EmitAlignment(Log2_32(MJTI->getEntryAlignment(*TM.getTargetData())));
+ // If we know the form of the jump table, go ahead and tag it as such.
+ if (!JTInDiffSection) {
+ if (MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32) {
+ OutStreamer.EmitJumpTable32Region();
+ } else {
+ OutStreamer.EmitDataRegion();
+ }
+ }
+
for (unsigned JTI = 0, e = JT.size(); JTI != e; ++JTI) {
const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;