Chris Lattner [Mon, 3 Nov 2008 09:28:22 +0000 (09:28 +0000)]
Fix PR3001: if we have an error parsing an initializer, make sure to remove
the designator corresponding to it, otherwise Sema and later parsing will
get confused.
Ted Kremenek [Mon, 3 Nov 2008 07:44:16 +0000 (07:44 +0000)]
Simplify the functions HtmlEsape and ShellEscape. We now properly print out the following command line in the HTML output: scan-build gcc -x c /dev/null -c -Dfoo='"string abc"'
Cedric Venet [Sun, 2 Nov 2008 16:28:53 +0000 (16:28 +0000)]
Add header files to CMake build solution. It use globing so it doesn't need to be manually maintained, but it won't automatically detect a new header. I think this is a good compromise for the header files, since there presence in the solution is just an help for the user. Moreover, a new header is often introduced with a new cpp source file which need a makefile change, which will regenerate the solution and detect the new header.
Zhongxing Xu [Sun, 2 Nov 2008 12:13:30 +0000 (12:13 +0000)]
1. When a pointer to struct is used as an argument, GRSimpleVals::EvalCall()
sets the whole struct to Unknown. Then we cannot assume the V passed to
BindStruct() is always a CompoundVal. When it is an UnknownVal, we call
BindStructToVal(UnknownVal).
2. Change the signature of InitializeStructToUndefined() to BindStructToVal()
to reuse the code.
Eli Friedman [Sun, 2 Nov 2008 02:43:55 +0000 (02:43 +0000)]
More fallout from r58501: primary fix is some more corrections to make
the types for size_t and ptrdiff_t more accurate. I think all of these
are correct, but please compare the defines for __PTRDIFF_TYPE__ and
__SIZE_TYPE__ to gcc to double-check; this particularly applies to
those on BSD variants, since I'm not sure what they do here; I assume
here that they're the same as on Linux.
Fixes wchar_t to be "int", not "unsigned int" (which I think is
correct on everything but Windows).
Fixes ptrdiff_t to be "int" rather than "short" on PIC16; "short" is an
somewhat strange choice because it normally gets promoted, and it's not
consistent with the choice for size_t.
Douglas Gregor [Fri, 31 Oct 2008 16:23:19 +0000 (16:23 +0000)]
Implement basic support for converting constructors in user-defined
conversions.
Notes:
- Overload resolution for converting constructors need to prohibit
user-defined conversions (hence, the test isn't -verify safe yet).
- We still use hacks for conversions from a class type to itself.
This will be the case until we start implicitly declaring the appropriate
special member functions. (That's next on my list)
Sanjiv Gupta [Fri, 31 Oct 2008 09:52:39 +0000 (09:52 +0000)]
Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wchar
etc more generic. For some targets, long may not be equal to pointer size. For
example: PIC16 has int as i16, ptr as i16 but long as i32.
Also fixed a few build warnings in assert() functions in CFRefCount.cpp,
CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp.
Douglas Gregor [Fri, 31 Oct 2008 09:07:45 +0000 (09:07 +0000)]
Add support for parsing and representing C++ constructor declarations.
Notes:
- Constructors are never found by name lookup, so they'll never get
pushed into any scope. Instead, they are stored as an
OverloadedFunctionDecl in CXXRecordDecl for easy overloading.
- There's a new action isCurrentClassName that determines whether an
identifier is the name of the innermost class currently being defined;
we use this to identify the declarator-id grammar rule that refers to
a type-name.
- MinimalAction does *not* support parsing constructors.
- We now handle virtual and explicit function specifiers.
Daniel Dunbar [Fri, 31 Oct 2008 08:56:51 +0000 (08:56 +0000)]
"One" line fix for -parse-noop failure, "id" and several other things
were being treated as type names for non-Objective-C files.
- Other lines are just because MinimalAction didn't have access to
the LangOptions.
Ted Kremenek [Fri, 31 Oct 2008 05:48:42 +0000 (05:48 +0000)]
On Mac OS X, use TMPDIR as the default location to place analysis results. This is a more secure location for such files, and addresses <rdar://problem/6334220>.
Ted Kremenek [Fri, 31 Oct 2008 00:13:20 +0000 (00:13 +0000)]
Enhance path-sensitive return-of-stack-address check to print out the line number of a compound literal (whose address is being returned) instead of printing out the hex representation of the pointer address of the CompoundLiteralExpr.
Ted Kremenek [Thu, 30 Oct 2008 17:45:53 +0000 (17:45 +0000)]
Add iterator/reverse_iterator to InitListExpr for iteration over the subexpressions of an initializer list. This is basically the same as child_iterator except reverse iteration is possible (which will be used by GRExprEngine::VisitInitListExpr).
Ted Kremenek [Thu, 30 Oct 2008 17:44:46 +0000 (17:44 +0000)]
CompoundVal now uses an ImmutableList<SVal> to store its set of SVals. This change was motivated by the need to allow state-splitting in GRExprEngine::VisitInitListExpr. As a side-benefit, we no longer need to perform any copies of SVals when creating a CompoundSVal, and the profiling of CompoundSVal is now constant time.
Daniel Dunbar [Wed, 29 Oct 2008 22:36:39 +0000 (22:36 +0000)]
NeXT: Emit protocol objects lazily.
- That is, the metadata for a protocol is only emitted if that
protocol is actually used in the translation unit. This is
important because Objective-C headers frequently contain a large
number of protocol definitions, only a few of which will be used in
any given file.
Ted Kremenek [Wed, 29 Oct 2008 18:41:34 +0000 (18:41 +0000)]
Fix crash reported in PR2923 where a function declared using typeof(another_function) would have FunctionDecl::getNumParams() return the number of parameters in the original function type and not the number of parameters in the actual FunctionDecl.
Douglas Gregor [Wed, 29 Oct 2008 15:10:40 +0000 (15:10 +0000)]
Simplify and correct the check for function redefinitions. This does two things:
- Allows definitions of overloaded functions :)
- Eliminates extraneous error messages when we have a definition of a
function that isn't an overload but doesn't have exactly the same type
as the original.
Daniel Dunbar [Wed, 29 Oct 2008 08:50:02 +0000 (08:50 +0000)]
Workaround an LLVM bug where inlining functions with debug info breaks
code generation.
- For now, disable running the always inliner pass (at -O0) if we are
also generating debug information.
Daniel Dunbar [Wed, 29 Oct 2008 05:58:09 +0000 (05:58 +0000)]
Update FindSpecRefs to recognize named section references.
- Unfortunately, I don't have an easy way to map from named sections
to numbers nicely so they don't get page numbers or integrate in
the list well.
Eli Friedman [Wed, 29 Oct 2008 04:39:20 +0000 (04:39 +0000)]
Fix for PR2966: va_start/va_end use the *address* of the
va_list, not the value. Patch fixes an assert on
x86-64 and a wrong-code bug on x86. I'm not completely sure,
but I think it's a regression from r58306.
Does anyone run regression tests regularly on x86-64? The crash should
have been picked up there.