WONKY



LOG | FILES | OVERVIEW


F diff --git a/src/semantics/memory/location.h b/src/semantics/memory/location.h --- a/src/semantics/memory/location.h +++ b/src/semantics/memory/location.h
#include <location.hh>
#include <lexer.h>
#include <type.h>
-
-
enum Location_Type;
struct Location
{
- enum Location_Type type;
+ int type;
};
- struct Location_Stack
- {
- enum Location_Type type;
- size_t offset;
- };
- struct Location_Raw
- {
- enum Location_Type type;
- size_t address;
- };
-
- struct Location_Relative
- {
- enum Location_Type type;
- struct Location *base;
- size_t offset;
- };
-
- struct Location_Labeled
- {
- enum Location_Type type;
- struct token *id;
- };
-
- struct Location_Stack* get_location_on_stack(size_t offset);
- struct Location* get_global_location();
- struct Location_Raw* get_location_raw(size_t address);
- struct Location_Relative* get_relative_location(struct Location *base,size_t offset);
- struct Location* get_location_for_denoted_object(struct Location *base,struct Type *type,struct token *id);
- struct Location* get_temp_location();
-
-
- void delete_location(struct Location *location);
-
#endif
F diff --git a/src/semantics/memory/location.hh b/src/semantics/memory/location.hh --- a/src/semantics/memory/location.hh +++ b/src/semantics/memory/location.hh
#ifndef WONKY_LOCATION_HH
#define WONKY_LOCATION_HH WONKY_LOCATION_HH
- enum Location_Type
- {
- LT_ON_STACK,
- LT_RAW,
- LT_RELATIVE,
- LT_LABELED,
- LT_GLOBAL,
- LT_TEMP
- };
struct Location;
- struct Location_Stack;
- struct Location_Raw;
- struct Location_Relative;
- struct Location_Labeled;
-
#endif
F diff --git a/src/semantics/memory/object.c b/src/semantics/memory/object.c --- a/src/semantics/memory/object.c +++ b/src/semantics/memory/object.c
#include<object.h>
+ struct Object* get_object(struct Type *type,enum Storage_Class_Specifier storage_class)
+ {
+ struct Object *ret;
+ ret=malloc(sizeof(struct Object));
+ ret->type=type;
+ ret->storage_class=storage_class;
+
+
+ ret->location=NULL;
+ }
void delete_object(struct Object *object)
{
F diff --git a/src/semantics/memory/object.h b/src/semantics/memory/object.h --- a/src/semantics/memory/object.h +++ b/src/semantics/memory/object.h
};
void delete_object(struct Object *object);
+ struct Object* get_object(struct Type *type,enum Storage_Class_Specifier storage_class);
struct Object* retype_object(struct Object *object,struct Type *new_type);
struct Object* get_temp_object(struct Type *type);