diff --git a/llvm/_core.c b/llvm/_core.c index 52c6199..1cbd2cb 100644 --- a/llvm/_core.c +++ b/llvm/_core.c @@ -538,6 +538,7 @@ _wrap_obj2obj(LLVMGetParamParent, LLVMValueRef, LLVMValueRef) _wrap_objenum2none(LLVMAddAttribute, LLVMValueRef, LLVMAttribute) _wrap_objenum2none(LLVMRemoveAttribute, LLVMValueRef, LLVMAttribute) _wrap_objenum2none(LLVMSetParamAlignment, LLVMValueRef, LLVMAttribute) +_wrap_obj2obj(LLVMGetParamAlignment, LLVMValueRef, int) /*===-- Basic Blocks -----------------------------------------------------===*/ @@ -1401,6 +1402,7 @@ static PyMethodDef core_methods[] = { _method( LLVMAddAttribute ) _method( LLVMRemoveAttribute ) _method( LLVMSetParamAlignment ) + _method( LLVMGetParamAlignment ) /* Basic Blocks */ _method( LLVMGetBasicBlockParent ) diff --git a/llvm/extra.cpp b/llvm/extra.cpp index edf3456..492b2ab 100644 --- a/llvm/extra.cpp +++ b/llvm/extra.cpp @@ -463,6 +463,15 @@ int LLVMInlineFunction(LLVMValueRef call) return llvm::InlineFunction(cs, unused); } +unsigned LLVMGetParamAlignment(LLVMValueRef arg) +{ + llvm::Argument *argp = llvm::unwrap(arg); + assert(argp); + + unsigned argno = argp->getArgNo(); + + return argp->getParent()->getParamAlignment(argno + 1); +} /* Passes. A few passes (listed below) are used directly from LLVM-C, * rest are defined here. diff --git a/llvm/extra.h b/llvm/extra.h index 8ec9b89..b34a043 100644 --- a/llvm/extra.h +++ b/llvm/extra.h @@ -183,6 +183,10 @@ void *LLVMGetPointerToFunction(LLVMExecutionEngineRef ee, LLVMValueRef fn); * containing the call is still in a proper state (not changed). */ int LLVMInlineFunction(LLVMValueRef call); +/* Wraps llvm::getAlignmentFromAttrs from Attributes.h. Compliments the + * already available LLVMSetParamAlignment(). */ +unsigned LLVMGetParamAlignment(LLVMValueRef arg); + /* Passes. Some passes are used directly from LLVM-C, rest are declared * here. */ diff --git a/www/src/contribute.txt b/www/src/contribute.txt index 7116850..9937b6f 100644 --- a/www/src/contribute.txt +++ b/www/src/contribute.txt @@ -12,9 +12,9 @@ You can make a difference, just by: Useful links: -- Google code hosting: http://code.google.com/p/llvm-py/[http://code.google.com/p/llvm-py/] - Browse SVN: http://code.google.com/p/llvm-py/source/browse/[http://code.google.com/p/llvm-py/source/browse] - Issues tracker: http://code.google.com/p/llvm-py/issues/list[http://code.google.com/p/llvm-py/issues/list] +- Discussions: http://groups.google.com/group/llvm-py[http://groups.google.com/group/llvm-py] SVN HEAD can be checked out like so: diff --git a/www/src/download.txt b/www/src/download.txt index 34c5fb4..57dbf7e 100644 --- a/www/src/download.txt +++ b/www/src/download.txt @@ -5,6 +5,7 @@ The latest release is 0.6, released 31-Aug-2010 (link:#changelog[Changelog] below). 0.6 works only with LLVM 2.7. Download it here: + * http://llvm-py.googlecode.com/files/llvm-py-0.6.tar.bz2[llvm-py-0.6.tar.bz2] (primary) * link:llvm-py-0.6.tar.bz2[llvm-py-0.6.tar.bz2] (mirror)