Ted Kremenek [Mon, 17 Dec 2007 19:03:13 +0000 (19:03 +0000)]
Modified format-string checking to not emit a warning when all of the
following hold:
(1) A vprintf-like function is called that takes the argument list via a
via_list argument.
(2) The format string is a non-literal that is the parameter value of
the enclosing function, e.g:
void logmessage(const char *fmt,...) {
va_list ap;
va_start(ap,fmt);
fprintf(fmt,ap); // Do not emit a warning.
}
In the future this special case will be enhanced to consult the "format"
attribute attached to a function declaration instead of just allowing a blank
check for all function parameters to be used as format strings to vprintf-like
functions. This will happen when more support for attributes becomes
available.
Chris Lattner [Mon, 17 Dec 2007 18:59:44 +0000 (18:59 +0000)]
simplify some code, using new scoped_ptr support. Fix a bug in the
cross-endianness case, where we checked the version in the wrong endianness.
Amusingly, the GCC logic that detects mixed endianness hmaps and rejects
them is dead for this very reason.
Ted Kremenek [Mon, 17 Dec 2007 17:50:07 +0000 (17:50 +0000)]
Added driver option -Wno-format-nonliteral to silence format string related
warnings. This flag is the inverse of to GCC's -Wformat-nonliteral option (in
the clang driver, these warnings are on by default).
Ted Kremenek [Mon, 17 Dec 2007 17:38:43 +0000 (17:38 +0000)]
Fixed another case where sizeof() returns the size in bytes, not bits.
This parallels a previous patch (duplicate logic caused the bug to appear
in multiple locations):
Chris Lattner [Mon, 17 Dec 2007 08:13:48 +0000 (08:13 +0000)]
refactor an better comment framework lookup code. This moves it from
HeaderSearch into DirectoryLookup, as a particular framework lookup is
specific to the directory we are currently querying.
Chris Lattner [Mon, 17 Dec 2007 07:52:39 +0000 (07:52 +0000)]
as it turns out, frameworks and headermaps are orthogonal. Make this so in
the internal representation. This also fixes a bug where -I foo -F foo would
not search foo as both a normal and framework include dir.
Ted Kremenek [Fri, 14 Dec 2007 23:40:56 +0000 (23:40 +0000)]
Added "mode" to StmtIterator to record if the expression being iterated
over is the subexpression of a sizeof(expression). Different clients
will wish to handle iteration over such subexpressions differently, and can
now easily query if they are iterating over such statements using the
StmtIterator's inSizeOfExpr().
Steve Naroff [Fri, 14 Dec 2007 23:37:57 +0000 (23:37 +0000)]
- Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCategoryDecl. These methods are replaced by the respective iterators on each class.
- Add getInstanceMethodForSelector to ObjcInterfaceDecl, ObjcProtocolDecl, and ObjcCatgoryDecl. This hook will do a "shallow" lookup. This is a convenience method that reducing some of the iterator usage.
- Various changes to convert all clients to the above API's...
Kevin [Fri, 14 Dec 2007 05:47:49 +0000 (05:47 +0000)]
IE Menu Problem...
Originally, I included CSS hacks for IE.
However, my comments before the doctype was the reason IE was running in non-strict mode. I did not know this.
When Chris removed the comments, IE correctly went into strict mode and my IE hacks were no longer needed (the hacks were getting in the way now).
solution:
*) Make sure doctype is first on all files
*) removed all IE hacks from menu.css (since the doctype issue fixes IE)
Steve Naroff [Thu, 13 Dec 2007 18:18:56 +0000 (18:18 +0000)]
Sema::ActOnFinishFunctionBody(): Since we no longer synthesize a FunctionDecl for each method, remove the unconditional initialization to 0 and corresponding comment.
Ted Kremenek [Thu, 13 Dec 2007 18:12:10 +0000 (18:12 +0000)]
Add hack to SourceManager to support missing source files during
deserialization. Eventually this should be replaced with a lazy-reading
mechanism that only reads source files when they are needed by clients.
Ted Kremenek [Thu, 13 Dec 2007 17:50:11 +0000 (17:50 +0000)]
Changed -serialize-ast to not create a temporary directory, but instead
create a .ast file in the current working directory. This mirrors the behavior
of the -c option for gcc. Later we should add the ability to write the
serialized file anywhere.
Ted Kremenek [Thu, 13 Dec 2007 06:28:13 +0000 (06:28 +0000)]
Updated serialization of ParmVarDecl to serialize out objcDeclQualifier.
Previously this field was serialized out in VarDecl (a parent class), but
now the field belongs to ParmVarDecl.
Ted Kremenek [Thu, 13 Dec 2007 05:14:22 +0000 (05:14 +0000)]
For uninitialized values analysis, added special treatment for declarations
of array types. For things like:
char x[10];
we should treat "x" as being initialized, because the variable "x" really
refers to the memory block of the array. Clearly x[1] is uninitialized, but
expressions like "(char*) x" really do refer to an initialized value. This
simple dataflow analysis does not reason about the contents of arrays.
This fixes: PR 1859 (http://llvm.org/bugs/show_bug.cgi?id=1859)
Ted Kremenek [Thu, 13 Dec 2007 04:47:15 +0000 (04:47 +0000)]
Fixed bug in live-variable analysis and uninitialized-values analysis where
we incorrectly examine the expression within a sizeof() for use in computing
dataflow values.
This fixes: PR 1858 (http://llvm.org/bugs/show_bug.cgi?id=1858)
Ted Kremenek [Wed, 12 Dec 2007 18:54:21 +0000 (18:54 +0000)]
Changes to FullSourceLoc:
- Added cstor that takes no arguments to create an "invalid" location.
- Removed non-const version of getSourceManager().
- Renamed getSourceManager() to getManager.
- Remover operator SourceLocatio().
Ted Kremenek [Wed, 12 Dec 2007 18:16:46 +0000 (18:16 +0000)]
Added class FullContextSourceLocation: a tuple class that
contains both a SourceLocation and its associated
SourceManager. This class is useful for argument passing to
functions that expect both objects.
Ted Kremenek [Wed, 12 Dec 2007 18:05:32 +0000 (18:05 +0000)]
Moved construction of TargetInfo objects out of the Driver
and into the "Basic" library. TargetInfo objects are now
constructed from triples by calling the static method
TargetInfo::CreateTargetInfo.
Putting VisitDeclStmt() was motivated because it called DumpDeclarator(),
which printed out a little bit more information than just using the
child_iterator interface to visit the subexpressions of DeclStmt. To avoid
printing the initializers twice, DumpSubTree() now specially checks for
DeclStmts; in such cases it calls VisitDeclStmt() without using the
child_iterators to visit the subexpressions.
Ted Kremenek [Wed, 12 Dec 2007 06:44:12 +0000 (06:44 +0000)]
Removed VisitDeclStmt(). The initializers of a DeclStmt are now automatically
printed out by DumpSubTree() via the child_iterator interface. This fixes a
bug where the initializers were being dumped twice.