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
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 += -I$(DEPS_DIR)/pypa-install/include
COMMON_CXXFLAGS += -Wno-inconsistent-missing-override
ifeq ($(ENABLE_VALGRIND),0)
COMMON_CXXFLAGS += -DNVALGRIND
......
......@@ -151,8 +151,12 @@ public:
code = I->getSection(section);
assert(!code);
bool is_text;
#if LLVMREV < 219314
code = section->isText(is_text);
assert(!code);
#else
is_text = section->isText();
#endif
if (!is_text)
continue;
......
......@@ -172,8 +172,13 @@ public:
}
// 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();
#else
f->materialize();
#endif
}
// It could still be a declaration, though I think the code won't generate this case any more:
if (f->isDeclaration())
......
......@@ -29,7 +29,7 @@
namespace pyston {
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 {
......@@ -79,7 +79,7 @@ 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);
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,
.length = patchpointSize(),
.type = frame_var.type,
......
......@@ -180,9 +180,13 @@ void StackmapJITEventListener::NotifyObjectEmitted(const llvm::ObjectImage& Obj)
llvm::object::section_iterator section(Obj.end_sections());
code = I->getSection(section);
assert(!code);
#if LLVMREV < 219314
code = section->getSize(stackmap_size);
assert(stackmap_size > 0);
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);
#endif
......
......@@ -152,8 +152,8 @@ public:
// Currently-unused libunwind support:
llvm_error_code code;
bool found_text = false, found_eh_frame = false;
uint64_t text_addr, text_size;
uint64_t eh_frame_addr, eh_frame_size;
uint64_t text_addr = -1, text_size = -1;
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) {
llvm::StringRef name;
......@@ -163,20 +163,30 @@ public:
uint64_t addr, size;
if (name == ".eh_frame") {
assert(!found_eh_frame);
#if LLVMREV < 219314
if (I->getAddress(eh_frame_addr))
continue;
if (I->getSize(eh_frame_size))
continue;
#else
eh_frame_addr = I->getAddress();
eh_frame_size = I->getSize();
#endif
if (VERBOSITY())
printf("eh_frame: %lx %lx\n", eh_frame_addr, eh_frame_size);
found_eh_frame = true;
} else if (name == ".text") {
assert(!found_text);
#if LLVMREV < 219314
if (I->getAddress(text_addr))
continue;
if (I->getSize(text_size))
continue;
#else
text_addr = I->getAddress();
text_size = I->getSize();
#endif
if (VERBOSITY())
printf("text: %lx %lx\n", text_addr, text_size);
......
......@@ -159,7 +159,7 @@ private:
}
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:
......
......@@ -283,7 +283,7 @@ intptr_t start_thread(void* (*start_func)(Box*, Box*, Box*), Box* arg1, Box* arg
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;
int code = pthread_create(&thread_id, NULL, &_thread_start, args);
......
......@@ -129,7 +129,7 @@ bool updateTBAA(Function* f) {
LLVMContext &c = f->getContext();
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)
continue;
//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