]> granicus.if.org Git - clang/log
clang
15 years agoI take it back, InstantiateExpr does not check for null.
Anders Carlsson [Fri, 15 May 2009 20:29:28 +0000 (20:29 +0000)]
I take it back, InstantiateExpr does not check for null.

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

15 years agoInstantiation support for 'this'
Anders Carlsson [Fri, 15 May 2009 20:26:03 +0000 (20:26 +0000)]
Instantiation support for 'this'

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

15 years agoNo need to null check the expr, Sema::SemaRef.InstantiateExpr handles all that.
Anders Carlsson [Fri, 15 May 2009 20:10:48 +0000 (20:10 +0000)]
No need to null check the expr, Sema::SemaRef.InstantiateExpr handles all that.

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

15 years agoAdd SemaTemplateInstantiateStmt.cpp to Xcode project.
Anders Carlsson [Fri, 15 May 2009 20:08:59 +0000 (20:08 +0000)]
Add SemaTemplateInstantiateStmt.cpp to Xcode project.

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

15 years agoMake sure that the type associated with a class template is dependent.
Douglas Gregor [Fri, 15 May 2009 19:11:46 +0000 (19:11 +0000)]
Make sure that the type associated with a class template is dependent.

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

15 years agoTemplate instantiation for "if" statements. Also:
Douglas Gregor [Fri, 15 May 2009 18:53:42 +0000 (18:53 +0000)]
Template instantiation for "if" statements. Also:

  - Skip semantic analysis of the "if" condition if it is type-dependent.
  - Added the location of the "else" keyword into IfStmt, so that we can
    provide it for type-checking after template instantiation.

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

15 years agoUpdate checker build.
Ted Kremenek [Fri, 15 May 2009 18:40:51 +0000 (18:40 +0000)]
Update checker build.

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

15 years agoA C++ member function always has either weak linkage (if it's inline or defined inlin...
Anders Carlsson [Fri, 15 May 2009 18:35:39 +0000 (18:35 +0000)]
A C++ member function always has either weak linkage (if it's inline or defined inline) or strong linkage (other cases).

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

15 years agoMove statement instantiation into its own file. No functionality change
Douglas Gregor [Fri, 15 May 2009 18:22:25 +0000 (18:22 +0000)]
Move statement instantiation into its own file. No functionality change

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

15 years agoWhen word-wrapping, be more defensive about a ridiculously small number of columns...
Douglas Gregor [Fri, 15 May 2009 18:05:24 +0000 (18:05 +0000)]
When word-wrapping, be more defensive about a ridiculously small number of columns. Fixes <rdar://problem/6892178>

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

15 years agoCall ActOnStartOfFunctionDecl/ActOnFinishFunctionBody when
Douglas Gregor [Fri, 15 May 2009 17:59:04 +0000 (17:59 +0000)]
Call ActOnStartOfFunctionDecl/ActOnFinishFunctionBody when
instantiating the definition of a function from a template.

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

15 years agoName mangling for class template specializations and template arguments.
Anders Carlsson [Fri, 15 May 2009 16:09:15 +0000 (16:09 +0000)]
Name mangling for class template specializations and template arguments.

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

15 years agoFix processing of -Ufoo to not inject "#undef foo 1" into the predefines
Chris Lattner [Fri, 15 May 2009 16:08:43 +0000 (16:08 +0000)]
Fix processing of -Ufoo to not inject "#undef foo 1" into the predefines
buffer.  This caused exciting nonsense like this:

$ clang t.c -fsyntax-only -UMACRO
In file included from <built-in>:104:
<command line>:1:14: warning: extra tokens at end of #undef directive [-Wextra-tokens]
#undef MACRO 1
             ^
             //
1 diagnostic generated.

rdar://6891800

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

15 years agoFix crash when deriving the enclosing summary of a method whose first selector slot...
Ted Kremenek [Fri, 15 May 2009 15:49:00 +0000 (15:49 +0000)]
Fix crash when deriving the enclosing summary of a method whose first selector slot has a null IdentifierInfo*.  This happens when analyzing Growl.

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

15 years agoRemove extra whitespace character in string literal. Purely cosmetic.
Ted Kremenek [Fri, 15 May 2009 06:02:08 +0000 (06:02 +0000)]
Remove extra whitespace character in string literal.  Purely cosmetic.

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

15 years agoUpdate checker build.
Ted Kremenek [Fri, 15 May 2009 05:59:34 +0000 (05:59 +0000)]
Update checker build.

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

15 years agoUse dyn_cast instead of cast to allow our assumptions to be safely wrong.
Ted Kremenek [Fri, 15 May 2009 05:34:49 +0000 (05:34 +0000)]
Use dyn_cast instead of cast to allow our assumptions to be safely wrong.

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

15 years agoCleanup internal checks bug reporting, allowing intermediate diagnostics to be genera...
Ted Kremenek [Fri, 15 May 2009 05:25:09 +0000 (05:25 +0000)]
Cleanup internal checks bug reporting, allowing intermediate diagnostics to be generated for bad argument warnings, bad branches, etc.

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

15 years agoRe-enable passing analyzer options from scan-build to ccc-analyzer.
Ted Kremenek [Fri, 15 May 2009 04:20:31 +0000 (04:20 +0000)]
Re-enable passing analyzer options from scan-build to ccc-analyzer.

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

15 years agoDon't strip quotes in compiler line for -D arguments.
Ted Kremenek [Fri, 15 May 2009 04:07:18 +0000 (04:07 +0000)]
Don't strip quotes in compiler line for -D arguments.

Fixes PR 4205.

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

15 years agoBugReporter (extensive diagnostics): Do not include the range of target '}'
Ted Kremenek [Fri, 15 May 2009 02:46:13 +0000 (02:46 +0000)]
BugReporter (extensive diagnostics): Do not include the range of target '}'

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

15 years agoPathDiagnosticLocation::asRange(): for a PathDiagnosticLocation, the range of a DeclS...
Ted Kremenek [Fri, 15 May 2009 02:05:25 +0000 (02:05 +0000)]
PathDiagnosticLocation::asRange(): for a PathDiagnosticLocation, the range of a DeclStmt is only the decl, not
the decl + initializer.

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

15 years agoBugReporter (extensive diagnostics): Add control-flow piece to '}' in
Ted Kremenek [Fri, 15 May 2009 01:50:15 +0000 (01:50 +0000)]
BugReporter (extensive diagnostics): Add control-flow piece to '}' in
loop body when generating 'Looping back to the head of the loop'
diagnostics.

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

15 years agoInstantiate return statements.
Anders Carlsson [Fri, 15 May 2009 00:48:27 +0000 (00:48 +0000)]
Instantiate return statements.

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

15 years agoFixup debug information for the location information for __block
Mike Stump [Fri, 15 May 2009 00:29:54 +0000 (00:29 +0000)]
Fixup debug information for the location information for __block
variables.  For this to work, the backend needs to handle more complex
forms for locations.

A typical utterance would be:

        %forwarding = getelementptr %0* %use_by_ref, i32 0, i32 1               ; <i8**> [#uses=1]
        %0 = load i8** %forwarding              ; <i8*> [#uses=1]
        %1 = bitcast i8* %0 to %0*              ; <%0*> [#uses=1]
        %x = getelementptr %0* %1, i32 0, i32 4         ; <i32*> [#uses=1]
        %2 = bitcast i32* %x to { }*            ; <{ }*> [#uses=1]
        call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*))

Presently when selection finds something it doesn't understand, it
just avoids generating any information, which is safe, just
incomplete.  Radar 6867696

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

15 years agoAdd NullStmt::Clone and use it
Anders Carlsson [Fri, 15 May 2009 00:21:21 +0000 (00:21 +0000)]
Add NullStmt::Clone and use it

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

15 years agoInstantiate goto and label statements. (Very useful, I know)
Anders Carlsson [Fri, 15 May 2009 00:15:26 +0000 (00:15 +0000)]
Instantiate goto and label statements. (Very useful, I know)

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

15 years agoAdd SemaTemplateInstantiateExpr.cpp to Xcode project.
Anders Carlsson [Fri, 15 May 2009 00:10:12 +0000 (00:10 +0000)]
Add SemaTemplateInstantiateExpr.cpp to Xcode project.

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

15 years agoImplement template instantiation for DeclStmt
Douglas Gregor [Fri, 15 May 2009 00:01:03 +0000 (00:01 +0000)]
Implement template instantiation for DeclStmt

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

15 years agoDon't warn if result/argument type of an implemented
Fariborz Jahanian [Thu, 14 May 2009 23:52:54 +0000 (23:52 +0000)]
Don't warn if result/argument type of an implemented
method is a qualified id which conforms to the matching type
of its method declaration.

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

15 years agoTemplate instantiation for the NULL statement. Lame, I know
Douglas Gregor [Thu, 14 May 2009 23:40:54 +0000 (23:40 +0000)]
Template instantiation for the NULL statement. Lame, I know

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

15 years agoIntroduce basic support for instantiating the definitions of member
Douglas Gregor [Thu, 14 May 2009 23:26:13 +0000 (23:26 +0000)]
Introduce basic support for instantiating the definitions of member
functions of class templates. Only compound statements and expression
statements are currently implemented.

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

15 years agoCheck that the function being overridden is virtual.
Anders Carlsson [Thu, 14 May 2009 22:15:41 +0000 (22:15 +0000)]
Check that the function being overridden is virtual.

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

15 years agoImprovements to the FunctionDecl getters/setters.
Anders Carlsson [Thu, 14 May 2009 21:46:00 +0000 (21:46 +0000)]
Improvements to the FunctionDecl getters/setters.

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

15 years agoIntroduce a stack of instantiation scopes that are used to store the mapping from...
Douglas Gregor [Thu, 14 May 2009 21:44:34 +0000 (21:44 +0000)]
Introduce a stack of instantiation scopes that are used to store the mapping from variable declarations that occur within templates to their instantiated counterparts

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

15 years agoFix <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a retained...
Ted Kremenek [Thu, 14 May 2009 21:29:16 +0000 (21:29 +0000)]
Fix <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a retained object.

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

15 years agoFix the same speling error in the test case (Duh).
Anders Carlsson [Thu, 14 May 2009 21:20:16 +0000 (21:20 +0000)]
Fix the same speling error in the test case (Duh).

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

15 years agoLink FunctionDecls instantiated from the member functions of a class
Douglas Gregor [Thu, 14 May 2009 21:06:31 +0000 (21:06 +0000)]
Link FunctionDecls instantiated from the member functions of a class
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.

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

15 years agoFix a speling error.
Anders Carlsson [Thu, 14 May 2009 21:03:44 +0000 (21:03 +0000)]
Fix a speling error.

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

15 years agoupdated comments.
Fariborz Jahanian [Thu, 14 May 2009 20:57:28 +0000 (20:57 +0000)]
updated comments.

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

15 years agoAdds recognition of sentinel attribute on block declarations.
Fariborz Jahanian [Thu, 14 May 2009 20:53:39 +0000 (20:53 +0000)]
Adds recognition of sentinel attribute on block declarations.

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

15 years agoBetter diagnostics for covariance when checking overriding return types.
Anders Carlsson [Thu, 14 May 2009 19:52:19 +0000 (19:52 +0000)]
Better diagnostics for covariance when checking overriding return types.

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

15 years agoWhen there are any member new operators, global versions aren't looked up at all.
Sebastian Redl [Thu, 14 May 2009 18:11:41 +0000 (18:11 +0000)]
When there are any member new operators, global versions aren't looked up at all.

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

15 years agoDiagnose missing sentinel argument on a funciton call
Fariborz Jahanian [Thu, 14 May 2009 18:00:00 +0000 (18:00 +0000)]
Diagnose missing sentinel argument on a funciton call
with sentinel attribute.

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

15 years agoAvoid generating temp in source directory
Daniel Dunbar [Thu, 14 May 2009 17:00:11 +0000 (17:00 +0000)]
Avoid generating temp in source directory

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

15 years agoSkip the asm prefix when storing the name in block info.
Daniel Dunbar [Thu, 14 May 2009 16:42:16 +0000 (16:42 +0000)]
Skip the asm prefix when storing the name in block info.
 - Otherwise we emit internal names with embedded '\01' characters,
   which confuses some tools.

 - Ideally all the code which wants to get a "display name" for the
   given function should follow one code path, but this should be a
   monotonic improvement for now.

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

15 years agoIn C++, warn when something previously declared as a "struct" is later
Douglas Gregor [Thu, 14 May 2009 16:41:31 +0000 (16:41 +0000)]
In C++, warn when something previously declared as a "struct" is later
declared as a "class", or vice-versa. This warning is under the
control of -Wmismatched-tags, which is off by default.

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

15 years agoAdd forward declaration of Token. Thanks to Martin Doucha for pointing this out
Douglas Gregor [Thu, 14 May 2009 15:47:53 +0000 (15:47 +0000)]
Add forward declaration of Token. Thanks to Martin Doucha for pointing this out

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

15 years agoEnhance debug information for block literals. Radar 6867696
Mike Stump [Thu, 14 May 2009 02:03:51 +0000 (02:03 +0000)]
Enhance debug information for block literals.  Radar 6867696

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

15 years agoWe need to specify the "linkage name" to the subprogram now that we
Daniel Dunbar [Thu, 14 May 2009 01:45:24 +0000 (01:45 +0000)]
We need to specify the "linkage name" to the subprogram now that we
emit the correct "display name". I suspect we need more work here, see
FIXME for example.

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

15 years agoAdd return type checking for overriding virtual functions. We currently don't check...
Anders Carlsson [Thu, 14 May 2009 01:09:04 +0000 (01:09 +0000)]
Add return type checking for overriding virtual functions. We currently don't check covariance but that's next.

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

15 years agoImplement explicit instantiations of member classes of class templates, e.g.,
Douglas Gregor [Thu, 14 May 2009 00:28:11 +0000 (00:28 +0000)]
Implement explicit instantiations of member classes of class templates, e.g.,

  template<typename T>
  struct X {
    struct Inner;
  };

  template struct X<int>::Inner;

This change is larger than it looks because it also fixes some
a problem with nested-name-specifiers and tags. We weren't requiring
the DeclContext associated with the scope specifier of a tag to be
complete. Therefore, when looking for something like "struct
X<int>::Inner", we weren't instantiating X<int>.

This, naturally, uncovered a problem with member pointers, where we
were requiring the left-hand side of a member pointer access
expression (e.g., x->*) to be a complete type. However, this is wrong:
the semantics of this expression does not require a complete type (EDG
agrees).

Stuart vouched for me. Blame him.

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

15 years agoLook for and diagnose missing sentinel argument on message
Fariborz Jahanian [Wed, 13 May 2009 23:20:50 +0000 (23:20 +0000)]
Look for and diagnose missing sentinel argument on message
dispatch arguments which have sentinel attribute.

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

15 years agoMake sure not to include the LLVM asm prefix in function names for
Daniel Dunbar [Wed, 13 May 2009 23:08:57 +0000 (23:08 +0000)]
Make sure not to include the LLVM asm prefix in function names for
debug info.

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

15 years agoNote that clang follows the MSVC definition for #pragma pack.
Daniel Dunbar [Wed, 13 May 2009 21:40:49 +0000 (21:40 +0000)]
Note that clang follows the MSVC definition for #pragma pack.

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

15 years agoAdd a test case to showcase a difference in #pragma pack handling
Daniel Dunbar [Wed, 13 May 2009 21:34:08 +0000 (21:34 +0000)]
Add a test case to showcase a difference in #pragma pack handling
compared to gcc. This is worrisome, but I believe we are doing the
"correct" thing, and if I recall correctly I previously verified this
versus MSVC.

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

15 years agoUse an iterator type for found_decls_begin/found_decls_end.
Anders Carlsson [Wed, 13 May 2009 21:22:06 +0000 (21:22 +0000)]
Use an iterator type for found_decls_begin/found_decls_end.

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

15 years agoAdd a new, more advanced CheckDerivedToBaseConversion that takes custom diagnostic...
Anders Carlsson [Wed, 13 May 2009 21:11:42 +0000 (21:11 +0000)]
Add a new, more advanced CheckDerivedToBaseConversion that takes custom diagnostic IDs.

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

15 years agoAdd some basic type checking for attributes ns_returns_retained and
Ted Kremenek [Wed, 13 May 2009 21:07:32 +0000 (21:07 +0000)]
Add some basic type checking for attributes ns_returns_retained and
cf_returns_retained. Currently this attribute can now be applied to any
Objective-C method or C function that returns a pointer or Objective-C object
type.

Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to
expect that the diagnostics infrastructure will add quotes around the attribute
name when appropriate. Alonq with this change, I modified the places where this
warning is issued to passed the attribute's IdentifierInfo* instead of having a
hard-coded C constant string.

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 13 May 2009 20:49:00 +0000 (20:49 +0000)]
Update checker build.

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

15 years agoExplicit instantiations of templates now instantiate the definitions
Douglas Gregor [Wed, 13 May 2009 20:28:22 +0000 (20:28 +0000)]
Explicit instantiations of templates now instantiate the definitions
of class members (recursively). Only member classes are actually
instantiated; the instantiation logic for member functions and
variables are just stubs.

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

15 years agoDisable access control by default. It can be enabled with the -faccess-control option...
Anders Carlsson [Wed, 13 May 2009 19:49:53 +0000 (19:49 +0000)]
Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.

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

15 years agoAdd PostStmt::getStmtAs(). This unbreaks the build.
Ted Kremenek [Wed, 13 May 2009 19:23:41 +0000 (19:23 +0000)]
Add PostStmt::getStmtAs().  This unbreaks the build.

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

15 years agoEnhance diagnostics value tracking logic for null dereferences and uninitialized...
Ted Kremenek [Wed, 13 May 2009 19:16:35 +0000 (19:16 +0000)]
Enhance diagnostics value tracking logic for null dereferences and uninitialized values.

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

15 years agoAdd ExplodedNode utility methods 'getLocationAs()' and 'getFirstPred()'
Ted Kremenek [Wed, 13 May 2009 19:14:06 +0000 (19:14 +0000)]
Add ExplodedNode utility methods 'getLocationAs()' and 'getFirstPred()'

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

15 years agoDriver: Emit an unsupported error on -iframework.
Daniel Dunbar [Wed, 13 May 2009 19:05:04 +0000 (19:05 +0000)]
Driver: Emit an unsupported error on -iframework.

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

15 years agoABI handling: Fix invalid assertion, it is possible for a valid
Daniel Dunbar [Wed, 13 May 2009 18:54:26 +0000 (18:54 +0000)]
ABI handling: Fix invalid assertion, it is possible for a valid
coercion to be specified which truncates padding bits. It would be
nice to still have the assert, but we don't have any API call for the
unpadding size of a type yet.

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

15 years agoImprove the semantic checking for explicit instantiations of
Douglas Gregor [Wed, 13 May 2009 18:28:20 +0000 (18:28 +0000)]
Improve the semantic checking for explicit instantiations of
templates. In particular:
  - An explicit instantiation can follow an implicit instantiation (we
  were improperly diagnosing this as an error, previously).
  - In C++0x, an explicit instantiation that follows an explicit
  specialization of the same template specialization is ignored. In
  C++98, we just emit an extension warning.
  - In C++0x, an explicit instantiation must be in a namespace
  enclosing the original template. C++98 has no such requirement.

Also, fixed a longstanding FIXME regarding the integral type that is
used for the size of a constant array type when it is being instantiated.

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

15 years agoFix crasher reported in PR 4209 caused by an invalid summary
Ted Kremenek [Wed, 13 May 2009 18:16:01 +0000 (18:16 +0000)]
Fix crasher reported in PR 4209 caused by an invalid summary
generation when EvalObjCMessageExpr() did not resolve the
ObjCInterfaceDecl* for a receiver when the receiver's symbolic value
wasn't being explicitly tracked.

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

15 years agoSome early declarations to support sentinel attribute on
Fariborz Jahanian [Wed, 13 May 2009 18:09:35 +0000 (18:09 +0000)]
Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.

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

15 years agoremove the obsolete -fprint-source-range-info option
Chris Lattner [Wed, 13 May 2009 17:08:18 +0000 (17:08 +0000)]
remove the obsolete -fprint-source-range-info option

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

15 years agoRemoved 4-letter :) word in comment.
Fariborz Jahanian [Wed, 13 May 2009 16:19:02 +0000 (16:19 +0000)]
Removed 4-letter :) word in comment.
Used simple array for Selector build.

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

15 years agoFix <rdar://problem/6880975> [format string] Assertion failed: (Arg < NumArgs &&...
Ted Kremenek [Wed, 13 May 2009 16:06:05 +0000 (16:06 +0000)]
Fix <rdar://problem/6880975> [format string] Assertion failed: (Arg < NumArgs && "Arg access out of range!").

For format string checking, only check the type of the format
specifier for non-vararg functions.

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

15 years agoFix crasher in CFRefCount.cpp reported by Nikita Zhuk due to recently added autorelea...
Ted Kremenek [Wed, 13 May 2009 07:12:33 +0000 (07:12 +0000)]
Fix crasher in CFRefCount.cpp reported by Nikita Zhuk due to recently added autorelease tracking.

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

15 years agoFix rdar://6880630 - # in _Pragma does not start a preprocessor directive.
Chris Lattner [Wed, 13 May 2009 06:10:29 +0000 (06:10 +0000)]
Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.

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

15 years agoconvert test to use -verify
Chris Lattner [Wed, 13 May 2009 06:07:25 +0000 (06:07 +0000)]
convert test to use -verify

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

15 years agorename test
Chris Lattner [Wed, 13 May 2009 06:07:04 +0000 (06:07 +0000)]
rename test

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

15 years agoFix rdar://6880951 by rejecting vectors of vectors.
Chris Lattner [Wed, 13 May 2009 05:13:44 +0000 (05:13 +0000)]
Fix rdar://6880951 by rejecting vectors of vectors.
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers.  This should
probably be rethought, I'll file a bugzilla.

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

15 years agoreject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
Chris Lattner [Wed, 13 May 2009 05:02:08 +0000 (05:02 +0000)]
reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
rdar://6880104

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

15 years agoeli correctly points out that this code is dead, just rip it out for
Chris Lattner [Wed, 13 May 2009 04:52:12 +0000 (04:52 +0000)]
eli correctly points out that this code is dead, just rip it out for
now until someone does it right

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

15 years agoimplement __sync_synchronize and __sync_lock_release,
Chris Lattner [Wed, 13 May 2009 04:46:13 +0000 (04:46 +0000)]
implement __sync_synchronize and __sync_lock_release,
rdar://6880573

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

15 years agoadd support for __sync_nand_and_fetch and __sync_fetch_and_nand,
Chris Lattner [Wed, 13 May 2009 04:37:52 +0000 (04:37 +0000)]
add support for __sync_nand_and_fetch and __sync_fetch_and_nand,
rdar://6880573

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

15 years agoFix rdar://6880874 - [sema] crash on array types with different index sizes
Chris Lattner [Wed, 13 May 2009 04:12:56 +0000 (04:12 +0000)]
Fix rdar://6880874 - [sema] crash on array types with different index sizes

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

15 years agoFix rdar://6881069, a crash on a form of vector_size that we
Chris Lattner [Wed, 13 May 2009 04:00:12 +0000 (04:00 +0000)]
Fix rdar://6881069, a crash on a form of vector_size that we
don't support.  While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.

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

15 years agoFix rdar://6880259 - invalid function name in block call (__NSConcreteGlobalBlock2)
Chris Lattner [Wed, 13 May 2009 02:50:56 +0000 (02:50 +0000)]
Fix rdar://6880259 - invalid function name in block call (__NSConcreteGlobalBlock2)
by using the appropriate CGM interface instead of directly creating a global.

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

15 years agoWhen we expect two arguments but have zero, make sure to add
Chris Lattner [Wed, 13 May 2009 00:55:26 +0000 (00:55 +0000)]
When we expect two arguments but have zero, make sure to add
two empty arguments.  Also, add an assert so that this bug
manifests as an assertion failure, not a valgrind problem.

This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion

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

15 years agoChanged wording of warning when attribute is on
Fariborz Jahanian [Wed, 13 May 2009 00:47:33 +0000 (00:47 +0000)]
Changed wording of warning when attribute is on
method definition.

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

15 years agoSemantic analysis for explicit instantiation of class templates. We
Douglas Gregor [Wed, 13 May 2009 00:25:59 +0000 (00:25 +0000)]
Semantic analysis for explicit instantiation of class templates. We
still aren't instantiating the definitions of class template members,
and core issues 275 and 259 will both affect the checking that we do
for explicit instantiations (but are not yet implemented).

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

15 years agoTweak wording
Daniel Dunbar [Wed, 13 May 2009 00:23:53 +0000 (00:23 +0000)]
Tweak wording

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

15 years agoImplement parsing for explicit instantiations of class templates, e.g.,
Douglas Gregor [Tue, 12 May 2009 23:25:50 +0000 (23:25 +0000)]
Implement parsing for explicit instantiations of class templates, e.g.,

  template class X<int>;

This also cleans up the propagation of template information through
declaration parsing, which is used to improve some diagnostics.

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

15 years agoNote a few more unsupported language extensions.
Daniel Dunbar [Tue, 12 May 2009 23:12:07 +0000 (23:12 +0000)]
Note a few more unsupported language extensions.

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

15 years agoUpdate checker build.
Ted Kremenek [Tue, 12 May 2009 22:44:02 +0000 (22:44 +0000)]
Update checker build.

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

15 years agoimprove the diagnostic for uses of the GCC "global variable in a register" extension.
Chris Lattner [Tue, 12 May 2009 21:44:00 +0000 (21:44 +0000)]
improve the diagnostic for uses of the GCC "global variable in a register" extension.
This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension

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

15 years agoParser::ParseDeclarationOrFunctionDefinition no longer needs to accept
Douglas Gregor [Tue, 12 May 2009 21:43:46 +0000 (21:43 +0000)]
Parser::ParseDeclarationOrFunctionDefinition no longer needs to accept
template parameters.

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

15 years agoMethod attributes may only be specified on method
Fariborz Jahanian [Tue, 12 May 2009 21:36:23 +0000 (21:36 +0000)]
Method attributes may only be specified on method
declarations.

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

15 years agoRefactor the parsing of declarations so that template declarations can
Douglas Gregor [Tue, 12 May 2009 21:31:51 +0000 (21:31 +0000)]
Refactor the parsing of declarations so that template declarations can
parse just a single declaration and provide a reasonable diagnostic
when the "only one declarator per template declaration" rule is
violated. This eliminates some ugly, ugly hackery where we used to
require thatn the layout of a DeclGroup of a single element be the
same as the layout of a single declaration.

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

15 years agoimplement l-value codegen of comma expr
Chris Lattner [Tue, 12 May 2009 21:28:12 +0000 (21:28 +0000)]
implement l-value codegen of comma expr

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

15 years agopush GlobalDecl through enough of the CodeGenModule interfaces
Chris Lattner [Tue, 12 May 2009 21:21:08 +0000 (21:21 +0000)]
push GlobalDecl through enough of the CodeGenModule interfaces
to allow us to support generation of deferred ctors/dtors.
It looks like codegen isn't emitting a call to the dtor in
member-functions.cpp:test2, but when it does, its body should
get emitted.

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

15 years agoadd an initial stab at emitting deferred c++ inline functions. This handles static
Chris Lattner [Tue, 12 May 2009 21:02:27 +0000 (21:02 +0000)]
add an initial stab at emitting deferred c++ inline functions.  This handles static
functions and methods declared inline, but not ctors/dtors or methods not declared
inline (apparently my previous patch wasn't good enough).

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

15 years agocleanups, no functionality change.
Chris Lattner [Tue, 12 May 2009 20:58:15 +0000 (20:58 +0000)]
cleanups, no functionality change.

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