Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Native/ObjWriter/objwriter.h')
-rw-r--r--src/Native/ObjWriter/objwriter.h48
1 files changed, 36 insertions, 12 deletions
diff --git a/src/Native/ObjWriter/objwriter.h b/src/Native/ObjWriter/objwriter.h
index 21327b3be..6c1ba8645 100644
--- a/src/Native/ObjWriter/objwriter.h
+++ b/src/Native/ObjWriter/objwriter.h
@@ -1,10 +1,10 @@
-//===---- objwriter.h --------------------------------*- C++ -*-===//
+//===---- objwriter.h ------------------------------------------*- C++ -*-===//
//
// object writer
//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license.
-// See LICENSE file in the project root for full license information.
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
//
//===----------------------------------------------------------------------===//
@@ -19,7 +19,8 @@
#include "jitDebugInfo.h"
#include <string>
#include <set>
-#include "typeBuilder.h"
+#include "debugInfo/typeBuilder.h"
+#include "debugInfo/dwarf/dwarfGen.h"
using namespace llvm;
using namespace llvm::codeview;
@@ -68,11 +69,13 @@ public:
int EmitSymbolRef(const char *SymbolName, RelocType RelocType, int Delta);
void EmitDebugFileInfo(int FileId, const char *FileName);
- void EmitDebugFunctionInfo(const char *FunctionName, int FunctionSize);
+ void EmitDebugFunctionInfo(const char *FunctionName, int FunctionSize, unsigned MethodTypeIndex);
void EmitDebugVar(char *Name, int TypeIndex, bool IsParm, int RangeCount,
const ICorDebugInfo::NativeVarInfo *Ranges);
void EmitDebugLoc(int NativeOffset, int FileId, int LineNumber,
int ColNumber);
+ void EmitDebugEHClause(unsigned TryOffset, unsigned TryLength,
+ unsigned HandlerOffset, unsigned HandlerLength);
void EmitDebugModuleInfo();
void EmitCFIStart(int Offset);
@@ -86,7 +89,8 @@ public:
unsigned GetCompleteClassTypeIndex(
const ClassTypeDescriptor &ClassDescriptor,
const ClassFieldsTypeDescriptior &ClassFieldsDescriptor,
- const DataFieldDescriptor *FieldsDescriptors);
+ const DataFieldDescriptor *FieldsDescriptors,
+ const StaticDataFieldDescriptor *StaticsDescriptors);
unsigned GetArrayTypeIndex(const ClassTypeDescriptor &ClassDescriptor,
const ArrayTypeDescriptor &ArrayDescriptor);
@@ -98,6 +102,8 @@ public:
unsigned GetMemberFunctionId(const MemberFunctionIdTypeDescriptor& MemberIdDescriptor);
+ unsigned GetPrimitiveTypeIndex(int Type);
+
void EmitARMFnStart();
void EmitARMFnEnd();
void EmitARMExIdxCode(int Offset, const char *Blob);
@@ -114,6 +120,8 @@ private:
int NumVarInfos);
void EmitCVDebugFunctionInfo(const char *FunctionName, int FunctionSize);
+ void EmitDwarfFunctionInfo(const char *FunctionName, int FunctionSize, unsigned MethodTypeIndex);
+
const MCSymbolRefExpr *GetSymbolRefExpr(
const char *SymbolName,
MCSymbolRefExpr::VariantKind Kind = MCSymbolRefExpr::VK_None);
@@ -149,16 +157,18 @@ private:
std::unique_ptr<TargetMachine> TMachine;
std::unique_ptr<AsmPrinter> AssemblerPrinter;
MCAssembler *Assembler; // Owned by MCStreamer
+ std::unique_ptr<DwarfGen> DwarfGenerator;
std::unique_ptr<raw_fd_ostream> OS;
MCTargetOptions TargetMOptions;
bool FrameOpened;
std::vector<DebugVarInfo> DebugVarInfos;
+ std::vector<DebugEHClauseInfo> DebugEHClauseInfos;
std::set<MCSection *> Sections;
int FuncId;
- UserDefinedTypesBuilder TypeBuilder;
+ std::unique_ptr<UserDefinedTypesBuilder> TypeBuilder;
std::string TripleName;
@@ -258,9 +268,10 @@ DLL_EXPORT void EmitDebugFileInfo(ObjectWriter *OW, int FileId,
DLL_EXPORT void EmitDebugFunctionInfo(ObjectWriter *OW,
const char *FunctionName,
- int FunctionSize) {
+ int FunctionSize,
+ unsigned MethodTypeIndex) {
assert(OW && "ObjWriter is null");
- OW->EmitDebugFunctionInfo(FunctionName, FunctionSize);
+ OW->EmitDebugFunctionInfo(FunctionName, FunctionSize, MethodTypeIndex);
}
DLL_EXPORT void EmitDebugVar(ObjectWriter *OW, char *Name, int TypeIndex,
@@ -270,6 +281,13 @@ DLL_EXPORT void EmitDebugVar(ObjectWriter *OW, char *Name, int TypeIndex,
OW->EmitDebugVar(Name, TypeIndex, IsParam, RangeCount, Ranges);
}
+DLL_EXPORT void EmitDebugEHClause(ObjectWriter *OW, unsigned TryOffset,
+ unsigned TryLength, unsigned HandlerOffset,
+ unsigned HandlerLength) {
+ assert(OW && "ObjWriter is null");
+ OW->EmitDebugEHClause(TryOffset, TryLength, HandlerOffset, HandlerLength);
+}
+
DLL_EXPORT void EmitDebugLoc(ObjectWriter *OW, int NativeOffset, int FileId,
int LineNumber, int ColNumber) {
assert(OW && "ObjWriter is null");
@@ -299,10 +317,11 @@ DLL_EXPORT unsigned GetClassTypeIndex(ObjectWriter *OW,
DLL_EXPORT unsigned
GetCompleteClassTypeIndex(ObjectWriter *OW, ClassTypeDescriptor ClassDescriptor,
ClassFieldsTypeDescriptior ClassFieldsDescriptor,
- DataFieldDescriptor *FieldsDescriptors) {
+ DataFieldDescriptor *FieldsDescriptors,
+ StaticDataFieldDescriptor *StaticsDescriptors) {
assert(OW && "ObjWriter is null");
return OW->GetCompleteClassTypeIndex(ClassDescriptor, ClassFieldsDescriptor,
- FieldsDescriptors);
+ FieldsDescriptors, StaticsDescriptors);
}
DLL_EXPORT unsigned GetArrayTypeIndex(ObjectWriter *OW,
@@ -331,6 +350,11 @@ DLL_EXPORT unsigned GetMemberFunctionIdTypeIndex(ObjectWriter *OW,
return OW->GetMemberFunctionId(MemberIdDescriptor);
}
+DLL_EXPORT unsigned GetPrimitiveTypeIndex(ObjectWriter *OW, int Type) {
+ assert(OW && "ObjWriter is null");
+ return OW->GetPrimitiveTypeIndex(Type);
+}
+
DLL_EXPORT void EmitARMFnStart(ObjectWriter *OW) {
assert(OW && "ObjWriter is null");
return OW->EmitARMFnStart();