Commit 8497cc62 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Rebase to llvm trunk

parent 62dc79a2
...@@ -138,6 +138,7 @@ COMMON_CXXFLAGS += -fexceptions -fno-rtti ...@@ -138,6 +138,7 @@ COMMON_CXXFLAGS += -fexceptions -fno-rtti
COMMON_CXXFLAGS += -Wno-invalid-offsetof # allow the use of "offsetof", and we'll just have to make sure to only use it legally. COMMON_CXXFLAGS += -Wno-invalid-offsetof # allow the use of "offsetof", and we'll just have to make sure to only use it legally.
COMMON_CXXFLAGS += -DENABLE_INTEL_JIT_EVENTS=$(ENABLE_INTEL_JIT_EVENTS) COMMON_CXXFLAGS += -DENABLE_INTEL_JIT_EVENTS=$(ENABLE_INTEL_JIT_EVENTS)
COMMON_CXXFLAGS += -I$(DEPS_DIR)/pypa-install/include COMMON_CXXFLAGS += -I$(DEPS_DIR)/pypa-install/include
COMMON_CXXFLAGS += -Wno-inconsistent-missing-override
ifeq ($(ENABLE_VALGRIND),0) ifeq ($(ENABLE_VALGRIND),0)
COMMON_CXXFLAGS += -DNVALGRIND COMMON_CXXFLAGS += -DNVALGRIND
......
...@@ -151,8 +151,12 @@ public: ...@@ -151,8 +151,12 @@ public:
code = I->getSection(section); code = I->getSection(section);
assert(!code); assert(!code);
bool is_text; bool is_text;
#if LLVMREV < 219314
code = section->isText(is_text); code = section->isText(is_text);
assert(!code); assert(!code);
#else
is_text = section->isText();
#endif
if (!is_text) if (!is_text)
continue; continue;
......
...@@ -172,8 +172,13 @@ public: ...@@ -172,8 +172,13 @@ public:
} }
// We load the bitcode lazily, so check if we haven't yet fully loaded the function: // We load the bitcode lazily, so check if we haven't yet fully loaded the function:
if (f->isMaterializable()) if (f->isMaterializable()) {
#if LLVMREV < 220600
f->Materialize(); f->Materialize();
#else
f->materialize();
#endif
}
// It could still be a declaration, though I think the code won't generate this case any more: // It could still be a declaration, though I think the code won't generate this case any more:
if (f->isDeclaration()) if (f->isDeclaration())
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
namespace pyston { namespace pyston {
void PatchpointInfo::addFrameVar(const std::string& name, CompilerType* type) { void PatchpointInfo::addFrameVar(const std::string& name, CompilerType* type) {
frame_vars.push_back(FrameVarInfo({ .name = name, .type = type })); frame_vars.push_back(FrameVarInfo({.name = name, .type = type }));
} }
int ICSetupInfo::totalSize() const { int ICSetupInfo::totalSize() const {
...@@ -79,11 +79,11 @@ void PatchpointInfo::parseLocationMap(StackMap::Record* r, LocationMap* map) { ...@@ -79,11 +79,11 @@ void PatchpointInfo::parseLocationMap(StackMap::Record* r, LocationMap* map) {
// printf("%s %d %d\n", frame_var.name.c_str(), r->locations[cur_arg].type, r->locations[cur_arg].regnum); // printf("%s %d %d\n", frame_var.name.c_str(), r->locations[cur_arg].type, r->locations[cur_arg].regnum);
map->names[frame_var.name].locations.push_back( map->names[frame_var.name].locations.push_back(
LocationMap::LocationTable::LocationEntry({ ._debug_pp_id = (uint64_t) this, LocationMap::LocationTable::LocationEntry({._debug_pp_id = (uint64_t) this,
.offset = r->offset, .offset = r->offset,
.length = patchpointSize(), .length = patchpointSize(),
.type = frame_var.type, .type = frame_var.type,
.locations = std::move(locations) })); .locations = std::move(locations) }));
cur_arg += num_args; cur_arg += num_args;
} }
......
...@@ -180,9 +180,13 @@ void StackmapJITEventListener::NotifyObjectEmitted(const llvm::ObjectImage& Obj) ...@@ -180,9 +180,13 @@ void StackmapJITEventListener::NotifyObjectEmitted(const llvm::ObjectImage& Obj)
llvm::object::section_iterator section(Obj.end_sections()); llvm::object::section_iterator section(Obj.end_sections());
code = I->getSection(section); code = I->getSection(section);
assert(!code); assert(!code);
#if LLVMREV < 219314
code = section->getSize(stackmap_size); code = section->getSize(stackmap_size);
assert(stackmap_size > 0);
assert(!code); assert(!code);
#else
stackmap_size = section->getSize();
#endif
assert(stackmap_size > 0);
ASSERT(ptr.i8 - start_ptr == stackmap_size, "%ld %ld", ptr.i8 - start_ptr, stackmap_size); ASSERT(ptr.i8 - start_ptr == stackmap_size, "%ld %ld", ptr.i8 - start_ptr, stackmap_size);
#endif #endif
......
...@@ -152,8 +152,8 @@ public: ...@@ -152,8 +152,8 @@ public:
// Currently-unused libunwind support: // Currently-unused libunwind support:
llvm_error_code code; llvm_error_code code;
bool found_text = false, found_eh_frame = false; bool found_text = false, found_eh_frame = false;
uint64_t text_addr, text_size; uint64_t text_addr = -1, text_size = -1;
uint64_t eh_frame_addr, eh_frame_size; uint64_t eh_frame_addr = -1, eh_frame_size = -1;
for (llvm::object::section_iterator I = Obj.begin_sections(), E = Obj.end_sections(); I != E; ++I) { for (llvm::object::section_iterator I = Obj.begin_sections(), E = Obj.end_sections(); I != E; ++I) {
llvm::StringRef name; llvm::StringRef name;
...@@ -163,20 +163,30 @@ public: ...@@ -163,20 +163,30 @@ public:
uint64_t addr, size; uint64_t addr, size;
if (name == ".eh_frame") { if (name == ".eh_frame") {
assert(!found_eh_frame); assert(!found_eh_frame);
#if LLVMREV < 219314
if (I->getAddress(eh_frame_addr)) if (I->getAddress(eh_frame_addr))
continue; continue;
if (I->getSize(eh_frame_size)) if (I->getSize(eh_frame_size))
continue; continue;
#else
eh_frame_addr = I->getAddress();
eh_frame_size = I->getSize();
#endif
if (VERBOSITY()) if (VERBOSITY())
printf("eh_frame: %lx %lx\n", eh_frame_addr, eh_frame_size); printf("eh_frame: %lx %lx\n", eh_frame_addr, eh_frame_size);
found_eh_frame = true; found_eh_frame = true;
} else if (name == ".text") { } else if (name == ".text") {
assert(!found_text); assert(!found_text);
#if LLVMREV < 219314
if (I->getAddress(text_addr)) if (I->getAddress(text_addr))
continue; continue;
if (I->getSize(text_size)) if (I->getSize(text_size))
continue; continue;
#else
text_addr = I->getAddress();
text_size = I->getSize();
#endif
if (VERBOSITY()) if (VERBOSITY())
printf("text: %lx %lx\n", text_addr, text_size); printf("text: %lx %lx\n", text_addr, text_size);
......
...@@ -159,7 +159,7 @@ private: ...@@ -159,7 +159,7 @@ private:
} }
template <int... S> Storage* make(impl::seq<S...>) { template <int... S> Storage* make(impl::seq<S...>) {
return new Storage{ .self = this, .val = T(std::get<S>(ctor_args)...) }; return new Storage{.self = this, .val = T(std::get<S>(ctor_args)...) };
} }
public: public:
......
...@@ -283,7 +283,7 @@ intptr_t start_thread(void* (*start_func)(Box*, Box*, Box*), Box* arg1, Box* arg ...@@ -283,7 +283,7 @@ intptr_t start_thread(void* (*start_func)(Box*, Box*, Box*), Box* arg1, Box* arg
num_starting_threads++; num_starting_threads++;
} }
ThreadStartArgs* args = new ThreadStartArgs({ .start_func = start_func, .arg1 = arg1, .arg2 = arg2, .arg3 = arg3 }); ThreadStartArgs* args = new ThreadStartArgs({.start_func = start_func, .arg1 = arg1, .arg2 = arg2, .arg3 = arg3 });
pthread_t thread_id; pthread_t thread_id;
int code = pthread_create(&thread_id, NULL, &_thread_start, args); int code = pthread_create(&thread_id, NULL, &_thread_start, args);
......
...@@ -129,7 +129,7 @@ bool updateTBAA(Function* f) { ...@@ -129,7 +129,7 @@ bool updateTBAA(Function* f) {
LLVMContext &c = f->getContext(); LLVMContext &c = f->getContext();
for (auto it = inst_begin(f), end = inst_end(f); it != end; ++it) { for (auto it = inst_begin(f), end = inst_end(f); it != end; ++it) {
MDNode *tbaa = it->getMetadata(LLVMContext::MD_tbaa); MDNode *tbaa = it->getMDNode(LLVMContext::MD_tbaa);
if (!tbaa) if (!tbaa)
continue; continue;
//tbaa->dump(); //tbaa->dump();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment