Commit Graph

8 Commits

Author SHA1 Message Date
Douglas Gregor 9246b6830a In C++, if the user redeclares a builtin function with a type that is
inconsistent with the type that the builtin *should* have, forget
about the builtin altogether: we don't want subsequence analyses,
CodeGen, etc., to think that we have a proper builtin function.

C is protected from errors here because it allows one to use a
library builtin without having a declaration, and detects inconsistent
(re-)declarations of builtins during declaration merging. C++ was
unprotected, and therefore would crash.

Fixes PR8839.

llvm-svn: 122351
2010-12-21 19:47:46 +00:00
Fariborz Jahanian e8473c2feb Such function decls,as objc's objc_msgSend, builtins in
a specific language. We are adding such language info. by
extensing Builtins.def and via a language flag added
to LIBBUILTIN/BUILTIN and check for that when deciding
a name is builtin or not. Implements //rdar://8689273.

llvm-svn: 120429
2010-11-30 17:35:24 +00:00
Ted Kremenek 5932c35138 Add builtin definition for scanf, including extending the builtin encoding to
represent builtins that have the "scanf" attribution (via the format attribute) just
like we do with printf functions.  Follow-up work is needed to add similar support
for fscanf et al.

This is to support format-string checking for scanf functions.

llvm-svn: 108499
2010-07-16 02:11:15 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Chris Lattner 651a221cc2 follow-on to my patch: some targets (like sparc) do not
have target-specific builtins, and do not set the count.
Just default to 0 for these targets.

llvm-svn: 73510
2009-06-16 17:27:50 +00:00
Chris Lattner 4ef49c1d6e my refactoring of builtins changed target-specific builtins to only be
registered when PCH wasn't being used.  We should always install (in BuiltinInfo)
information about target-specific builtins, but we shouldn't register any builtin
identifier infos.  This fixes the build of apps that use PCH and target specific
builtins together.

llvm-svn: 73492
2009-06-16 16:18:48 +00:00
Chris Lattner 15ba94987a Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc.  This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.

llvm-svn: 73319
2009-06-14 01:54:56 +00:00
Chris Lattner 5abdec7978 move the various builtins stuff from libast to libbasic. This
fixes a layering violation in lib/Basic/Targets.cpp.

llvm-svn: 73318
2009-06-14 01:05:48 +00:00