[LLVMdev] Cannot Compile through an LLVM Pass

Jiandong Wang computerhenu at gmail.com
Fri May 7 19:23:06 PDT 2010


hey guys. Now I am following the "Writing an LLVM Pass", but can't work it
out. See what I have done.

After completing the exact Makefile and source code  under
lib/Transforms/Hello, I typed the command "make" instead of "gmake" , then
it generated silently "Hello.o" in Debug. But, next, when I tried to
generate "hello.bc" by the command "llvm-g++ -O3 -emit-llvm Hello.cpp -c -o
hello.bc", errors arose like that:

In file included from /usr/local/include/llvm/Pass.h:32,
                 from Hello.cpp:16:
/usr/local/include/llvm/System/DataTypes.h:45:3: error: #error "Must #define
__STDC_LIMIT_MACROS before #including System/DataTypes.h"
/usr/local/include/llvm/System/DataTypes.h:49:3: error: #error "Must #define
__STDC_CONSTANT_MACROS before " "#including System/DataTypes.h"
In file included from /usr/local/include/llvm/Attributes.h:18,
                 from /usr/local/include/llvm/Argument.h:18,
                 from /usr/local/include/llvm/Function.h:24,
                 from Hello.cpp:17:
/usr/local/include/llvm/Support/MathExtras.h: In function ‘bool
llvm::isInt(int64_t)’:
/usr/local/include/llvm/Support/MathExtras.h:57: error: there are no
arguments to ‘INT64_C’ that depend on a template parameter, so a declaration
of ‘INT64_C’ must be available
/usr/local/include/llvm/Support/MathExtras.h:57: error: (if you use
‘-fpermissive’, G++ will accept your code, but allowing the use of an
undeclared name is deprecated)
/usr/local/include/llvm/Support/MathExtras.h:57: error: there are no
arguments to ‘INT64_C’ that depend on a template parameter, so a declaration
of ‘INT64_C’ must be available
/usr/local/include/llvm/Support/MathExtras.h: In function ‘bool
llvm::isUint(uint64_t)’:
/usr/local/include/llvm/Support/MathExtras.h:62: error: there are no
arguments to ‘UINT64_C’ that depend on a template parameter, so a
declaration of ‘UINT64_C’ must be available

your any piece of words will be appreciated greatly. Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100508/11c3fbee/attachment.html>


More information about the llvm-dev mailing list