[LLVMdev] Simple question

Bill Wendling wendling at apple.com
Sun Mar 17 02:01:36 PDT 2013


On Mar 15, 2013, at 5:18 PM, James Courtier-Dutton <james.dutton at gmail.com> wrote:

> Ok, maybe i asked the wrong question.
> Instead of using the value 12 all the way through the llvm ir text file. How do i use %friendlyName instead?
> I.e. The equivalent of something like
> #define FriendlyName  12
> in C
You can make it a constant global:

@g = global i32 12, align 4

define i32 @foo() nounwind uwtable readonly ssp {
  %1 = load i32* @g, align 4
  ret i32 %1
}

-bw

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130317/6d9d11eb/attachment.html>


More information about the llvm-dev mailing list