Ted Kremenek
57315955d7
Update checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 05:59:34 +00:00
Ted Kremenek
725b747664
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
2009-05-15 05:34:49 +00:00
Ted Kremenek
85ac9349ea
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
2009-05-15 05:25:09 +00:00
Ted Kremenek
9a9e0d41e2
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
2009-05-15 04:20:31 +00:00
Ted Kremenek
621cc4ebcc
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
2009-05-15 04:07:18 +00:00
Ted Kremenek
07c015cbce
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
2009-05-15 02:46:13 +00:00
Ted Kremenek
1e63c29a2d
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
2009-05-15 02:05:25 +00:00
Ted Kremenek
ddb7babf44
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
2009-05-15 01:50:15 +00:00
Anders Carlsson
03d77760a5
Instantiate return statements.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 00:48:27 +00:00
Mike Stump
fd0e628aa8
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
2009-05-15 00:29:54 +00:00
Anders Carlsson
d19cd90b26
Add NullStmt::Clone and use it
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 00:21:21 +00:00
Anders Carlsson
137fa562ca
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
2009-05-15 00:15:26 +00:00
Anders Carlsson
7c98736d8c
Add SemaTemplateInstantiateExpr.cpp to Xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 00:10:12 +00:00
Douglas Gregor
b9f1b8d877
Implement template instantiation for DeclStmt
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 00:01:03 +00:00
Fariborz Jahanian
2574a68e5c
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
2009-05-14 23:52:54 +00:00
Douglas Gregor
e7a18c88b7
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
2009-05-14 23:40:54 +00:00
Douglas Gregor
54dabfca85
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
2009-05-14 23:26:13 +00:00
Anders Carlsson
77b7f1d4fb
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
2009-05-14 22:15:41 +00:00
Anders Carlsson
a75e8534f2
Improvements to the FunctionDecl getters/setters.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:46:00 +00:00
Douglas Gregor
48dd19b19d
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
2009-05-14 21:44:34 +00:00
Ted Kremenek
304376651e
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
2009-05-14 21:29:16 +00:00
Anders Carlsson
b5133c279f
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
2009-05-14 21:20:16 +00:00
Douglas Gregor
1eee0e753f
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
2009-05-14 21:06:31 +00:00
Anders Carlsson
67a1eadcf7
Fix a speling error.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:03:44 +00:00
Fariborz Jahanian
ffb0081d0c
updated comments.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 20:57:28 +00:00
Fariborz Jahanian
2f7c39246a
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
2009-05-14 20:53:39 +00:00
Anders Carlsson
c3a68b25cd
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
2009-05-14 19:52:19 +00:00
Sebastian Redl
9afe1308ed
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
2009-05-14 18:11:41 +00:00
Fariborz Jahanian
236673e8fb
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
2009-05-14 18:00:00 +00:00
Daniel Dunbar
1c1c736cb0
Avoid generating temp in source directory
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 17:00:11 +00:00
Daniel Dunbar
49f59ec45b
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
2009-05-14 16:42:16 +00:00
Douglas Gregor
501c5ce63c
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
2009-05-14 16:41:31 +00:00
Douglas Gregor
7633ab8045
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
2009-05-14 15:47:53 +00:00
Mike Stump
9bc093c930
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
2009-05-14 02:03:51 +00:00
Daniel Dunbar
bbd53af03e
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
2009-05-14 01:45:24 +00:00
Anders Carlsson
d7ba27dc56
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
2009-05-14 01:09:04 +00:00
Douglas Gregor
3f5b61c394
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
2009-05-14 00:28:11 +00:00
Fariborz Jahanian
88f1ba0f04
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
2009-05-13 23:20:50 +00:00
Daniel Dunbar
a289393513
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
2009-05-13 23:08:57 +00:00
Daniel Dunbar
9375ed13dc
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
2009-05-13 21:40:49 +00:00
Daniel Dunbar
1faf5baa2f
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
2009-05-13 21:34:08 +00:00
Anders Carlsson
6a502a3bc7
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
2009-05-13 21:22:06 +00:00
Anders Carlsson
d8f9cb03ad
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
2009-05-13 21:11:42 +00:00
Ted Kremenek
5dc53c9c23
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
2009-05-13 21:07:32 +00:00
Ted Kremenek
57dc4a3bb7
Update checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 20:49:00 +00:00
Douglas Gregor
a58861f649
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
2009-05-13 20:28:22 +00:00
Anders Carlsson
a33d9b4ebf
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
2009-05-13 19:49:53 +00:00
Ted Kremenek
6bad354120
Add PostStmt::getStmtAs(). This unbreaks the build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 19:23:41 +00:00
Ted Kremenek
0c31317a8d
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
2009-05-13 19:16:35 +00:00
Ted Kremenek
52c3196a89
Add ExplodedNode utility methods 'getLocationAs()' and 'getFirstPred()'
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 19:14:06 +00:00