warning during intrinsic defintion

I’ve introduced intrinsics for my target however when I compile llvm+clang I get a a redefinition warning:

llvm/tools/clang/lib/Basic/Targets.cpp:904:0: warning: “BUILTIN” redefined [enabled by default]
#define BUILTIN(ID, TYPE, ATTRS) { #ID, TYPE, ATTRS, 0, ALL_LANGUAGES },
^

In file included from llvm/tools/clang/lib/Basic/Targets.cpp:26:0:
llvm/tools/clang/include/clang/Basic/TargetBuiltins.h:164:0: note: this is the location of the previous definition
#define BUILTIN(ID, TYPE, ATTRS) BI##ID,

I pretty much copied what other targets did when they defined intrinsics. Why this happens for my target but not for the others?

Any help is appreciated.

I don’t really know exactly why you’re getting this, but it seems like you forgot the last line in your Builtins.def. Namely, the line:
#undef BUILTIN

Thanks! I asked for help on the irc chat, and felt pretty dumb when I got an answer :smiley: