changes to work with llvm 3.2 #2045

Merged
merged 1 commit into from Nov 24, 2012

Conversation

Projects
None yet
5 participants
Contributor

Gibheer commented Nov 21, 2012

As the new llvm version will be released in the next time, I thought I try to get rubinius working with llvm 3.2. These are the changes needed to make it work.

This is not final yet and needs some work to be backwards compatible, but it is something to work on.

@brixen brixen and 1 other commented on an outdated diff Nov 21, 2012

vm/llvm/state.cpp
@@ -28,7 +28,8 @@
#include "configuration.hpp"
#include "instruments/timing.hpp"
-#include <llvm/Target/TargetData.h>
+//#include <llvm/Target/TargetData.h>
@brixen

brixen Nov 21, 2012

Owner

Can this be removed?

@Gibheer

Gibheer Nov 21, 2012

Contributor

Yeah, it can. Thank you.

Member

hosiawak commented Nov 21, 2012

I'm wondering if these if/else are needed. Can we just remove passing true regardless of LLVM version ?

I checked LLVM 2.8 and 3.0 source and both versions have the following method signatures:

include/llvm/Function.h: void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
include/llvm/Instructions.h: void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
include/llvm/Instructions.h: void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
include/llvm/Support/CallSite.h: void setOnlyReadsMemory(bool onlyReadsMemory = true) {

Contributor

Gibheer commented Nov 21, 2012

Ah, did not know that. I can change it that way and see, if it compiles. Thanks for looking at that :D

@dbussink dbussink commented on an outdated diff Nov 21, 2012

vm/llvm/state.hpp
function(name)->setDoesNotCapture(which, true);
+#else
+ function(name)->setDoesNotCapture(which);
@dbussink

dbussink Nov 21, 2012

Owner

Looks like this could be simplified too, looking at the header:

vendor/llvm/include/llvm/Function.h:  void setDoesNotCapture(unsigned n, bool DoesNotCapture = true) {
Contributor

Gibheer commented Nov 21, 2012

Fixed the state.hpp too. Must have been lost in that crazy day.

ttilley commented Nov 22, 2012

In file included from vm/builtin/block_environment.cpp:37:
vm/llvm/state.hpp:12:10: fatal error: 'llvm/Support/IRBuilder.h' file not found
#include <llvm/Support/IRBuilder.h>

This appears to have been moved to llvm/IRBuilder.h

ttilley commented Nov 22, 2012

vm/llvm/autotypes.cpp:3:10: fatal error: 'llvm/Target/TargetData.h' file not found
#include <llvm/Target/TargetData.h>
Contributor

Gibheer commented Nov 22, 2012

How did you get these messages? I would like to reproduce them.

Contributor

Gibheer commented Nov 22, 2012

Okay, found out, why it did not raise an error for me. I had llvm 3.1 on my system and somehow all the stuff got included from there.

Owner

dbussink commented Nov 23, 2012

A general comment, it's probably best that we follow one style for using RBX_LLVM_API_VER in ifdefs. Right now we use #if RBX_LLVM_API_VER >= 302 style in most places.

I suggest these changes also follow this pattern. Also always use >= and not ==, since I don't think they will revert this in a future version :).

Contributor

Gibheer commented Nov 23, 2012

Ah, yes. I change that directly and upload it, so that it gets ready.

Contributor

Gibheer commented Nov 23, 2012

Okay, corrected it and ran it again with llvm 3.0 and 3.2 and it looks good.

Owner

dbussink commented Nov 23, 2012

Ok, looks good. Could you perhaps squash them into a nice single commit?

Contributor

Gibheer commented Nov 24, 2012

Finally everything is there and looks good. Sorry for the inconvenience and thank you all for your help :D

dbussink merged commit 192e1af into rubinius:master Nov 24, 2012

1 check failed

default The Travis build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment