Displaying 20 results from an estimated 68 matches for "llvmvalueref".
2009 Oct 07
0
[LLVMdev] Some additions to the C bindings
On Tue, Oct 6, 2009 at 2:13 PM, Kenneth Uildriks <kennethuil at gmail.com> wrote:
> My front-end is sync'd with the trunk now, and working well, but it
> required some additional functions exposed in the C bindings. I
> hereby submit them for review and approval for inclusion in the trunk.
>
LLVMGetAttribute had a bug in it. Here's the revised version of the patch
2009 Oct 06
3
[LLVMdev] Some additions to the C bindings
My front-end is sync'd with the trunk now, and working well, but it
required some additional functions exposed in the C bindings. I
hereby submit them for review and approval for inclusion in the trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cbindings.patch
Type: application/octet-stream
Size: 7269 bytes
Desc: not available
URL:
2009 Oct 08
2
[LLVMdev] Some additions to the C bindings
...;t say that I'm the best reviewer, but I've been doing some
work with the c bindings recently so hopefully I have some idea of
what I'm talking about :) Comments are inlined:
+/** See the llvm::Use class. */
+typedef struct LLVMOpaqueUse *LLVMUseRef;
+
...
+void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal);
...
+/* Operations on Uses */
+LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val);
+LLVMUseRef LLVMGetNextUse(LLVMUseRef U);
+LLVMValueRef LLVMGetUser(LLVMUseRef U);
+LLVMValueRef LLVMGetUsedValue(LLVMUseRef U);
These seem okay to me, but I don't have too much experien...
2008 Apr 26
2
[LLVMdev] ParamAttr Patch - Alignment fix
...69,8 @@
> > typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
> > typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
> >
> > +typedef struct LLVMOpaqueParamAttrs *LLVMParamAttrs;
>
> Please delete this, as it is unused.
>
> > +void LLVMInstrAddParamAttr(LLVMValueRef, unsigned index,
> > LLVMParamAttr);
> > +void LLVMInstrSetAlignment(LLVMValueRef, unsigned index, unsigned
> > align);
> > +void LLVMInstrRemoveParamAttr(LLVMValueRef, unsigned index,
> > LLVMParamAttr);
> > +void LLVMAddParamAttr(LLVMValueRef, LLVMParamAttr);
&...
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
...icBlockRef;
> typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
>
> +
> /* Used to provide a module to JIT or interpreter.
> * See the llvm::ModuleProvider class.
> */
? :)
> @@ -441,6 +459,9 @@
> /* Operations on call sites */
> void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
> unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
> +void LLVMInstrAddParamAttr(LLVMValueRef Instr, unsigned index,
> LLVMParamAttr);
> +void LLVMInstrRemoveParamAttr(LLVMValueRef Instr, unsigned index,
> LLVMParamAttr);
> +void LLVMSetInstrParam...
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
.../Core.h (working copy)
> @@ -69,6 +69,8 @@
> typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef;
> typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
>
> +typedef struct LLVMOpaqueParamAttrs *LLVMParamAttrs;
Please delete this, as it is unused.
> +void LLVMInstrAddParamAttr(LLVMValueRef, unsigned index,
> LLVMParamAttr);
> +void LLVMInstrSetAlignment(LLVMValueRef, unsigned index, unsigned
> align);
> +void LLVMInstrRemoveParamAttr(LLVMValueRef, unsigned index,
> LLVMParamAttr);
> +void LLVMAddParamAttr(LLVMValueRef, LLVMParamAttr);
> +void LLVMRemovePara...
2008 Apr 24
2
[LLVMdev] ParamAttr Patch - Alignment fix
Hi..
Updated so you now set alignment through LLVMInstrSetAlignment.
Anders Johnsen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParamAttr.patch
Type: text/x-diff
Size: 7420 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080424/cb72b4bb/attachment.patch>
2012 Apr 25
2
[LLVMdev] Crash in JIT
...- is needed? What is correct?
LLVMSetTarget(module, "i686-apple-darwin11");
LLVMTypeRef int32 = LLVMInt32TypeInContext(llvm);
LLVMTypeRef funcType;
LLVMTypeRef threeInts[] = {int32, int32, int32};
funcType = LLVMFunctionType(int32, threeInts, 3, 0);
LLVMValueRef func;
func = LLVMAddFunction(module, "functionName", funcType);
LLVMValueRef mParam = LLVMGetParam(func, 0);
LLVMSetValueName(mParam, "m");
LLVMValueRef xParam = LLVMGetParam(func, 1);
LLVMSetValueName(xParam, "x");
LLVMValueRef bPara...
2009 Oct 08
0
[LLVMdev] Some additions to the C bindings
...he generated code that
creates all of the "regular" functions. Generated code has a much
easier time calling the C bindings than the C++ API.
>
>
> +/** See the llvm::Use class. */
> +typedef struct LLVMOpaqueUse *LLVMUseRef;
> +
> ...
> +void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal);
> ...
> +/* Operations on Uses */
> +LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val);
> +LLVMUseRef LLVMGetNextUse(LLVMUseRef U);
> +LLVMValueRef LLVMGetUser(LLVMUseRef U);
> +LLVMValueRef LLVMGetUsedValue(LLVMUseRef U);
>
>
> These seem okay to...
2008 Apr 26
2
[LLVMdev] ParamAttr Patch - Alignment fix
...rRef;
> >
> > +
> >
> > /* Used to provide a module to JIT or interpreter.
> > * See the llvm::ModuleProvider class.
> > */
>
> ? :)
>
> > @@ -441,6 +459,9 @@
> > /* Operations on call sites */
> > void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
> > unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
> > +void LLVMInstrAddParamAttr(LLVMValueRef Instr, unsigned index,
> > LLVMParamAttr);
> > +void LLVMInstrRemoveParamAttr(LLVMValueRef Instr, unsigned index,
> > LLVMParamAttr);
> &g...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...;); <-- is needed? What is correct?
LLVMSetTarget(module, "i686-apple-darwin11");
LLVMTypeRef int32 = LLVMInt32TypeInContext(llvm);
LLVMTypeRef funcType;
LLVMTypeRef threeInts[] = {int32, int32, int32};
funcType = LLVMFunctionType(int32, threeInts, 3, 0);
LLVMValueRef func;
func = LLVMAddFunction(module, "functionName", funcType);
LLVMValueRef mParam = LLVMGetParam(func, 0);
LLVMSetValueName(mParam, "m");
LLVMValueRef xParam = LLVMGetParam(func, 1);
LLVMSetValueName(xParam, "x");
LLVMValueRef bParam = LL...
2009 Jul 10
1
[LLVMdev] fix for typo in llvm-c/Core.h
...eter O'Gorman
http://pogma.com
Index: include/llvm-c/Core.h
===================================================================
--- include/llvm-c/Core.h (revision 75249)
+++ include/llvm-c/Core.h (working copy)
@@ -853,7 +853,7 @@
template<typename T>
inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
#if DEBUG
- for (LLVMValueRef *I = Vals, E = Vals + Length; I != E; ++I)
+ for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I)
cast<T>(*I);
#endif
return reinterpret_cast<T**>(Vals);
2009 Dec 29
1
[LLVMdev] LLVM{Add,Remove}FunctionAttr totally broken
...(And if the above functions are
fixed, there would also be no way to set return value attributes).
I'd like to propose that LLVM{Add,Remove}FunctionAttr be fixed to
actually set the function attributes. And that a new API, LLVM
{Add,Remove,Get}RetAttr be added, like:
void LLVMAddRetAttr(LLVMValueRef Fn, LLVMAttribute PA);
void LLVMRemoveRetAttr(LLVMValueRef Fn, LLVMAttribute PA);
LLVMAttribute LLVMGetRetAttr(LLVMValueRef Fn);
which will do the associated actions on the return value.
If this is acceptable, I can submit a trivial patch that implements it.
James
PS: no comments on my last pat...
2012 Sep 27
0
[LLVMdev] Possible bug or misunderstanding of feature LLVMConstIntOfString
Hi All
I am a novice LLVM user trying to use LLVMConstIntOfString using the c api
to get a integer of arbitrary size from a hexadecimal string.
Example code follows:
LLVMContextRef context = LLVMContextCreate();
LLVMValueRef value =
LLVMConstIntOfString(LLVMInt64TypeInContext(context), "0x0000000f0000ffff",
16);
This is working properly as expected.
However I have noticed that if the bits are not prefixed with enough zeros
to correspond to 32 or 64 bits this gives me:
For 0x0fff := 0xffffffff0fff (incorrect...
2009 Oct 11
3
[LLVMdev] Some additions to the C bindings
...e llvm::Use class. */
+typedef struct LLVMOpaqueUse *LLVMUseRef;
My understanding is that this actually conceptually corresponds to
use_iterator, not Use. Please name this something like
LLVMUseIterator. Also, please document this, not just referring to
llvm::Use.
+int LLVMHasInitializer(LLVMValueRef GlobalVar);
LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
Isn't LLVMHasInitializer just LLVMGetInitializer(x) != 0?
Otherwise, looks ok to me,
-Chris
2013 Sep 30
1
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
Attached is what I got thus far.
What I'm struggling with is proper integration in build system. What
is in there is just wild guesses from my side, both on autoconf and
cmake variants. It would be great if someone with proper knowledge of
the buildsystems could have a look. Also I'm not sure how to properly
handle compilation on msvc - clearly "-std=c11 -Wstrict-prototypes" is
2010 Aug 12
3
[LLVMdev] LLVM-C: Calling functions contained in other libraries
...SFullUserName()
define i8* @MyFunction() {
entrypoint:
%myCall = call i8* @NSFullUserName() ; <i8*> [#uses=1]
ret i8* %myCall
}
Where am I going wrong here?
To add some code to my previous question:
LLVMTypeRef i8Ptr(void) {
return LLVMPointerType(LLVMInt8Type(), 0);
}
LLVMValueRef d(LLVMModuleRef module) {
LLVMValueRef result;
LLVMBasicBlockRef block;
LLVMBuilderRef builder = LLVMCreateBuilder();
LLVMValueRef fullUsername = LLVMAddFunction(module, "NSFullUserName", LLVMFunctionType(LLVMPointerType(LLVMInt8Type(), 0), NULL, 0, 0));
LLVMSetLi...
2012 Nov 20
2
[LLVMdev] Getting a named value in llvm-c
Hi all,
I am wondering if there is a way to get a value by name in the C
interface for the LLVM Jit?
There seems to be a way to name values consistently, but no way to
retrieve those LLVMValueRef's by name.
I see it is possible to get a struct by name and a type by name and a
function by name, and a few other esoteric things, but not a general
value.
The reason I am wanting this is that I am writing a language where
there is a separation between the back end and the code which
process...
2012 Nov 22
2
[LLVMdev] Getting a named value in llvm-c
...to make the IR easier to read (an
> exception
> being struct type names).
>
> Perhaps you could maintain a map from name to Value* in your front-end?
>
> Ciao, Duncan.
>
>>
>> There seems to be a way to name values consistently, but no way to
>> retrieve those LLVMValueRef's by name.
>>
>> I see it is possible to get a struct by name and a type by name and a
>> function by name, and a few other esoteric things, but not a general
>> value.
>>
>> The reason I am wanting this is that I am writing a language where
>> there is...
2017 Apr 28
2
LLVMGetFirstFunction() / LLVMGetNextFunction( ) problem
Hi, I have a problem - looking for advice.
I have a source code file with two functions which are compiled into a .bc
file.
When the bitcode file is loaded, I can dump the module and see the two
functions:
...
; Materializable
; Function Attrs: noinline nounwind uwtable
define void @matmul(double*, double*, double*, i32, i32, i32) #0 {}
; Materializable
; Function Attrs: noinline nounwind