[cfe-dev] Problem in code generation with LLVM using clang

Sam Parker S.Parker3 at lboro.ac.uk
Mon Oct 22 00:33:32 PDT 2012


If you're writing a pass for LLVM, you're going to need to follow the instructions here to include it into the build:
http://llvm.org/docs/WritingAnLLVMPass.html#quickstart

If you want to just want to see what a bytecode file looks like, write a standard 'Hello World' program and compile it with the command you were trying, but omitting the include path.

Hope that helps.
Sam

________________________________
From: cfe-dev-bounces at cs.uiuc.edu [cfe-dev-bounces at cs.uiuc.edu] on behalf of Era Jain [era at cse.iitk.ac.in]
Sent: 21 October 2012 20:56
To: cfe-dev at cs.uiuc.edu
Subject: [cfe-dev] Problem in code generation with LLVM using clang

Hi,

I am completely new to LLVM and to begin with, I am writing a basic pass(the Hello World Pass).
I am trying to compile Hello.cpp using clang++ using the following command:

>  clang -S -emit-llvm -I/home/lera/llvm/include Hello.cpp -o Hello.bc

and get the following errors:

In file included from Hello.cpp:1:
In file included from /home/era/llvm/include/llvm/Pass.h:373:
In file included from /home/era/llvm/include/llvm/PassSupport.h:25:
In file included from /home/era/llvm/include/llvm/PassRegistry.h:20:
In file included from /home/era/llvm/include/llvm/ADT/StringRef.h:13:
In file included from /home/era/llvm/include/llvm/Support/type_traits.h:20:
/home/era/llvm/include/llvm/Support/DataTypes.h:49:3: error: "Must #define
      __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
  ^
/home/era/llvm/include/llvm/Support/DataTypes.h:53:3: error: "Must #define
      __STDC_CONSTANT_MACROS before "         "#including Support/DataTypes.h"
# error "Must #define __STDC_CONSTANT_MACROS before " \
  ^
In file included from Hello.cpp:2:
In file included from /home/era/llvm/include/llvm/Function.h:24:
In file included from /home/era/llvm/include/llvm/Argument.h:18:
In file included from /home/era/llvm/include/llvm/Attributes.h:18:
/home/era/llvm/include/llvm/Support/MathExtras.h:38:24: error: use of undeclared
      identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                       ^
/home/era/llvm/include/llvm/Support/MathExtras.h:38:56: error: use of undeclared
      identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                                                       ^
/home/era/llvm/include/llvm/Support/MathExtras.h:64:26: error: use of undeclared
      identifier 'UINT64_C'
  return N >= 64 || x < (UINT64_C(1)<<N);
                         ^
/home/era/llvm/include/llvm/Support/MathExtras.h:96:24: error: use of undeclared
      identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                       ^
/home/era/llvm/include/llvm/Support/MathExtras.h:96:56: error: use of undeclared
      identifier 'INT64_C'
  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
                                                       ^
7 errors generated.

Can anyone help me with this?? Any help would be appreciated. Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121022/c77b0e9a/attachment.html>


More information about the cfe-dev mailing list