]> granicus.if.org Git - clang/log
clang
15 years agofix volatile handling with ExtVectorElementExpr, so that we
Chris Lattner [Mon, 16 Feb 2009 22:25:49 +0000 (22:25 +0000)]
fix volatile handling with ExtVectorElementExpr, so that we
emit two volatile loads for:
typedef __attribute__(( ext_vector_type(4) )) float float4;

float test(volatile float4 *P) {
  return P->x+P->y;
}

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

15 years agoModify getMaxValue/getMinValue to take pointer values as well.
Ted Kremenek [Mon, 16 Feb 2009 22:21:33 +0000 (22:21 +0000)]
Modify getMaxValue/getMinValue to take pointer values as well.

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

15 years agointroduce and use a new ExtVectorElementExpr::isArrow method, at Eli's suggestion
Chris Lattner [Mon, 16 Feb 2009 22:14:05 +0000 (22:14 +0000)]
introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's suggestion

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

15 years agoUse isa<...> instead of dyn_cast<...> where result is not needed.
Fariborz Jahanian [Mon, 16 Feb 2009 22:09:26 +0000 (22:09 +0000)]
Use isa<...> instead of dyn_cast<...> where result is not needed.

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

15 years agodiagnose uses of deprecated typenames and tags.
Chris Lattner [Mon, 16 Feb 2009 22:07:16 +0000 (22:07 +0000)]
diagnose uses of deprecated typenames and tags.
We now pass all the deprecation tests in the objc.dg suite.

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

15 years agoBasicValueFactory: Add utility methods 'Add1' and 'Sub1' to get a persistent APSInt...
Ted Kremenek [Mon, 16 Feb 2009 22:07:07 +0000 (22:07 +0000)]
BasicValueFactory: Add utility methods 'Add1' and 'Sub1' to get a persistent APSInt value that is 1 greater or 1 less than the provided value.

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

15 years agoBasicValueFactory: Add getMaxValue and getMinValue variants that take QualTypes.
Ted Kremenek [Mon, 16 Feb 2009 22:00:30 +0000 (22:00 +0000)]
BasicValueFactory: Add getMaxValue and getMinValue variants that take QualTypes.

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

15 years agoSupply the header corresponding to a library builtin as a separate argument to the...
Douglas Gregor [Mon, 16 Feb 2009 21:58:21 +0000 (21:58 +0000)]
Supply the header corresponding to a library builtin as a separate argument to the LIBBUILTIN macro

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

15 years agoAdd getSymbolManager() and getBasicVals() accessors to GRStateRef.
Ted Kremenek [Mon, 16 Feb 2009 21:57:23 +0000 (21:57 +0000)]
Add getSymbolManager() and getBasicVals() accessors to GRStateRef.

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

15 years agoFix IRgen of __builtin_memset.
Daniel Dunbar [Mon, 16 Feb 2009 21:52:05 +0000 (21:52 +0000)]
Fix IRgen of __builtin_memset.
 - Fix test case to not only have negative tests.

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

15 years agorandom cleanup
Chris Lattner [Mon, 16 Feb 2009 21:43:00 +0000 (21:43 +0000)]
random cleanup

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

15 years agoFixes a bug in property type encoding.
Fariborz Jahanian [Mon, 16 Feb 2009 21:41:04 +0000 (21:41 +0000)]
Fixes a bug in property type encoding.

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

15 years agowarn about interfaces that inherit from deprecated classes.
Chris Lattner [Mon, 16 Feb 2009 21:33:09 +0000 (21:33 +0000)]
warn about interfaces that inherit from deprecated classes.

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

15 years agowarn about categories that implement deprecated interfaces.
Chris Lattner [Mon, 16 Feb 2009 21:30:01 +0000 (21:30 +0000)]
warn about categories that implement deprecated interfaces.

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

15 years agoearly exit on error. This code is creating an invalid decl on error. This is
Chris Lattner [Mon, 16 Feb 2009 21:26:43 +0000 (21:26 +0000)]
early exit on error.  This code is creating an invalid decl on error.  This is
dubious, but at least mark it as an invalid decl.

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

15 years agoenhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyy
Chris Lattner [Mon, 16 Feb 2009 21:11:58 +0000 (21:11 +0000)]
enhance ExtVectorElementExpr to allow V->xxyy  to work like (*V).xxyy

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

15 years agoWhen merging from a function with a prototype to a function without a
Douglas Gregor [Mon, 16 Feb 2009 20:58:07 +0000 (20:58 +0000)]
When merging from a function with a prototype to a function without a
prototype, synthesize ParmVarDecls for prototype-less FunctionDecl.

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

15 years agoTest passes with -analyzer-range-contraints.
Ted Kremenek [Mon, 16 Feb 2009 19:43:20 +0000 (19:43 +0000)]
Test passes with -analyzer-range-contraints.

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

15 years agoRemove an unused variable (which caused a warning).
Fariborz Jahanian [Mon, 16 Feb 2009 19:40:26 +0000 (19:40 +0000)]
Remove an unused variable (which caused a warning).

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

15 years agodo not warn about uses of deprecated decls when in an out-of-line objc method
Chris Lattner [Mon, 16 Feb 2009 19:35:30 +0000 (19:35 +0000)]
do not warn about uses of deprecated decls when in an out-of-line objc method
whose declaration was declared as deprecated.

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

15 years agoRemove FindIvarDeclaration. Use lookupInstanceVariable is is functionally
Fariborz Jahanian [Mon, 16 Feb 2009 19:35:27 +0000 (19:35 +0000)]
Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionally
the same.

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

15 years agocleanup, add a getMethod() that takes a bool to indicate whether
Chris Lattner [Mon, 16 Feb 2009 19:30:12 +0000 (19:30 +0000)]
cleanup, add a getMethod() that takes a bool to indicate whether
the caller wants class or instance methods.

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

15 years agoWhen inside an Objective-C++ method, name lookup should look into the
Douglas Gregor [Mon, 16 Feb 2009 19:28:42 +0000 (19:28 +0000)]
When inside an Objective-C++ method, name lookup should look into the
interface for ivars before assuming that this is an unresolved
function name.

Fixes <rdar://problem/6590445>.

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

15 years agoadd assertion
Chris Lattner [Mon, 16 Feb 2009 19:27:54 +0000 (19:27 +0000)]
add assertion

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

15 years agocode cleanup
Chris Lattner [Mon, 16 Feb 2009 19:25:52 +0000 (19:25 +0000)]
code cleanup

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

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