Skip to content

Commit

Permalink
Use fixed width integer types in Compiler
Browse files Browse the repository at this point in the history
- Contributes to #535
- Contributes to #531
- Also address many code analysis issues from VS19 in-IDE parser
  - e.g. Use of enum class in preference to unscoped enums
- Define specific integer types (using enum class) for IPs and text positions to help identify
errors
  • Loading branch information
blairmcg committed Dec 2, 2019
1 parent f3cce4e commit b94768e
Show file tree
Hide file tree
Showing 24 changed files with 2,249 additions and 1,924 deletions.
5 changes: 4 additions & 1 deletion Core/DolphinVM/Compiler/Compiler.idl
Expand Up @@ -144,7 +144,10 @@ library CompilerLib
CInfoLast = CInfoHardBreakpoint
} FirstAndLastCodes;

typedef enum FLAGS {Default=0x00, SyntaxCheckOnly=0x02, NoOptimize=0x08, TextMap=0x10, TempsMap=0x20, DebugMethod=0x40, Boot=0x80, ScanOnly=0x100, Interactive=0x200, SendYourself=0x400} FLAGS;
cpp_quote("#define class_CompilerFlags class CompilerFlags")
typedef enum class_CompilerFlags
{Default=0x00, SyntaxCheckOnly=0x02, NoOptimize=0x08, TextMap=0x10, TempsMap=0x20, DebugMethod=0x40, Boot=0x80, ScanOnly=0x100, Interactive=0x200, SendYourself=0x400} FLAGS;
cpp_quote("#undef CompilerFlags")

[
object,
Expand Down
2 changes: 1 addition & 1 deletion Core/DolphinVM/Compiler/CompilerSupport.cpp
Expand Up @@ -14,7 +14,7 @@ be thrown away eventually, or perhaps compiled into a separate DLL.

#include "..\VMPointers.h"

POTE Compiler::NewCompiledMethod(POTE classPointer, unsigned numBytes, const STMethodHeader& hdr)
POTE Compiler::NewCompiledMethod(POTE classPointer, size_t numBytes, const STMethodHeader& hdr)
{
//_ASSERTE(ObjectMemory::inheritsFrom(classPointer, GetVMPointers().ClassCompiledMethod));
// Note we subtract
Expand Down

0 comments on commit b94768e

Please sign in to comment.