Rename enum member to not clash with type names.

0.96
Török Edvin 16 years ago
parent a97998d294
commit c466339d01
  1. 10
      libclamav/bytecode.c
  2. 6
      libclamav/bytecode2llvm.cpp
  3. 8
      libclamav/bytecode_api_decl.c
  4. 10
      libclamav/type_desc.h

@ -456,7 +456,7 @@ static void add_static_types(struct cli_bc *bc)
{
unsigned i;
for (i=0;i<NUM_STATIC_TYPES;i++) {
bc->types[i].kind = PointerType;
bc->types[i].kind = DPointerType;
bc->types[i].numElements = 1;
bc->types[i].containedTypes = &containedTy[i];
bc->types[i].size = bc->types[i].align = sizeof(void*);
@ -488,7 +488,7 @@ static int parseTypes(struct cli_bc *bc, unsigned char *buffer)
}
switch (t) {
case 1:
ty->kind = FunctionType;
ty->kind = DFunctionType;
ty->size = ty->align = sizeof(void*);
parseType(bc, ty, buffer, &offset, len, &ok);
if (!ok) {
@ -498,7 +498,7 @@ static int parseTypes(struct cli_bc *bc, unsigned char *buffer)
break;
case 2:
case 3:
ty->kind = (t == 2) ? StructType : PackedStructType;
ty->kind = (t == 2) ? DStructType : DPackedStructType;
ty->size = ty->align = 0;/* TODO:calculate size/align of structs */
parseType(bc, ty, buffer, &offset, len, &ok);
if (!ok) {
@ -507,7 +507,7 @@ static int parseTypes(struct cli_bc *bc, unsigned char *buffer)
}
break;
case 4:
ty->kind = ArrayType;
ty->kind = DArrayType;
/* number of elements of array, not subtypes! */
ty->numElements = readNumber(buffer, &offset, len, &ok);
if (!ok) {
@ -517,7 +517,7 @@ static int parseTypes(struct cli_bc *bc, unsigned char *buffer)
/* fall-through */
case 5:
if (t == 5) {
ty->kind = PointerType;
ty->kind = DPointerType;
ty->numElements = 1;
}
ty->containedTypes = cli_malloc(sizeof(*ty->containedTypes));

@ -214,7 +214,7 @@ public:
PrettyStackTraceString Trace(BytecodeID.str().c_str());
convertTypes();
llvm::FunctionType *FTy = FunctionType::get(Type::getVoidTy(Context),
FunctionType *FTy = FunctionType::get(Type::getVoidTy(Context),
false);
Function *FHandler = Function::Create(FTy, Function::InternalLinkage,
"clamjit.fail", M);
@ -233,7 +233,7 @@ public:
argTypes.push_back(mapType(func->types[a]));
}
const Type *RetTy = mapType(func->returnType);
llvm::FunctionType *FTy = FunctionType::get(RetTy, argTypes,
FunctionType *FTy = FunctionType::get(RetTy, argTypes,
false);
Functions[j] = Function::Create(FTy, Function::InternalLinkage,
BytecodeID+"f"+Twine(j), M);
@ -461,7 +461,7 @@ public:
DEBUG(M->dump());
delete [] TypeMap;
llvm::FunctionType *Callable = FunctionType::get(Type::getInt32Ty(Context),false);
FunctionType *Callable = FunctionType::get(Type::getInt32Ty(Context),false);
for (unsigned j=0;j<bc->num_func;j++) {
const struct cli_bc_func *func = &bc->funcs[j];
PrettyStackTraceString CrashInfo2("Native machine codegen");

@ -29,10 +29,10 @@ static uint16_t cli_tmp2[]={70};
static uint16_t cli_tmp3[]={32, 32, 32};
const struct cli_bc_type cli_apicall_types[]={
{FunctionType, cli_tmp0, 3},
{PointerType, cli_tmp1, 1},
{StructType, cli_tmp2, 1},
{FunctionType, cli_tmp3, 3}
{DFunctionType, cli_tmp0, 3},
{DPointerType, cli_tmp1, 1},
{DStructType, cli_tmp2, 1},
{DFunctionType, cli_tmp3, 3}
};
const unsigned cli_apicall_maxtypes=sizeof(cli_apicall_types)/sizeof(cli_apicall_types[0]);

@ -23,11 +23,11 @@
#define TYPE_DESC_H
enum derived_t {
FunctionType,
PointerType,
StructType,
PackedStructType,
ArrayType
DFunctionType,
DPointerType,
DStructType,
DPackedStructType,
DArrayType
};
struct cli_bc_type {

Loading…
Cancel
Save