Browse files

Initial work to enable compiling with clang

  • Loading branch information...
1 parent c60543d commit 6f92669cda2fb8a1d3875eb2816496fb4fbb9ccd @dbussink dbussink committed May 22, 2010
View
2 vm/builtin/autoload.hpp
@@ -5,7 +5,7 @@
#include "type_info.hpp"
namespace rubinius {
- class CallFrame;
+ struct CallFrame;
class Autoload : public Object {
public:
View
2 vm/builtin/block_as_method.hpp
@@ -1,7 +1,7 @@
#include "builtin/executable.hpp"
namespace rubinius {
- class CallFrame;
+ struct CallFrame;
class Dispatch;
class Arguments;
class BlockEnvironment;
View
2 vm/builtin/block_environment.hpp
@@ -8,7 +8,7 @@
namespace rubinius {
class CompiledMethod;
class VariableScope;
- class CallFrame;
+ struct CallFrame;
class Message;
class VMMethod;
class VMExecutable;
View
2 vm/builtin/bytearray.hpp
@@ -16,7 +16,7 @@ namespace rubinius {
native_int full_size_;
// Body access
- uint8_t bytes[];
+ uint8_t bytes[0];
public:
static void init(STATE);
View
2 vm/builtin/system.hpp
@@ -15,7 +15,7 @@ namespace rubinius {
class CompiledMethod;
class StaticScope;
- class CallFrame;
+ struct CallFrame;
/**
* VM primitives etc.
View
2 vm/builtin/thunk.hpp
@@ -1,7 +1,7 @@
#include "builtin/executable.hpp"
namespace rubinius {
- class CallFrame;
+ struct CallFrame;
class Dispatch;
class Arguments;
class BlockEnvironment;
View
2 vm/builtin/tuple.hpp
@@ -16,7 +16,7 @@ namespace rubinius {
int full_size_;
/* Body access */
- Object* field[];
+ Object* field[0];
public:
uint32_t num_fields() const {
View
2 vm/builtin/variable_scope.hpp
@@ -10,7 +10,7 @@ namespace rubinius {
class CompiledMethod;
class Module;
- class CallFrame;
+ struct CallFrame;
/**
* Variable information.
View
2 vm/call_frame_list.hpp
@@ -5,7 +5,7 @@
#include <list>
namespace rubinius {
- class CallFrame;
+ struct CallFrame;
typedef PointerList<CallFrame> CallFrameList;
typedef std::list<CallFrame**> CallFrameLocationList;
View
4 vm/dispatch.hpp
@@ -7,9 +7,9 @@ namespace rubinius {
class Symbol;
class Module;
class Executable;
- class CallFrame;
+ struct CallFrame;
class Arguments;
- class LookupData;
+ struct LookupData;
class Dispatch {
public:
View
4 vm/exception.cpp
@@ -49,9 +49,10 @@ namespace rubinius {
static VMException::Backtrace get_trace(size_t skip, size_t max_depth=100) {
#ifdef USE_EXECINFO
size_t stack_depth;
- void *stack_addrs[max_depth];
char **stack_strings;
+ void **stack_addrs = (void **) calloc(max_depth, sizeof(void*));
+
stack_depth = backtrace(stack_addrs, max_depth);
stack_strings = backtrace_symbols(stack_addrs, stack_depth);
@@ -61,6 +62,7 @@ namespace rubinius {
s.push_back(std::string(stack_strings[i]));
}
free(stack_strings); // malloc()ed by backtrace_symbols
+ free(stack_addrs);
#else
VMException::Backtrace s;
s.push_back(std::string("C++ backtrace not available"));
View
2 vm/executor.hpp
@@ -5,7 +5,7 @@ namespace rubinius {
class VM;
class Dispatch;
class Arguments;
- class CallFrame;
+ struct CallFrame;
class Object;
enum ExecuteStatus {
View
2 vm/gc/baker.hpp
@@ -23,7 +23,7 @@ namespace rubinius {
class ObjectMemory;
class GCData;
- class YoungCollectStats;
+ struct YoungCollectStats;
class BakerGC : public GarbageCollector {
Heap eden;
View
2 vm/gc/gc.hpp
@@ -7,7 +7,7 @@
namespace rubinius {
class ObjectMemory;
- class CallFrame;
+ struct CallFrame;
class VariableScope;
class GlobalCache;
class StackVariables;
View
8 vm/gc/marksweep.cpp
@@ -197,16 +197,16 @@ namespace rubinius {
Object* obj = *i;
Class* cls = obj->class_object(object_memory_->state);
- std::map<Class*,PerClass>::iterator i = stats.find(cls);
- if(i == stats.end()) {
+ std::map<Class*,PerClass>::iterator j = stats.find(cls);
+ if(j == stats.end()) {
PerClass pc;
pc.objects++;
pc.bytes += obj->size_in_bytes(object_memory_->state);
stats[cls] = pc;
} else {
- i->second.objects++;
- i->second.bytes += obj->size_in_bytes(object_memory_->state);
+ j->second.objects++;
+ j->second.bytes += obj->size_in_bytes(object_memory_->state);
}
}
View
2 vm/gc/marksweep.hpp
@@ -21,7 +21,7 @@ namespace rubinius {
/* Forwards */
class Object;
class ObjectMemory;
- class CallFrame;
+ struct CallFrame;
class MarkSweepGC : public GarbageCollector {
public:
View
2 vm/global_cache.hpp
@@ -11,7 +11,7 @@ namespace rubinius {
#define CPU_CACHE_MASK 0xfff
#define CPU_CACHE_HASH(c,m) ((((uintptr_t)(c)>>3)^((uintptr_t)m)) & CPU_CACHE_MASK)
- class LookupData;
+ struct LookupData;
class Dispatch;
class GlobalCache {
View
2 vm/helpers.hpp
@@ -2,7 +2,7 @@
#define RBX_HELPERS_HPP
namespace rubinius {
- class CallFrame;
+ struct CallFrame;
class Module;
class Class;
class Symbol;
View
2 vm/inline_cache.hpp
@@ -14,7 +14,7 @@
namespace rubinius {
class InlineCache;
- class CallFrame;
+ struct CallFrame;
class Arguments;
// How many receiver class have been seen to keep track of inside an IC
View
8 vm/instruments/profiler.cpp
@@ -122,9 +122,9 @@ namespace rubinius {
Edge* edge = i->second;
Fixnum* key = edge->find_key(keys);
- size_t i;
- for(i = 0; i < edges->size(); i++) {
- Array* ary = try_as<Array>(edges->get(state, i));
+ size_t j;
+ for(j = 0; j < edges->size(); j++) {
+ Array* ary = try_as<Array>(edges->get(state, j));
if(!ary) continue;
Fixnum* fix = try_as<Fixnum>(ary->get(state, 0));
@@ -150,7 +150,7 @@ namespace rubinius {
}
// We did not find an existing entry to update, create a new one
- if(i == edges->size()) {
+ if(j == edges->size()) {
Array* ary = Array::create(state, 3);
edges->append(state, ary);
View
3 vm/llvm/jit_runtime.hpp
@@ -24,11 +24,12 @@ namespace rubinius {
namespace jit {
class RuntimeData {
+
+ public:
CompiledMethod* method_;
Symbol* name_;
Module* module_;
- public:
RuntimeData(CompiledMethod* method, Symbol* name, Module* mod)
: method_(method)
, name_(name)
View
2 vm/objectmemory.hpp
@@ -41,7 +41,7 @@ namespace rubinius {
*
*/
- class CallFrame;
+ struct CallFrame;
class GCData;
class Configuration;
class BakerGC;
View
2 vm/oop.hpp
@@ -238,7 +238,7 @@ const int cUndef = 0x22L;
private:
// Defined so ObjectHeader can easily access the data just beyond
// it.
- void* __body__[];
+ void* __body__[0];
public:
View
2 vm/signal.cpp
@@ -8,7 +8,7 @@
#include <sys/select.h>
namespace rubinius {
- class CallFrame;
+ struct CallFrame;
static SignalHandler* handler_ = 0;
View
2 vm/signal.hpp
@@ -7,7 +7,7 @@
namespace rubinius {
class VM;
- class CallFrame;
+ struct CallFrame;
class SignalHandler {
VM* vm_;
View
2 vm/stack_variables.hpp
@@ -14,7 +14,7 @@ namespace rubinius {
Object* block_;
Module* module_;
Object* last_match_;
- Object* locals_[];
+ Object* locals_[0];
public:
void initialize(Object* self, Object* block, Module* module, int locals) {
View
4 vm/vm.hpp
@@ -54,10 +54,10 @@ namespace rubinius {
class ConfigParser;
class TypeError;
class Assertion;
- class CallFrame;
+ struct CallFrame;
class Object;
class Configuration;
- class Interrupts;
+ struct Interrupts;
class VMManager;
class Waiter;
class LookupTable;

0 comments on commit 6f92669

Please sign in to comment.