]> granicus.if.org Git - clang/log
clang
15 years agowrap long lines.
Chris Lattner [Mon, 16 Feb 2009 19:24:31 +0000 (19:24 +0000)]
wrap long lines.

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

15 years agoassert/ErrorUnsupported in unimplemented stub functions instead of
Daniel Dunbar [Mon, 16 Feb 2009 18:48:45 +0000 (18:48 +0000)]
assert/ErrorUnsupported in unimplemented stub functions instead of
miscompiling.

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

15 years agoAdd pretty-printing (for GraphViz) support for RangeConstraintManager.
Ted Kremenek [Mon, 16 Feb 2009 18:42:56 +0000 (18:42 +0000)]
Add pretty-printing (for GraphViz) support for RangeConstraintManager.

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

15 years agoAdd support for deprecating ObjC properties. Unlike GCC, we warn that the
Chris Lattner [Mon, 16 Feb 2009 18:35:08 +0000 (18:35 +0000)]
Add support for deprecating ObjC properties.  Unlike GCC, we warn that the
property is deprecated, not the getter/setter if the attribute is on
the property.

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

15 years agopropagate attributes onto property decls.
Chris Lattner [Mon, 16 Feb 2009 18:32:47 +0000 (18:32 +0000)]
propagate attributes onto property decls.

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

15 years agodefine __OBJC2__ for objc's nonfragile abi.
Fariborz Jahanian [Mon, 16 Feb 2009 18:28:48 +0000 (18:28 +0000)]
define __OBJC2__ for objc's nonfragile abi.

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

15 years agoWhen a function with a prototype is redeclared without a prototype,
Douglas Gregor [Mon, 16 Feb 2009 18:20:44 +0000 (18:20 +0000)]
When a function with a prototype is redeclared without a prototype,
merge the prototype into the redeclaration (and make a note in the
declaration). Fixes PR3588.

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

15 years agoccc: @<filename> arguments are only treated specially if <filename>
Daniel Dunbar [Mon, 16 Feb 2009 18:18:43 +0000 (18:18 +0000)]
ccc: @<filename> arguments are only treated specially if <filename>
exists, otherwise gcc just treats as an input.
 - PR3591

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

15 years agoAdopt a more principled approach to invalid declarations:
Douglas Gregor [Mon, 16 Feb 2009 17:45:42 +0000 (17:45 +0000)]
Adopt a more principled approach to invalid declarations:
  - If a declaration is an invalid redeclaration of an existing name,
    complain about the invalid redeclaration then avoid adding it to
    the AST (we can still parse the definition or initializer, if any).
  - If the declaration is invalid but there is no prior declaration
    with that name, introduce the invalid declaration into the AST
    (for later error recovery).
  - If the declaration is an invalid redeclaration of a builtin that
    starts with __builtin_, we produce an error and drop the
    redeclaration. If it is an invalid redeclaration of a library
    builtin (e.g., malloc, printf), warn (don't error!) and drop the
    redeclaration.

If a user attempts to define a builtin, produce an error and (if it's
a library builtin like malloc) suggest -ffreestanding.

This addresses <rdar://problem/6097585> and PR2892. However, PR3588 is
still going to cause some problems when builtins are redeclared
without a prototype.

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

15 years agoRangeConstraintManager is not on by default.
Ted Kremenek [Mon, 16 Feb 2009 17:26:11 +0000 (17:26 +0000)]
RangeConstraintManager is not on by default.

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

15 years agoadd support for deprecated objc ivars.
Chris Lattner [Mon, 16 Feb 2009 17:19:12 +0000 (17:19 +0000)]
add support for deprecated objc ivars.

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

15 years agospecify a triple to use, otherwise we get errors on this test for
Chris Lattner [Mon, 16 Feb 2009 17:11:14 +0000 (17:11 +0000)]
specify a triple to use, otherwise we get errors on this test for
hosts with a different size_t type.

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

15 years agoupdate expected-warning line.
Chris Lattner [Mon, 16 Feb 2009 17:08:46 +0000 (17:08 +0000)]
update expected-warning line.

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

15 years agoAdd support for deprecated members of RecordDecls (e.g. struct fields).
Chris Lattner [Mon, 16 Feb 2009 17:07:21 +0000 (17:07 +0000)]
Add support for deprecated members of RecordDecls (e.g. struct fields).

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

15 years agocastToDeclContext/castFromDeclContext are only required to be included in the class...
Argyrios Kyrtzidis [Mon, 16 Feb 2009 14:31:00 +0000 (14:31 +0000)]
castToDeclContext/castFromDeclContext are only required to be included in the class of decls that directly derive from DeclContext.
Their subclasses don't need them.

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

15 years agocastToDeclContext/castFromDeclContext are not meant to be used directly; they are...
Argyrios Kyrtzidis [Mon, 16 Feb 2009 14:29:59 +0000 (14:29 +0000)]
castToDeclContext/castFromDeclContext are not meant to be used directly; they are used indirectly by cast/dyn_cast.
All Decl <-> DeclContext casting should be done through cast/dyn_cast.

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

15 years agoDeclContext had its "casting machinery" inside the class definition so that if a...
Argyrios Kyrtzidis [Mon, 16 Feb 2009 14:29:28 +0000 (14:29 +0000)]
DeclContext had its "casting machinery" inside the class definition so that if a new declaration context Decl appeared, the necessary changes
would be in one place. Since, now, only DeclNodes.def needs to be modified, move things out-of-line and simplify the DeclContext class.

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

15 years agoMake DeclContexts maintenance a bit easier.
Argyrios Kyrtzidis [Mon, 16 Feb 2009 14:28:33 +0000 (14:28 +0000)]
Make DeclContexts maintenance a bit easier.

-In DeclNodes.def, only mark as DeclContexts the top classes that directly derive from DeclContext. If the Decl has subclasses,
 it should be marked with DECL_CONTEXT_BASE.

-Use DeclNodes.def to automate the DeclContext::classof and DeclContext::CastTo definitions.

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

15 years agoUntabify.
Ben Laurie [Mon, 16 Feb 2009 09:18:41 +0000 (09:18 +0000)]
Untabify.

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

15 years agoDo not register 'RangeConstraintManager' as the default ConstraintManager.
Ted Kremenek [Mon, 16 Feb 2009 04:54:20 +0000 (04:54 +0000)]
Do not register 'RangeConstraintManager' as the default ConstraintManager.

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

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