]> granicus.if.org Git - clang/log
clang
15 years agoDon't allow taking the address of an element in an ext_vector
Nate Begeman [Sun, 15 Feb 2009 22:45:20 +0000 (22:45 +0000)]
Don't allow taking the address of an element in an ext_vector

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64614 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agolots of trailing whitespace
Chris Lattner [Sun, 15 Feb 2009 22:44:22 +0000 (22:44 +0000)]
lots of trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64613 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefactor the deprecated and unavailable checks into a new
Chris Lattner [Sun, 15 Feb 2009 22:43:40 +0000 (22:43 +0000)]
Refactor the deprecated and unavailable checks into a new
DiagnoseUseOfDeprecatedDecl method.  This ensures that they
are treated consistently.  This gets us 'unavailable' support
on a few new types of decls, and makes sure we consistently
silence deprecated when the caller is also deprecated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64612 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement gcc/testsuite/objc.dg/method-attribute-3.m, by improving error recovery.
Chris Lattner [Sun, 15 Feb 2009 22:24:30 +0000 (22:24 +0000)]
implement gcc/testsuite/objc.dg/method-attribute-3.m, by improving error recovery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64609 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodon't pass a random english string in as a string argument to Diag.
Chris Lattner [Sun, 15 Feb 2009 22:21:03 +0000 (22:21 +0000)]
don't pass a random english string in as a string argument to Diag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64608 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a fixme in -emit-html output: highlight the entire range of a macro
Chris Lattner [Sun, 15 Feb 2009 21:32:34 +0000 (21:32 +0000)]
fix a fixme in -emit-html output: highlight the entire range of a macro
instantiation, which highlights the arguments of a function like macro
as well as its identifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64607 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a new SourceManager::getInstantiationRange helper method.
Chris Lattner [Sun, 15 Feb 2009 21:26:50 +0000 (21:26 +0000)]
add a new SourceManager::getInstantiationRange helper method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64606 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix build on systems where uint64_t != unsigned long long
Chris Lattner [Sun, 15 Feb 2009 21:20:13 +0000 (21:20 +0000)]
fix build on systems where uint64_t != unsigned long long

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64605 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR3579: __LINE__ expands to the presumed location of the
Chris Lattner [Sun, 15 Feb 2009 21:06:39 +0000 (21:06 +0000)]
fix PR3579: __LINE__ expands to the presumed location of the
*end* of a macro instantiation, not the start of it.  This is
really all about bug-for-bug compatibility with GCC, but not
doing this breaks the FreeBSD kernel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64604 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR3579: __LINE__ expands to the presumed location of the
Chris Lattner [Sun, 15 Feb 2009 21:06:15 +0000 (21:06 +0000)]
fix PR3579: __LINE__ expands to the presumed location of the
*end* of a macro instantiation, not the start of it.  This is
really all about bug-for-bug compatibility with GCC, but not
doing this breaks the FreeBSD kernel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64603 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotrack "just a little more" location information for macro instantiations.
Chris Lattner [Sun, 15 Feb 2009 20:52:18 +0000 (20:52 +0000)]
track "just a little more" location information for macro instantiations.
Now instead of just tracking the expansion history, also track the full
range of the macro that got replaced.  For object-like macros, this doesn't
change anything.  For _Pragma and function-like macros, this means we track
the locations of the ')'.

This is required for PR3579 because apparently GCC uses the line of the ')'
of a function-like macro as the location to expand __LINE__ to.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64601 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR3589: Don't simplify libcalls with -ffreestanding.
Daniel Dunbar [Sun, 15 Feb 2009 20:00:15 +0000 (20:00 +0000)]
PR3589: Don't simplify libcalls with -ffreestanding.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64599 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove accidental duplication of content in .h file.
Ted Kremenek [Sun, 15 Feb 2009 18:24:51 +0000 (18:24 +0000)]
Remove accidental duplication of content in .h file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64596 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix pasto noticed by Anders Johnsen.
Daniel Dunbar [Sun, 15 Feb 2009 18:23:07 +0000 (18:23 +0000)]
Fix pasto noticed by Anders Johnsen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64595 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement support for attribute(unavailable) on objc methods.
Chris Lattner [Sun, 15 Feb 2009 07:50:52 +0000 (07:50 +0000)]
implement support for attribute(unavailable) on objc methods.
This implements gcc/testsuite/objc.dg/method-attribute-1.m

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64581 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoObj-C non-fragile ABI: Fix types of a few globals; these were not
Daniel Dunbar [Sun, 15 Feb 2009 07:36:20 +0000 (07:36 +0000)]
Obj-C non-fragile ABI: Fix types of a few globals; these were not
creating valid LLVM structures (although they work fined).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64580 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Pass -P to clang.
Daniel Dunbar [Sun, 15 Feb 2009 05:59:37 +0000 (05:59 +0000)]
ccc: Pass -P to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64578 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoallow implementations of deprecated functions to use deprecated symbols.
Chris Lattner [Sun, 15 Feb 2009 01:38:09 +0000 (01:38 +0000)]
allow implementations of deprecated functions to use deprecated symbols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64572 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse getNameAsCString instead of getNameAsString and reflow the type.
Mike Stump [Sat, 14 Feb 2009 22:49:33 +0000 (22:49 +0000)]
Use getNameAsCString instead of getNameAsString and reflow the type.
Thanks Anders.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64571 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGenerate the helper function for blocks. Now basic codegen is
Mike Stump [Sat, 14 Feb 2009 22:16:35 +0000 (22:16 +0000)]
Generate the helper function for blocks.  Now basic codegen is
starting to work for blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64570 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed a bad ir-gen bug which caused a dejagnu test to fail.
Fariborz Jahanian [Sat, 14 Feb 2009 21:25:36 +0000 (21:25 +0000)]
Fixed a bad ir-gen bug which caused a dejagnu test to fail.
Now we are pretty close to be in sync with objc's classic
abi when it comes to passing dejagnu objc executable tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64569 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a test case for -ffreestanding that redefines malloc.
Douglas Gregor [Sat, 14 Feb 2009 21:06:05 +0000 (21:06 +0000)]
Add a test case for -ffreestanding that redefines malloc.

Warn that complex numbers are an extension in a freestanding C99
implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64568 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd -ffreestanding to suppress the implicit declaration of library builtins like...
Douglas Gregor [Sat, 14 Feb 2009 20:49:29 +0000 (20:49 +0000)]
Add -ffreestanding to suppress the implicit declaration of library builtins like printf and malloc. Fixes PR3586

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64566 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd expected note. Surely people test before the check in stuff.
Mike Stump [Sat, 14 Feb 2009 20:35:19 +0000 (20:35 +0000)]
Add expected note.  Surely people test before the check in stuff.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64565 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd svn:eol-style=native to some files
Cedric Venet [Sat, 14 Feb 2009 20:20:19 +0000 (20:20 +0000)]
Add svn:eol-style=native to some files
Correct two files with inconsistent lines endings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64564 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed a problem caused by foreward @class use
Fariborz Jahanian [Sat, 14 Feb 2009 20:13:28 +0000 (20:13 +0000)]
Fixed a problem caused by foreward @class use
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64563 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support for deprecated Obj-C methods. The semantics mostly match what gcc has.
Anders Carlsson [Sat, 14 Feb 2009 19:08:58 +0000 (19:08 +0000)]
Add support for deprecated Obj-C methods. The semantics mostly match what gcc has.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64562 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd hook to add attributes to function declarations that we know
Douglas Gregor [Sat, 14 Feb 2009 18:57:46 +0000 (18:57 +0000)]
Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPass the location of the start of the selector to ActOnClassMessage/ActOnInstanceMessage.
Anders Carlsson [Sat, 14 Feb 2009 18:21:46 +0000 (18:21 +0000)]
Pass the location of the start of the selector to ActOnClassMessage/ActOnInstanceMessage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64560 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix 80col violations.
Mike Stump [Sat, 14 Feb 2009 18:02:21 +0000 (18:02 +0000)]
Fix 80col violations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64559 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch by Ben Laurie:
Ted Kremenek [Sat, 14 Feb 2009 17:08:39 +0000 (17:08 +0000)]
Patch by Ben Laurie:

ConstraintManager:
- constify getSymVal()

BasicConstraintManager:
- Pull out logic that would be common to ConstraintManagers of a similar nature
  and put them in a parent class called 'SimpleConstraintManager'.

RangeConstraintManager:
- Added a new prototype ConstraintManager to track ranges of variables! This
  ConstraintManager keeps tracks of ranges of concrete integers that a symbolic
  integer may have.

AnalysisConsumer:
- Add driver option to use RangeConstraintManager with GRExprEngine-based
  analyses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64558 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDefine __ELF__ on FreeBSD. Patch by Roman Divacky!
Anton Korobeynikov [Sat, 14 Feb 2009 16:42:50 +0000 (16:42 +0000)]
Define __ELF__ on FreeBSD. Patch by Roman Divacky!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64557 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the build on win32.
Cedric Venet [Sat, 14 Feb 2009 16:15:20 +0000 (16:15 +0000)]
Fix the build on win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64556 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDefine __ELF__ for linux systems.
Argyrios Kyrtzidis [Sat, 14 Feb 2009 15:02:45 +0000 (15:02 +0000)]
Define __ELF__ for linux systems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64553 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agonew tests, it would be nice to not warn on the second one.
Chris Lattner [Sat, 14 Feb 2009 08:27:44 +0000 (08:27 +0000)]
new tests, it would be nice to not warn on the second one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64549 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosimplify some code.
Chris Lattner [Sat, 14 Feb 2009 08:22:25 +0000 (08:22 +0000)]
simplify some code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64548 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agojust ignore hte format_arg attribute for now, it doesn't have any semantic implications.
Chris Lattner [Sat, 14 Feb 2009 08:12:47 +0000 (08:12 +0000)]
just ignore hte format_arg attribute for now, it doesn't have any semantic implications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64547 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd parser and type checking support for attribute((objc_exception)).
Chris Lattner [Sat, 14 Feb 2009 08:09:34 +0000 (08:09 +0000)]
add parser and type checking support for attribute((objc_exception)).
We don't have "zero cost" exceptions for ObjC yet, so there is no codegen
support required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64546 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename test
Chris Lattner [Sat, 14 Feb 2009 08:08:05 +0000 (08:08 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64545 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSeveral related changes:
Chris Lattner [Sat, 14 Feb 2009 07:37:35 +0000 (07:37 +0000)]
Several related changes:
1) implement parser and sema support for reading and verifying attribute(warnunusedresult).
2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense
   of its result.
3) extend isUnusedResultAWarning to directly return the loc and range
   info that should be reported to the user.  Make it substantially more
   precise in some cases than what was previously reported.
4) teach isUnusedResultAWarning about CallExpr to decls that are
   pure/const/warnunusedresult, fixing a fixme.
5) change warn_attribute_wrong_decl_type to not pass in english strings, instead,
   pass in integers and use %select.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64543 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoreduce nesting.
Chris Lattner [Sat, 14 Feb 2009 07:22:29 +0000 (07:22 +0000)]
reduce nesting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64542 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGRExprEngine: Handle empty statement expressions.
Ted Kremenek [Sat, 14 Feb 2009 05:55:08 +0000 (05:55 +0000)]
GRExprEngine: Handle empty statement expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64541 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't ignore the const attribute - we even have CG support for that. Do ignore the...
Anders Carlsson [Sat, 14 Feb 2009 04:12:57 +0000 (04:12 +0000)]
Don't ignore the const attribute - we even have CG support for that. Do ignore the malloc attribute however.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64538 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix more xmmintrin.h typos
Anders Carlsson [Sat, 14 Feb 2009 04:01:38 +0000 (04:01 +0000)]
Fix more xmmintrin.h typos

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64537 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoignore the const attribute for now.
Chris Lattner [Sat, 14 Feb 2009 03:51:44 +0000 (03:51 +0000)]
ignore the const attribute for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64536 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded GRStateManager::scanReachableSymbols(), a method which scans the reachable
Ted Kremenek [Sat, 14 Feb 2009 03:16:10 +0000 (03:16 +0000)]
Added GRStateManager::scanReachableSymbols(), a method which scans the reachable
symbols from an SVal.

- Fixed a bug in EnvironmentManager::RemoveDeadBindings() where it did not mark
  live all the symbols reachable from a live block-level expression.

- Fixed a bug in the retain/release checker where it did not stop tracking
  symbols that 'escaped' via compound literals being assigned to something the
  BasicStoreManager didn't reason about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64534 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agox86_64 ABI: Need to use canonical types when comparing against
Daniel Dunbar [Sat, 14 Feb 2009 02:45:45 +0000 (02:45 +0000)]
x86_64 ABI: Need to use canonical types when comparing against
ASTContext types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64533 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agox86_64 ABI: Pass simple types directly when possible. This is
Daniel Dunbar [Sat, 14 Feb 2009 02:09:24 +0000 (02:09 +0000)]
x86_64 ABI: Pass simple types directly when possible. This is
important for both keeping the generated LLVM simple and for ensuring
that integer types are passed/promoted correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64529 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse GRTransferFuncs::EvalBind when processing variable initializations.
Ted Kremenek [Sat, 14 Feb 2009 01:54:57 +0000 (01:54 +0000)]
Use GRTransferFuncs::EvalBind when processing variable initializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64527 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake it possible for builtins to expression FILE* arguments, so that
Douglas Gregor [Sat, 14 Feb 2009 01:52:53 +0000 (01:52 +0000)]
Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64526 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStatic analyzer:
Ted Kremenek [Sat, 14 Feb 2009 01:43:44 +0000 (01:43 +0000)]
Static analyzer:
- Added a new 'node builder' class called GRStmtNodeBuilderRef (name may
  change). This is essentially a smart reference to a GRStmtNodeBuilder object
  that keeps track of the current context (predecessor node, GRExprEngine
  object, etc.) The idea is to gradually simplify the interface between
  GRExprEngine and GRTransferFuncs using this new builder (i.e., passing 1
  argument instead of 5). It also handles some of the "auto-transition" for node
  creation, simplifying some of the logic in GRExprEngine itself.

- Used GRStmtBuilderRef to replace GRTransferFuncs::EvalStore with
  GRTransferFuncs::EvalBind. The new EvalBind method will be used at any
  arbitrary places where a binding between a location and value takes place.
  Moreover, GRTransferFuncs no longer has the responsibility to request
  StoreManager to do the binding; this is now in GRExprEngine::EvalBind. All
  GRTransferFuncs::EvalBind does is checker-specific logic (which can be a
  no-op).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64525 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix an error in _mm_loaddup_pd that Eli noticed.
Anders Carlsson [Sat, 14 Feb 2009 01:06:58 +0000 (01:06 +0000)]
Fix an error in _mm_loaddup_pd that Eli noticed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64522 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd the nodebug attribute to intrinsics
Anders Carlsson [Sat, 14 Feb 2009 01:00:11 +0000 (01:00 +0000)]
Add the nodebug attribute to intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64519 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd test case to insure that implicit builtin declarations for C library functions...
Douglas Gregor [Sat, 14 Feb 2009 00:37:42 +0000 (00:37 +0000)]
Add test case to insure that implicit builtin declarations for C library functions aren't created in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64513 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExtend builtin "attribute" syntax to include a notation for
Douglas Gregor [Sat, 14 Feb 2009 00:32:47 +0000 (00:32 +0000)]
Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:

  - fprintf and vfprintf: the builtins mechanism cannot (yet)
    express FILE* arguments, so these can't be encoded.
  - NSLog: the builtins mechanism cannot (yet) express NSString*
    arguments, so this (and NSLogv) can't be encoded.
  - asprintf and vasprintf: these aren't part of the C99 standard
    library, so we really shouldn't be defining them as builtins in
    the general case (and we don't seem to have the machinery to make
    them builtins only on certain targets and depending on whether
    extensions are enabled).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64512 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate checker build.
Ted Kremenek [Fri, 13 Feb 2009 23:41:12 +0000 (23:41 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64507 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix rdar://6586493, a bug in codegen of the GNU
Chris Lattner [Fri, 13 Feb 2009 23:35:32 +0000 (23:35 +0000)]
fix rdar://6586493, a bug in codegen of the GNU
missing-?:-true-value extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64505 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplicitly declare certain C library functions (malloc, strcpy, memmove,
Douglas Gregor [Fri, 13 Feb 2009 23:20:09 +0000 (23:20 +0000)]
Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

  1) When we're supporting the "implicit function declaration" feature
  of C99, these functions will be implicitly declared with the right
  signature rather than as a function returning "int" with no
  prototype. See PR3541 for the reason why this is important (hint:
  GCC always predeclares these functions).

  2) If users attempt to redeclare one of these library functions with
  an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

  'strcpy' was implicitly declared here with type 'char *(char *, char
  const *)'

but we should really print out a fake code line showing the
declaration, like this:

  'strcpy' was implicitly declared here as:

    char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd an assertion from Alexei Svitkine!
Chris Lattner [Fri, 13 Feb 2009 23:06:48 +0000 (23:06 +0000)]
add an assertion from Alexei Svitkine!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64503 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet constant bit on static block vars as well. Patch by Anders Johnson!q
Daniel Dunbar [Fri, 13 Feb 2009 22:58:39 +0000 (22:58 +0000)]
Set constant bit on static block vars as well. Patch by Anders Johnson!q

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64502 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix typo in printing of __private_extern__.
Daniel Dunbar [Fri, 13 Feb 2009 22:49:34 +0000 (22:49 +0000)]
Fix typo in printing of __private_extern__.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64501 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify predicate.
Daniel Dunbar [Fri, 13 Feb 2009 22:49:13 +0000 (22:49 +0000)]
Simplify predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64500 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWarn about attribute used ignored on "extern int a
Daniel Dunbar [Fri, 13 Feb 2009 22:48:56 +0000 (22:48 +0000)]
Warn about attribute used ignored on "extern int a
__attribute__((used))".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64499 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd VarDecl::hasExternalStorage (no functionality change).
Daniel Dunbar [Fri, 13 Feb 2009 22:48:27 +0000 (22:48 +0000)]
Add VarDecl::hasExternalStorage (no functionality change).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64498 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoanders johnson points out that some software depends on the
Chris Lattner [Fri, 13 Feb 2009 22:43:13 +0000 (22:43 +0000)]
anders johnson points out that some software depends on the
definition of __intptr_t_defined when stdint.h defines intptr_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64497 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGive TargetInfo a new IntPtrType to hold the intptr_t type for
Chris Lattner [Fri, 13 Feb 2009 22:28:55 +0000 (22:28 +0000)]
Give TargetInfo a new IntPtrType to hold the intptr_t type for
a target.

Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this.

On linux/32, set intptr_t to int, instead of long.  This fixes PR3563.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64495 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd test case illustrating special handling of 'SenTestCase' subclasses for the missi...
Ted Kremenek [Fri, 13 Feb 2009 22:26:30 +0000 (22:26 +0000)]
Add test case illustrating special handling of 'SenTestCase' subclasses for the missing -dealloc check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64494 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprove wording in a diagnostic to make it clear that we never intend to support
Chris Lattner [Fri, 13 Feb 2009 22:13:02 +0000 (22:13 +0000)]
improve wording in a diagnostic to make it clear that we never intend to support
the vla-in-structure extension that GCC does.  PR3562
Also wrap some long lines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64493 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIRgen support for attribute used.
Daniel Dunbar [Fri, 13 Feb 2009 22:08:43 +0000 (22:08 +0000)]
IRgen support for attribute used.
 - PR3566

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64492 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIf x is an invalid field decl, don't construct an expression for P->x,
Chris Lattner [Fri, 13 Feb 2009 22:08:30 +0000 (22:08 +0000)]
If x is an invalid field decl, don't construct an expression for P->x,
just silently return an error to avoid bogus diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64491 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPTH: Cache directory and negative 'stat' calls. This gives us a 1% performance impro...
Ted Kremenek [Fri, 13 Feb 2009 22:07:44 +0000 (22:07 +0000)]
PTH: Cache directory and negative 'stat' calls.  This gives us a 1% performance improvement on Cocoa.h (fsyntax-only+PTH).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64490 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agowrap some crazy long lines.
Chris Lattner [Fri, 13 Feb 2009 21:51:45 +0000 (21:51 +0000)]
wrap some crazy long lines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64489 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPull MayDeferGeneration out of EmitGlobal.
Daniel Dunbar [Fri, 13 Feb 2009 21:18:01 +0000 (21:18 +0000)]
Pull MayDeferGeneration out of EmitGlobal.
 - Fix emission of static functions with constructor attribute while I
   was here.
<rdar://problem/6140899> [codegen] "static" and attribute-constructor interact poorly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64488 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename EmitStatics (etc) to EmitDeferred; provide basic infrastructure
Daniel Dunbar [Fri, 13 Feb 2009 20:29:50 +0000 (20:29 +0000)]
Rename EmitStatics (etc) to EmitDeferred; provide basic infrastructure
for attribute used support.
- No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64487 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLet the backend unique these.
Mike Stump [Fri, 13 Feb 2009 20:17:16 +0000 (20:17 +0000)]
Let the backend unique these.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64486 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodocument __builtin_shufflevector
Chris Lattner [Fri, 13 Feb 2009 20:00:20 +0000 (20:00 +0000)]
document __builtin_shufflevector

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64485 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix spelling.
Mike Stump [Fri, 13 Feb 2009 19:38:12 +0000 (19:38 +0000)]
Fix spelling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64482 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove DescriptorUniqueCount into CGM.
Mike Stump [Fri, 13 Feb 2009 19:36:03 +0000 (19:36 +0000)]
Move DescriptorUniqueCount into CGM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64481 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix rdar://6562329, a static analyzer crash Ted noticed on
Chris Lattner [Fri, 13 Feb 2009 19:33:24 +0000 (19:33 +0000)]
Fix rdar://6562329, a static analyzer crash Ted noticed on
wine sources.  This was happening because HighlightMacros was
calling EnterMainFile multiple times on the same preprocessor
object and getting an assert due to the new #line stuff (the
file in question was bison output with #line directives).

The fix for this is to not reenter the file.  Instead,
relex the tokens in raw mode, swizzle them a bit and repreprocess
the token stream.  An added bonus of this is that rewrite macros
will now hilight the macro definition as well as its uses.  Woo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64480 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove NSConcreteStackBlock into CGM.
Mike Stump [Fri, 13 Feb 2009 19:29:27 +0000 (19:29 +0000)]
Move NSConcreteStackBlock into CGM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64479 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSema/AST support for attribute used. Patch by Anders Johnson (with small tweaks ...
Daniel Dunbar [Fri, 13 Feb 2009 19:23:53 +0000 (19:23 +0000)]
Sema/AST support for attribute used. Patch by Anders Johnson (with small tweaks & test case)!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64478 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some boilerplate to the PTH file to prepare for the caching of stats for director...
Ted Kremenek [Fri, 13 Feb 2009 19:13:46 +0000 (19:13 +0000)]
Add some boilerplate to the PTH file to prepare for the caching of stats for directories (and negative stats too).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64477 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate an unused variable
Douglas Gregor [Fri, 13 Feb 2009 19:13:32 +0000 (19:13 +0000)]
Eliminate an unused variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64476 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReflow to 80col.
Mike Stump [Fri, 13 Feb 2009 19:12:34 +0000 (19:12 +0000)]
Reflow to 80col.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64475 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove DeclGroupOwningRef, since we intend for declarations to be owned
Douglas Gregor [Fri, 13 Feb 2009 19:06:18 +0000 (19:06 +0000)]
Remove DeclGroupOwningRef, since we intend for declarations to be owned
by DeclContexts (always) rather than by statements.

DeclContext currently goes out of its way to avoid destroying any
Decls that might be owned by a DeclGroupOwningRef. However, in an
error-recovery situation, a failure in a declaration statement can
cause all of the decls in a DeclGroupOwningRef to be destroyed after
they've already be added into the DeclContext. Hence, DeclContext is
left with already-destroyed declarations, and bad things happen. This
problem was causing failures that showed up as assertions on x86 Linux
in test/Parser/objc-forcollection-neg-2.m.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64474 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove GlobalUniqueCount up into CGM.
Mike Stump [Fri, 13 Feb 2009 18:36:05 +0000 (18:36 +0000)]
Move GlobalUniqueCount up into CGM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64473 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix capitalization in a diagnostic
Douglas Gregor [Fri, 13 Feb 2009 18:20:19 +0000 (18:20 +0000)]
Fix capitalization in a diagnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64472 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd new files to Xcode project
Anders Carlsson [Fri, 13 Feb 2009 18:09:59 +0000 (18:09 +0000)]
Add new files to Xcode project

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64471 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed a 64bit code gen bug of a cateogory
Fariborz Jahanian [Fri, 13 Feb 2009 17:52:22 +0000 (17:52 +0000)]
Fixed a 64bit code gen bug of a cateogory
implementation with no category declaration!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64470 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agox86_64 ABI: Support va_arg passed in mixed registers.
Daniel Dunbar [Fri, 13 Feb 2009 17:46:31 +0000 (17:46 +0000)]
x86_64 ABI: Support va_arg passed in mixed registers.
 - Now at 1274 passes on gcc compat suite vs 1262.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64469 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Suffix for PCH files is appended, not replaced. (Test case)
Daniel Dunbar [Fri, 13 Feb 2009 17:42:52 +0000 (17:42 +0000)]
ccc: Suffix for PCH files is appended, not replaced. (Test case)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64467 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Suffix for PCH files is appended, not replaced.
Daniel Dunbar [Fri, 13 Feb 2009 17:42:34 +0000 (17:42 +0000)]
ccc: Suffix for PCH files is appended, not replaced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64466 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCondense NSConcreteGlobalBlock handling.
Mike Stump [Fri, 13 Feb 2009 17:23:42 +0000 (17:23 +0000)]
Condense NSConcreteGlobalBlock handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64461 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCalculate size correctly.
Mike Stump [Fri, 13 Feb 2009 17:03:17 +0000 (17:03 +0000)]
Calculate size correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64459 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSize should be unsigned.
Mike Stump [Fri, 13 Feb 2009 16:55:51 +0000 (16:55 +0000)]
Size should be unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64458 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCondense all the blocks code into CGBlocks.cpp.
Mike Stump [Fri, 13 Feb 2009 16:19:19 +0000 (16:19 +0000)]
Condense all the blocks code into CGBlocks.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64457 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixup types, the runtime uses int, not int32.
Mike Stump [Fri, 13 Feb 2009 16:01:35 +0000 (16:01 +0000)]
Fixup types, the runtime uses int, not int32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64456 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix cmake builds.
Mike Stump [Fri, 13 Feb 2009 15:42:50 +0000 (15:42 +0000)]
Fix cmake builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64455 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixup spacing a tad.
Mike Stump [Fri, 13 Feb 2009 15:32:32 +0000 (15:32 +0000)]
Fixup spacing a tad.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64454 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove GenericBlockLiteralType into CGM.
Mike Stump [Fri, 13 Feb 2009 15:25:34 +0000 (15:25 +0000)]
Move GenericBlockLiteralType into CGM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64452 91177308-0d34-0410-b5e6-96231b3b80d8