]> granicus.if.org Git - clang/log
clang
16 years agoModified format-string checking to not emit a warning when all of the
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.

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

16 years agosimplify some code, using new scoped_ptr support. Fix a bug in the
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.

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

16 years agoFinish hooking up the scaffolding for headermaps. They can now do everything
Chris Lattner [Mon, 17 Dec 2007 18:44:09 +0000 (18:44 +0000)]
Finish hooking up the scaffolding for headermaps.  They can now do everything
except resolve lookups.

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

16 years agoFormat string checker: asprintf does not pass argumnents via va_list.
Ted Kremenek [Mon, 17 Dec 2007 18:38:31 +0000 (18:38 +0000)]
Format string checker: asprintf does not pass argumnents via va_list.

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

16 years agoStart reading the headermap header, drop the 'errorstr' argument to
Chris Lattner [Mon, 17 Dec 2007 18:34:53 +0000 (18:34 +0000)]
Start reading the headermap header, drop the 'errorstr' argument to
the create method.

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

16 years agoAlso fixed similar regression for class methods, as well as more indentations.
Fariborz Jahanian [Mon, 17 Dec 2007 18:07:01 +0000 (18:07 +0000)]
Also fixed similar regression for class methods, as well as more indentations.

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

16 years agoSink getName into DirectoryLookup to simplify the client in clang.
Chris Lattner [Mon, 17 Dec 2007 17:57:27 +0000 (17:57 +0000)]
Sink getName into DirectoryLookup to simplify the client in clang.

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

16 years agoFixed a regression caused by refactoring of some meta-data generation routines using...
Fariborz Jahanian [Mon, 17 Dec 2007 17:56:10 +0000 (17:56 +0000)]
Fixed a regression caused by refactoring of some meta-data generation routines using iteratgors.
Also fixed indentation problems.

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

16 years agoFixed 80 col violation.
Ted Kremenek [Mon, 17 Dec 2007 17:50:39 +0000 (17:50 +0000)]
Fixed 80 col violation.

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

16 years agoAdded driver option -Wno-format-nonliteral to silence format string related
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).

Patch provided by Shantonu Sen.

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

16 years agoUnbreak -v with framework paths. Patch by Shantonu Sen.
Chris Lattner [Mon, 17 Dec 2007 17:42:26 +0000 (17:42 +0000)]
Unbreak -v with framework paths.  Patch by Shantonu Sen.

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

16 years agoFixed another case where sizeof() returns the size in bytes, not bits.
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):

  r44316 (http://llvm.org/viewvc/llvm-project?rev=44316&view=rev).

Patch provided by Nuno Lopes.

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

16 years agoadd headermap.cpp
Chris Lattner [Mon, 17 Dec 2007 08:22:46 +0000 (08:22 +0000)]
add headermap.cpp

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

16 years agofinish stubbing out support for HeaderMap. Now we just need an implementation!
Chris Lattner [Mon, 17 Dec 2007 08:17:39 +0000 (08:17 +0000)]
finish stubbing out support for HeaderMap.  Now we just need an implementation!

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

16 years agorefactor an better comment framework lookup code. This moves it from
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.

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

16 years agoas it turns out, frameworks and headermaps are orthogonal. Make this so in
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.

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

16 years agoadd a portability fixme.
Chris Lattner [Mon, 17 Dec 2007 06:51:34 +0000 (06:51 +0000)]
add a portability fixme.

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

16 years agoteach RemoveDuplicates about header maps.
Chris Lattner [Mon, 17 Dec 2007 06:44:29 +0000 (06:44 +0000)]
teach RemoveDuplicates about header maps.

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

16 years agoStep #1 in adding headermap support to clang.
Chris Lattner [Mon, 17 Dec 2007 06:36:45 +0000 (06:36 +0000)]
Step #1 in adding headermap support to clang.

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

16 years agorearrange some code and make it more efficient.
Chris Lattner [Mon, 17 Dec 2007 05:59:27 +0000 (05:59 +0000)]
rearrange some code and make it more efficient.

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

16 years agoadd a hack so that codegen doesn't abort on missing sema of initializers, now
Chris Lattner [Mon, 17 Dec 2007 05:17:42 +0000 (05:17 +0000)]
add a hack so that codegen doesn't abort on missing sema of initializers, now
we emit stuff like this:

abort on missing sema of initializers, now
we emit stuff like this:

t3.c:1:24: warning: cannot codegen this initializer yet
const char x[2][4] = { { 'a', 'b', '\0', '\0' }, { 'c', 'd', 'e', '\0' } };
                       ^~~~~~~~~~~~~~~~~~~~~~~~

This should be removed when sema is finished.

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

16 years agoUpdate to use new PointerType::getUnqual() api.
Christopher Lamb [Mon, 17 Dec 2007 01:11:20 +0000 (01:11 +0000)]
Update to use new PointerType::getUnqual() api.

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

16 years agoStart generating SSE intrinsics.
Anders Carlsson [Sun, 16 Dec 2007 22:33:50 +0000 (22:33 +0000)]
Start generating SSE intrinsics.

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

16 years agoSema::ActOnMemberReferenceExpr() needs to perform the default conversions.
Steve Naroff [Sun, 16 Dec 2007 21:42:28 +0000 (21:42 +0000)]
Sema::ActOnMemberReferenceExpr() needs to perform the default conversions.

Bug and test case provided by Carl Lewis.

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

16 years agoswtich to smallptrset, which is more efficient than std::set.
Chris Lattner [Sat, 15 Dec 2007 23:20:07 +0000 (23:20 +0000)]
swtich to smallptrset, which is more efficient than std::set.

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

16 years agomake clang -v output more similar to gcc's -v output.
Chris Lattner [Sat, 15 Dec 2007 23:11:06 +0000 (23:11 +0000)]
make clang -v output more similar to gcc's -v output.

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

16 years agoWe now support all MMX intrinsics. SSE intrinsics are next.
Anders Carlsson [Sat, 15 Dec 2007 21:23:30 +0000 (21:23 +0000)]
We now support all MMX intrinsics. SSE intrinsics are next.

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

16 years agosimplify the interfaces to ProcessInputFile and InitializePreprocessor
Chris Lattner [Sat, 15 Dec 2007 20:48:40 +0000 (20:48 +0000)]
simplify the interfaces to ProcessInputFile and InitializePreprocessor

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

16 years agoRemoved "isSizeOfExpr" mode from StmtIterator. It turned out not to be
Ted Kremenek [Sat, 15 Dec 2007 00:39:18 +0000 (00:39 +0000)]
Removed "isSizeOfExpr" mode from StmtIterator.  It turned out not to be
so useful and introduced a few bugs.

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

16 years agoAdded "mode" to StmtIterator to record if the expression being iterated
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().

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

16 years ago- Remove getInstanceMethods/getClassMethods API on ObjcInterfaceDecl, ObjcProtocolDec...
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...

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

16 years agoAdded support to StmtIterator to traverse the size expression of a VLA type
Ted Kremenek [Fri, 14 Dec 2007 22:52:23 +0000 (22:52 +0000)]
Added support to StmtIterator to traverse the size expression of a VLA type
declared in a sizeof.  For example:

 sizeof(int[foo()]);

the expression "foo()" is an expression that is executed during the evaluation
of sizeof.

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

16 years agoSimplify the vector code. Add more shift intrinsics.
Anders Carlsson [Fri, 14 Dec 2007 17:48:24 +0000 (17:48 +0000)]
Simplify the vector code. Add more shift intrinsics.

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

16 years agoIE Menu Problem...
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)

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

16 years agoArray subscription in aggregate expression
Seo Sanghyeon [Fri, 14 Dec 2007 02:04:12 +0000 (02:04 +0000)]
Array subscription in aggregate expression

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

16 years agoImplement dereference operator in aggregate expression
Seo Sanghyeon [Fri, 14 Dec 2007 01:09:11 +0000 (01:09 +0000)]
Implement dereference operator in aggregate expression

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

16 years agoCFG bug fix: for sizeof(expressions), don't expand the control-flow
Ted Kremenek [Thu, 13 Dec 2007 22:44:18 +0000 (22:44 +0000)]
CFG bug fix: for sizeof(expressions), don't expand the control-flow
of "expressions", since they are not really evaluated.

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

16 years agoPatch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceType
Fariborz Jahanian [Thu, 13 Dec 2007 20:47:42 +0000 (20:47 +0000)]
Patch to make ObjcQualifiedInterfaceType inherit ObjcInterfaceType

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

16 years agoSema::ActOnFinishFunctionBody(): Since we no longer synthesize a FunctionDecl for...
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.

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

16 years agoAdd hack to SourceManager to support missing source files during
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.

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

16 years agoAdd check in the driver to see if a serialized AST file has been successfully
Ted Kremenek [Thu, 13 Dec 2007 18:11:11 +0000 (18:11 +0000)]
Add check in the driver to see if a serialized AST file has been successfully
deserialized.

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

16 years agoChanged set of top-level decls from a list to a vector.
Ted Kremenek [Thu, 13 Dec 2007 17:54:02 +0000 (17:54 +0000)]
Changed set of top-level decls from a list to a vector.

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

16 years agoChanged -serialize-ast to not create a temporary directory, but instead
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.

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

16 years agoSet target data layout info in module.
Chris Lattner [Thu, 13 Dec 2007 17:34:31 +0000 (17:34 +0000)]
Set target data layout info in module.

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

16 years agotypo
Chris Lattner [Thu, 13 Dec 2007 17:27:09 +0000 (17:27 +0000)]
typo

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

16 years agodebug info too.
Chris Lattner [Thu, 13 Dec 2007 17:25:36 +0000 (17:25 +0000)]
debug info too.

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

16 years agoMinor spelling; punctuation correction.
Ted Kremenek [Thu, 13 Dec 2007 16:41:01 +0000 (16:41 +0000)]
Minor spelling; punctuation correction.

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

16 years agoGrammar fix: correct ' usage.
Bill Wendling [Thu, 13 Dec 2007 09:57:40 +0000 (09:57 +0000)]
Grammar fix: correct ' usage.

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

16 years agominor cleanups
Chris Lattner [Thu, 13 Dec 2007 07:47:54 +0000 (07:47 +0000)]
minor cleanups

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

16 years agoadd some builtins.
Chris Lattner [Thu, 13 Dec 2007 07:41:58 +0000 (07:41 +0000)]
add some builtins.

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

16 years agosimplify some code.
Chris Lattner [Thu, 13 Dec 2007 07:34:23 +0000 (07:34 +0000)]
simplify some code.

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

16 years agoDon't do integer promotions of LHS for compound shift assignment. The LHS has to...
Chris Lattner [Thu, 13 Dec 2007 07:28:16 +0000 (07:28 +0000)]
Don't do integer promotions of LHS for compound shift assignment.  The LHS has to be a modifiable lvalue.

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

16 years agoremove some dead styles.
Chris Lattner [Thu, 13 Dec 2007 06:55:59 +0000 (06:55 +0000)]
remove some dead styles.

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

16 years agonuke hte status page.
Chris Lattner [Thu, 13 Dec 2007 06:55:02 +0000 (06:55 +0000)]
nuke hte status page.

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

16 years agoadd a bunch of open projects
Chris Lattner [Thu, 13 Dec 2007 06:41:15 +0000 (06:41 +0000)]
add a bunch of open projects

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

16 years agoUpdated serialization of ParmVarDecl to serialize out objcDeclQualifier.
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.

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

16 years agosplit get_involved into two pages: get_started and get_involved.
Chris Lattner [Thu, 13 Dec 2007 06:20:15 +0000 (06:20 +0000)]
split get_involved into two pages: get_started and get_involved.

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

16 years agowrap to 80 cols, many fixes to markup.
Chris Lattner [Thu, 13 Dec 2007 05:42:27 +0000 (05:42 +0000)]
wrap to 80 cols, many fixes to markup.

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

16 years agoFor uninitialized values analysis, added special treatment for declarations
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)

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

16 years agoFix file header.
Chris Lattner [Thu, 13 Dec 2007 05:02:35 +0000 (05:02 +0000)]
Fix file header.

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

16 years agoFixed bug in live-variable analysis and uninitialized-values analysis where
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)

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

16 years agouse new interface.
Chris Lattner [Thu, 13 Dec 2007 02:05:09 +0000 (02:05 +0000)]
use new interface.

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

16 years agoadd a helper method.
Chris Lattner [Thu, 13 Dec 2007 01:59:49 +0000 (01:59 +0000)]
add a helper method.

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

16 years agoAdd assert to detect incomplete implementation work.
Devang Patel [Thu, 13 Dec 2007 01:24:16 +0000 (01:24 +0000)]
Add assert to detect incomplete implementation work.

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

16 years agoMoved ObjcDeclQualifier to ParmVarDecl from VarDecl.
Fariborz Jahanian [Thu, 13 Dec 2007 00:54:18 +0000 (00:54 +0000)]
Moved ObjcDeclQualifier to ParmVarDecl from VarDecl.
Ted, this change necessitates (de)/serialization of ParmVarDecl.

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

16 years agobuiltin id 0 is invalid, don't use a slot for it.
Chris Lattner [Thu, 13 Dec 2007 00:38:03 +0000 (00:38 +0000)]
builtin id 0 is invalid, don't use a slot for it.

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

16 years agoImplemented -serialize-ast option for the driver. This is not really tested
Ted Kremenek [Thu, 13 Dec 2007 00:37:31 +0000 (00:37 +0000)]
Implemented -serialize-ast option for the driver.  This is not really tested
and is a work in progress.

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

16 years agoFixed test to match the new diagnostic text.
Fariborz Jahanian [Thu, 13 Dec 2007 00:16:34 +0000 (00:16 +0000)]
Fixed test to match the new diagnostic text.

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

16 years agoConcatenation of objc strings.
Fariborz Jahanian [Wed, 12 Dec 2007 23:55:49 +0000 (23:55 +0000)]
Concatenation of objc strings.

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

16 years agofix off-by-one error.
Chris Lattner [Wed, 12 Dec 2007 23:46:36 +0000 (23:46 +0000)]
fix off-by-one error.

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

16 years agoImplemented prototype mode where the driver can operate on serialized ASTs
Ted Kremenek [Wed, 12 Dec 2007 23:41:08 +0000 (23:41 +0000)]
Implemented prototype mode where the driver can operate on serialized ASTs
instead of source files.

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

16 years agoTargetInfo no longer includes a reference to SourceManager.
Ted Kremenek [Wed, 12 Dec 2007 22:39:36 +0000 (22:39 +0000)]
TargetInfo no longer includes a reference to SourceManager.

Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:

    FullLoc.getManager().someMethod(FullLoc.getLocation());

instead we have:

    FullLoc.someMethod();

Modified TextDiagnostics (and related classes) to use this short-hand.

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

16 years agoEncode enumeral types.
Steve Naroff [Wed, 12 Dec 2007 22:30:11 +0000 (22:30 +0000)]
Encode enumeral types.

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

16 years agoRemoved "NULL" from default construction of FullSourceLoc (compilation errors on
Ted Kremenek [Wed, 12 Dec 2007 19:39:40 +0000 (19:39 +0000)]
Removed "NULL" from default construction of FullSourceLoc (compilation errors on
some systems).

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

16 years agoconstified getFullLoc().
Ted Kremenek [Wed, 12 Dec 2007 18:55:29 +0000 (18:55 +0000)]
constified getFullLoc().

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

16 years agoChanges to FullSourceLoc:
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().

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

16 years agoRenamed getFullSourceLoc() -> getFullLoc().
Ted Kremenek [Wed, 12 Dec 2007 18:46:37 +0000 (18:46 +0000)]
Renamed getFullSourceLoc() -> getFullLoc().

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

16 years agoAdded method: Preprocessor::getFullSourceLoc. Used by clients of Preprocessor
Ted Kremenek [Wed, 12 Dec 2007 18:41:40 +0000 (18:41 +0000)]
Added method: Preprocessor::getFullSourceLoc.  Used by clients of Preprocessor
to get a FullSourceLoc from a SourceLocation.

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

16 years agoRenamed FullContextSourceLocation to FullSourceLoc.
Ted Kremenek [Wed, 12 Dec 2007 18:32:04 +0000 (18:32 +0000)]
Renamed FullContextSourceLocation to FullSourceLoc.

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

16 years agoAdded utility static method to FullContextSourceLocation
Ted Kremenek [Wed, 12 Dec 2007 18:20:34 +0000 (18:20 +0000)]
Added utility static method to FullContextSourceLocation
for creating "invalid" location objects.

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

16 years agomake it a bit more clear in what way the ivar is consistent.
Chris Lattner [Wed, 12 Dec 2007 18:19:52 +0000 (18:19 +0000)]
make it a bit more clear in what way the ivar is consistent.

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

16 years agoadd an ivar_size() method that never returns -1.
Chris Lattner [Wed, 12 Dec 2007 18:19:33 +0000 (18:19 +0000)]
add an ivar_size() method that never returns -1.

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

16 years agoConstified a predicate method.
Ted Kremenek [Wed, 12 Dec 2007 18:18:05 +0000 (18:18 +0000)]
Constified a predicate method.

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

16 years agoAdded class FullContextSourceLocation: a tuple class that
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.

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

16 years agosimplify some code, bump j. This fixes the remaining test failures.
Chris Lattner [Wed, 12 Dec 2007 18:11:49 +0000 (18:11 +0000)]
simplify some code, bump j.  This fixes the remaining test failures.

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

16 years agoMoved construction of TargetInfo objects out of the Driver
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.

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

16 years agohandle the -1'ness of undefined lists
Chris Lattner [Wed, 12 Dec 2007 18:02:31 +0000 (18:02 +0000)]
handle the -1'ness of undefined lists

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

16 years agounbreak the build. I'm still working on test failures.
Chris Lattner [Wed, 12 Dec 2007 17:58:05 +0000 (17:58 +0000)]
unbreak the build.  I'm still working on test failures.

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

16 years agofix typo
Chris Lattner [Wed, 12 Dec 2007 08:17:45 +0000 (08:17 +0000)]
fix typo

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

16 years agomore cleanups changing things like getInstanceVariables to iterators.
Chris Lattner [Wed, 12 Dec 2007 07:56:42 +0000 (07:56 +0000)]
more cleanups changing things like getInstanceVariables to iterators.

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

16 years agoresolve some fixmes and clean up some code by eliminating the get*Vars apis to some...
Chris Lattner [Wed, 12 Dec 2007 07:46:12 +0000 (07:46 +0000)]
resolve some fixmes and clean up some code by eliminating the get*Vars apis to some classes and use iterators instead.

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

16 years agostart cleaning up interfaces for objc bits and pieces by switching to an
Chris Lattner [Wed, 12 Dec 2007 07:30:05 +0000 (07:30 +0000)]
start cleaning up interfaces for objc bits and pieces by switching to an
iterator interface.

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

16 years agosplit objc pieces of SemaDecl.cpp out into SemaDeclObjC.cpp
Chris Lattner [Wed, 12 Dec 2007 07:09:47 +0000 (07:09 +0000)]
split objc pieces of SemaDecl.cpp out into SemaDeclObjC.cpp

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

16 years agoAdded back VisitDeclStmt() to the StmtDumper, essentially reverting r44920:
Ted Kremenek [Wed, 12 Dec 2007 06:59:42 +0000 (06:59 +0000)]
Added back VisitDeclStmt() to the StmtDumper, essentially reverting r44920:

http://llvm.org/viewvc/llvm-project?rev=44920&view=rev

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.

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

16 years agomove function to a more logical location, add its grammar productions.
Chris Lattner [Wed, 12 Dec 2007 06:56:32 +0000 (06:56 +0000)]
move function to a more logical location, add its grammar productions.

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

16 years agoremove todo
Chris Lattner [Wed, 12 Dec 2007 06:54:22 +0000 (06:54 +0000)]
remove todo

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

16 years agoRemoved VisitDeclStmt(). The initializers of a DeclStmt are now automatically
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.

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

16 years agoUnbreak -stats on cocoa.h
Chris Lattner [Wed, 12 Dec 2007 06:43:05 +0000 (06:43 +0000)]
Unbreak -stats on cocoa.h

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

16 years agoadd run lines.
Chris Lattner [Wed, 12 Dec 2007 06:22:14 +0000 (06:22 +0000)]
add run lines.

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

16 years agoadd run line
Chris Lattner [Wed, 12 Dec 2007 06:20:40 +0000 (06:20 +0000)]
add run line

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