]> granicus.if.org Git - clang/log
clang
15 years agoccc: Organize long options together.
Daniel Dunbar [Fri, 23 Jan 2009 01:31:44 +0000 (01:31 +0000)]
ccc: Organize long options together.

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

15 years agoMake -ast-dump print Objective-C method declarations (and other
Douglas Gregor [Fri, 23 Jan 2009 01:10:18 +0000 (01:10 +0000)]
Make -ast-dump print Objective-C method declarations (and other
Objective-C declarations!) again. Fixes <rdar://problem/6517155>

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

15 years agoccc: Add support for several more aliases (--ansi, --assemble,
Daniel Dunbar [Fri, 23 Jan 2009 00:54:03 +0000 (00:54 +0000)]
ccc: Add support for several more aliases (--ansi, --assemble,
--assert, --classpath).
 - Requires providing some option parameters to over-ride rendering in
   order to match gcc. There may be a cleaner way to do this (probably
   by introducing a new option type for long JoinedOrSeparate forms).

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

15 years agoccc: Darwin/x86/link: Fix a few incompatibilities with gcc (missed
Daniel Dunbar [Fri, 23 Jan 2009 00:39:52 +0000 (00:39 +0000)]
ccc: Darwin/x86/link: Fix a few incompatibilities with gcc (missed
forwarding -s to linker, and was only taking last arg in some cases
when should have been taking all).

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

15 years agoSupport arithmetic on pointer-to-function types as a GNU
Douglas Gregor [Fri, 23 Jan 2009 00:36:41 +0000 (00:36 +0000)]
Support arithmetic on pointer-to-function types as a GNU
extension. Addresses clang PR/3371.

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

15 years agoccc: Add support for "alias" options.
Daniel Dunbar [Fri, 23 Jan 2009 00:14:46 +0000 (00:14 +0000)]
ccc: Add support for "alias" options.
 - Unlike groups (which gather distinct but related options), aliases
   are for options like '--all-warnings' which are effectively treated
   like some other option ('-Wall') both in the driver logic and when
   passing to tools.

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

15 years agoUpdate comment.
Chris Lattner [Fri, 23 Jan 2009 00:13:28 +0000 (00:13 +0000)]
Update comment.

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

15 years agoUpdated checker build.
Ted Kremenek [Fri, 23 Jan 2009 00:11:54 +0000 (00:11 +0000)]
Updated checker build.

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

15 years agoccc: Fix typo; isn't dynamic typing fun!
Daniel Dunbar [Fri, 23 Jan 2009 00:04:43 +0000 (00:04 +0000)]
ccc: Fix typo; isn't dynamic typing fun!

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

15 years agoFor now, return UnknownVal() in RegionStore::getElementsSize() for AnonTypedRegions...
Ted Kremenek [Thu, 22 Jan 2009 23:56:56 +0000 (23:56 +0000)]
For now, return UnknownVal() in RegionStore::getElementsSize() for AnonTypedRegions.  It wasn't really doing the right thing and was crashing on rdar-6442306-1.m.  This fix causes all path-sensitive test cases to pass with RegionStore.

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

15 years agoremove my gross #ifdef's, using portable abstractions now that the 32-bit
Chris Lattner [Thu, 22 Jan 2009 23:50:07 +0000 (23:50 +0000)]
remove my gross #ifdef's, using portable abstractions now that the 32-bit
load is always aligned.

I verified that the bswap doesn't occur in the assembly code on x86.

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

15 years agoAdd RegionStore support for the implicit object region that 'self' references. This...
Ted Kremenek [Thu, 22 Jan 2009 23:43:57 +0000 (23:43 +0000)]
Add RegionStore support for the implicit object region that 'self' references.  This causes tests 'ObjCProperties.m' and 'refcnt_naming.m' to now pass with RegionStore.

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

15 years agoReimplement the handling of the "current object" in designator
Douglas Gregor [Thu, 22 Jan 2009 23:26:18 +0000 (23:26 +0000)]
Reimplement the handling of the "current object" in designator
initializers, so that we are within the appropriate subobject after
we've processed a multi-designator designation. We're matching GCC and
EDG's behavior on all examples I've found thus far.

*Huge* thanks to Eli Friedman for pointing out my fundamental
misunderstanding of "current object" in the C99 spec.

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

15 years agoccc: Bug fix, driver logic was allowing child jobs to pipe output when
Daniel Dunbar [Thu, 22 Jan 2009 23:19:32 +0000 (23:19 +0000)]
ccc: Bug fix, driver logic was allowing child jobs to pipe output when
parent wasn't expecting it.

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

15 years agoDisable language extensions for the clang parser.
Steve Naroff [Thu, 22 Jan 2009 23:06:24 +0000 (23:06 +0000)]
Disable language extensions for the clang parser.

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

15 years agoUse NonFragileABI as name of new Next abi. More comments
Fariborz Jahanian [Thu, 22 Jan 2009 23:02:58 +0000 (23:02 +0000)]
Use NonFragileABI as name of new Next abi. More comments
for the new meta-data.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:53:05 +0000 (22:53 +0000)]
This test case now passes with RegionStore.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:51:46 +0000 (22:51 +0000)]
This test case now passes with RegionStore.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:50:46 +0000 (22:50 +0000)]
This test case now passes with RegionStore.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:49:49 +0000 (22:49 +0000)]
This test case now passes with RegionStore.

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

15 years agoEnhance test case to test RegionStore with -checker-cfref.
Ted Kremenek [Thu, 22 Jan 2009 22:46:40 +0000 (22:46 +0000)]
Enhance test case to test RegionStore with -checker-cfref.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:45:21 +0000 (22:45 +0000)]
This test case now passes with RegionStore.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:43:59 +0000 (22:43 +0000)]
This test case now passes with RegionStore.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:42:59 +0000 (22:42 +0000)]
This test case now passes with RegionStore.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:42:16 +0000 (22:42 +0000)]
This test case now passes with RegionStore.

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

15 years agoThis test case now passes with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 22:40:54 +0000 (22:40 +0000)]
This test case now passes with RegionStore.

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

15 years agoAdjust to api change.
Chris Lattner [Thu, 22 Jan 2009 20:57:52 +0000 (20:57 +0000)]
Adjust to api change.

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

15 years agoTest more array logic in outofbound.c
Ted Kremenek [Thu, 22 Jan 2009 20:36:33 +0000 (20:36 +0000)]
Test more array logic in outofbound.c

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

15 years agoFix RegionStore::getLValueElement() to handle the case when the base region is not...
Ted Kremenek [Thu, 22 Jan 2009 20:27:48 +0000 (20:27 +0000)]
Fix RegionStore::getLValueElement() to handle the case when the base region is not an ElementRegion (also do some cleanups of its core logic).
This gets array-struct.c to work with RegionStore.

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

15 years agoremove Read8/Read24, which are dead. Rename Read16/Read32 to be more
Chris Lattner [Thu, 22 Jan 2009 19:48:26 +0000 (19:48 +0000)]
remove Read8/Read24, which are dead.  Rename Read16/Read32 to be more
descriptive.

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

15 years agoinline Sema::getLangOptions, rdar://6515190. This speeds up
Chris Lattner [Thu, 22 Jan 2009 19:21:44 +0000 (19:21 +0000)]
inline Sema::getLangOptions, rdar://6515190.  This speeds up
fsyntax-only with PTH by 3%.

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

15 years agoThese test cases now pass with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 18:54:47 +0000 (18:54 +0000)]
These test cases now pass with RegionStore.

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

15 years agoThe 'misc-ps.m' test case now passes with RegionStore. One case needed to be split...
Ted Kremenek [Thu, 22 Jan 2009 18:53:15 +0000 (18:53 +0000)]
The 'misc-ps.m' test case now passes with RegionStore.  One case needed to be split out into 'misc-ps-basic-store.m' and 'misc-ps-region-store.m' because the behavior was different between the two store models (RegionStore flags an additional valid bug).

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

15 years agoSymbolReaper::isLive(SymbolRef) now always returns true for SymbolRegionRvalues becau...
Ted Kremenek [Thu, 22 Jan 2009 18:51:33 +0000 (18:51 +0000)]
SymbolReaper::isLive(SymbolRef) now always returns true for SymbolRegionRvalues because these represent the symbolic values for parameters/globals upon entry to the function.  These values are always ;live' because they represent constraints on the context of how the function was called.  This will be useful for both summary generation but is also necessary to get RegionStore's lazy-binding of locations to symbols to work in practice with RemoveDeadBindings.

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

15 years agoStatic analyzer: Remove a bunch of outdated SymbolData objects and
Ted Kremenek [Thu, 22 Jan 2009 18:23:34 +0000 (18:23 +0000)]
Static analyzer: Remove a bunch of outdated SymbolData objects and
their associated APIs.  We no longer need separate SymbolData objects
for fields, variables, etc.  Instead, we now associated symbols with
the "rvalue" of a MemRegion (i.e., the value stored at that region).
Now we only have two kinds of SymbolData objects: SymbolRegionRValue
and SymbolConjured.

This cleanup also makes the distinction between a SymbolicRegion and a
symbolic value that is a location much clearer.  A SymbolicRegion
represents a chunk of symbolic memory, while a symbolic location is
just a "pointer" with different possible values.  Without any specific
knowledge, a symbolic location resolves (i.e., via a dereference) to a
SymbolicRegion.  In the future, when we do better alias reasoning, a
symbolic location can become an alias for another location, thus
merging the constraints on the referred SymbolicRegion with the other
region.

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

15 years agoAdd a switch that allows disabling the smart pointers.
Sebastian Redl [Thu, 22 Jan 2009 17:31:11 +0000 (17:31 +0000)]
Add a switch that allows disabling the smart pointers.
Uncomment the define in Ownership.h to disable the smart pointers.
Disabled, the smart pointers no longer contain a pointer
to the action, and no longer have special destruction or
copying semantics. They are, compiler willing, raw
pointers or ActionResult equivalents.

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

15 years agoEXTWARNify the warning about unnamed typedefs of enums
Douglas Gregor [Thu, 22 Jan 2009 16:23:54 +0000 (16:23 +0000)]
EXTWARNify the warning about unnamed typedefs of enums

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

15 years agoAvoid creating .dir files in the installation area.
Mike Stump [Thu, 22 Jan 2009 02:53:03 +0000 (02:53 +0000)]
Avoid creating .dir files in the installation area.

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

15 years agoccc/clang: Mimic llvm-gcc initialization of LLVM backend based on gcc
Daniel Dunbar [Thu, 22 Jan 2009 01:55:46 +0000 (01:55 +0000)]
ccc/clang: Mimic llvm-gcc initialization of LLVM backend based on gcc
options (for example, to set relocation model or enable unwind table generation).

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

15 years agoInitial implementation of semantic analysis and ASTs for C99
Douglas Gregor [Thu, 22 Jan 2009 00:58:24 +0000 (00:58 +0000)]
Initial implementation of semantic analysis and ASTs for C99
designated initializers. This implementation should cover all of the
constraints in C99 6.7.8, including long, complex designations and
computing the size of incomplete array types initialized with a
designated initializer. Please see the new test-case and holler if you
find cases where this doesn't work.

There are still some wrinkles with GNU's anonymous structs and
anonymous unions (it isn't clear how these should work; we'll just
follow GCC's lead) and with designated initializers for the members of a
union. I'll tackle those very soon.

CodeGen is still nonexistent, and there's some leftover code in the
parser's representation of designators that I'll also need to clean up.

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

15 years agoMore refactoring of common API to the common class for
Fariborz Jahanian [Thu, 22 Jan 2009 00:37:21 +0000 (00:37 +0000)]
More refactoring of common API to the common class for
the two Next's objc runtimes. More comments.

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

15 years agoAllow creation of "dummy" compile units for debug information.
Daniel Dunbar [Thu, 22 Jan 2009 00:09:25 +0000 (00:09 +0000)]
Allow creation of "dummy" compile units for debug information.
 - Although gross, this is needed currently to ensure that we produce
   well formed debug information (to match pace with the assertions
   being added to DebugInfo in LLVM).

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

15 years agoMoved whole bunch of common APIs to the common class.
Fariborz Jahanian [Wed, 21 Jan 2009 23:34:32 +0000 (23:34 +0000)]
Moved whole bunch of common APIs to the common class.
No change in functionality.

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

15 years agoUpdate CmpDriver to report missing commands.
Daniel Dunbar [Wed, 21 Jan 2009 23:34:23 +0000 (23:34 +0000)]
Update CmpDriver to report missing commands.

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

15 years agoCombine two branches into one. No functionality change.
Ted Kremenek [Wed, 21 Jan 2009 22:58:50 +0000 (22:58 +0000)]
Combine two branches into one.  No functionality change.

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

15 years agoFix <rdar://problem/6512717> by correctly reading the right offset in the token data...
Ted Kremenek [Wed, 21 Jan 2009 22:41:38 +0000 (22:41 +0000)]
Fix <rdar://problem/6512717> by correctly reading the right offset in the token data in PTHLexer::getSourceLocation().

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

15 years agoFix Sema::Owned(ExprResult) to not use a ternary operator. Necessary to work around...
Steve Naroff [Wed, 21 Jan 2009 22:32:33 +0000 (22:32 +0000)]
Fix Sema::Owned(ExprResult) to not use a ternary operator. Necessary to work around a Visual Studio compiler bug.

Thanks to Doug Gregor for the suggestion.

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

15 years agoStatic Analyzer: Replace LiveSymbols/DeadSymbols sets with a new object called "Symbo...
Ted Kremenek [Wed, 21 Jan 2009 22:26:05 +0000 (22:26 +0000)]
Static Analyzer: Replace LiveSymbols/DeadSymbols sets with a new object called "SymbolReaper".  Right now it just consolidates the two and cleans up some client code, but shortly it will be used to enable "lazy computation" of live symbols for use with RegionStore.

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

15 years agoRefactoring ObjC Next's runtime classes in preparation for
Fariborz Jahanian [Wed, 21 Jan 2009 22:04:16 +0000 (22:04 +0000)]
Refactoring ObjC Next's runtime classes in preparation for
the new ObjC's abi.

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

15 years agoInline ParseOptionalTypeSpecifier into ParseDeclarationSpecifiers.
Chris Lattner [Wed, 21 Jan 2009 19:48:37 +0000 (19:48 +0000)]
Inline ParseOptionalTypeSpecifier into ParseDeclarationSpecifiers.
This avoids call overhead and extraneous switches when parsing
very simple declspecs like "int" "void" etc, which are pretty common :)

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

15 years agorevert the gnu objc patches, they regress codegen-gnu.m
Chris Lattner [Wed, 21 Jan 2009 19:37:47 +0000 (19:37 +0000)]
revert the gnu objc patches, they regress codegen-gnu.m

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

15 years agoRemoved alignment argument to delete operator. It isn't needed and Visual Studio...
Steve Naroff [Wed, 21 Jan 2009 19:34:14 +0000 (19:34 +0000)]
Removed alignment argument to delete operator. It isn't needed and Visual Studio is offended by it.

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

15 years agoAdd #line to make the Visual Studio compiler happy.
Steve Naroff [Wed, 21 Jan 2009 19:24:01 +0000 (19:24 +0000)]
Add #line to make the Visual Studio compiler happy.
Fixes <rdar://problem/6507668> clang ObjC rewriter: put #line statement at top of rewritten file

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

15 years agoswitch from getTypeAtIndex to getElementType. It is non-virtual
Chris Lattner [Wed, 21 Jan 2009 19:21:36 +0000 (19:21 +0000)]
switch from getTypeAtIndex to getElementType.  It is non-virtual
and more idiomatic.

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

15 years agoParseOptionalTypeSpecifier should consume a token if it returns true.
Chris Lattner [Wed, 21 Jan 2009 19:19:26 +0000 (19:19 +0000)]
ParseOptionalTypeSpecifier should consume a token if it returns true.

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

15 years agoFix objc type conversion issues with the GNU runtime, patch by
Chris Lattner [Wed, 21 Jan 2009 18:52:19 +0000 (18:52 +0000)]
Fix objc type conversion issues with the GNU runtime, patch by
David Chisnall

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

15 years agoccc: Handle a few long argument form (--) translations using option
Daniel Dunbar [Wed, 21 Jan 2009 18:49:34 +0000 (18:49 +0000)]
ccc: Handle a few long argument form (--) translations using option
groups, and fix misdeclaration of some -W options.

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

15 years agoDon't turn off blocks when compiling Obj-C code
Anders Carlsson [Wed, 21 Jan 2009 18:47:36 +0000 (18:47 +0000)]
Don't turn off blocks when compiling Obj-C code

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

15 years agoinitialialize some ivars in ctor.
Chris Lattner [Wed, 21 Jan 2009 18:45:48 +0000 (18:45 +0000)]
initialialize some ivars in ctor.

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

15 years agoalphebetize
Chris Lattner [Wed, 21 Jan 2009 18:26:45 +0000 (18:26 +0000)]
alphebetize

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

15 years agoccc: Add appropriate file search prefixes when on x86_64 Darwin, and
Daniel Dunbar [Wed, 21 Jan 2009 17:18:19 +0000 (17:18 +0000)]
ccc: Add appropriate file search prefixes when on x86_64 Darwin, and
look for crt3.o appropriately.

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

15 years agomerge two checks for identifiers in the pth loop into one.
Chris Lattner [Wed, 21 Jan 2009 07:50:06 +0000 (07:50 +0000)]
merge two checks for identifiers in the pth loop into one.

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

15 years agoa trivial micro optimization to save a load.
Chris Lattner [Wed, 21 Jan 2009 07:45:14 +0000 (07:45 +0000)]
a trivial micro optimization to save a load.

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

15 years agoAdd a bit to IdentifierInfo that acts as a simple predicate which
Chris Lattner [Wed, 21 Jan 2009 07:43:11 +0000 (07:43 +0000)]
Add a bit to IdentifierInfo that acts as a simple predicate which
tells us whether Preprocessor::HandleIdentifier needs to be called.
Because this method is only rarely needed, this saves a call and a
bunch of random checks.  This drops the time in HandleIdentifier
from 3.52ms to .98ms on cocoa.h on my machine.

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

15 years agosilence a couple unused variable 'result' warnings.
Chris Lattner [Wed, 21 Jan 2009 07:35:26 +0000 (07:35 +0000)]
silence a couple unused variable 'result' warnings.

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

15 years agoDon't crash on empty PTH files. This fixes <rdar://problem/6512714>.
Ted Kremenek [Wed, 21 Jan 2009 07:34:28 +0000 (07:34 +0000)]
Don't crash on empty PTH files.  This fixes <rdar://problem/6512714>.

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

15 years agoreally we only need on Read24!
Chris Lattner [Wed, 21 Jan 2009 07:28:57 +0000 (07:28 +0000)]
really we only need on Read24!

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

15 years agorevert my previous patch, it assumed endianness.
Chris Lattner [Wed, 21 Jan 2009 07:21:56 +0000 (07:21 +0000)]
revert my previous patch, it assumed endianness.

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

15 years agoThis test now passes using -analyzer-store-region.
Ted Kremenek [Wed, 21 Jan 2009 07:13:46 +0000 (07:13 +0000)]
This test now passes using -analyzer-store-region.

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

15 years agoThis test now passes using -analyzer-store-region.
Ted Kremenek [Wed, 21 Jan 2009 07:10:01 +0000 (07:10 +0000)]
This test now passes using -analyzer-store-region.

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

15 years agominor cleanups: now that tokens are 4-byte aligned in a PTH
Chris Lattner [Wed, 21 Jan 2009 07:06:08 +0000 (07:06 +0000)]
minor cleanups: now that tokens are 4-byte aligned in a PTH
file, just load them directly as ints.

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

15 years agoGet RegionStore to work with the retain/release checker and its test cases.
Ted Kremenek [Wed, 21 Jan 2009 06:57:53 +0000 (06:57 +0000)]
Get RegionStore to work with the retain/release checker and its test cases.

Because the RegionStore can reason about values beyond the reasoning power of BasicStore, this patch splits some of the test cases for the retain/release checker to have versions that are handled by RegionStore (more warnings) and BasicStore (less warnings).

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

15 years agoFix an inline asm sema bug that I introduced.
Anders Carlsson [Wed, 21 Jan 2009 06:27:20 +0000 (06:27 +0000)]
Fix an inline asm sema bug that I introduced.

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

15 years agoDon't look up decls with no name (such as parameters and unnamed tagged types),
Chris Lattner [Wed, 21 Jan 2009 02:38:50 +0000 (02:38 +0000)]
Don't look up decls with no name (such as parameters and unnamed tagged types),
this removes 4266 calls to LookupDecl.

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

15 years agoccc: Implement file & path searching.
Daniel Dunbar [Wed, 21 Jan 2009 02:03:52 +0000 (02:03 +0000)]
ccc: Implement file & path searching.
 - Toolchain is responsible for providing list of prefixes to search.

 - Implement -print-file-name=xxx and -print-prog-name=xxx driver options.

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

15 years agoFix more bugs I discovered
Anders Carlsson [Wed, 21 Jan 2009 01:49:39 +0000 (01:49 +0000)]
Fix more bugs I discovered

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

15 years agoUpdated checker build.
Ted Kremenek [Wed, 21 Jan 2009 01:41:30 +0000 (01:41 +0000)]
Updated checker build.

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

15 years agoccc: Add --analyze test case.
Daniel Dunbar [Wed, 21 Jan 2009 01:22:37 +0000 (01:22 +0000)]
ccc: Add --analyze test case.

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

15 years agoccc: Add --analyze driver mode (for running static analyzer).
Daniel Dunbar [Wed, 21 Jan 2009 01:07:49 +0000 (01:07 +0000)]
ccc: Add --analyze driver mode (for running static analyzer).

 - For now forces generation of plist files, need to think about the
   right interface.

 - Changed -fsyntax-only mode to be its own phase (more consistent).

 - Add -WA, for passing options verbatim to analyzer.

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

15 years agoStatic Analyzer: When generating plists for errors reports, generate one plist file...
Ted Kremenek [Wed, 21 Jan 2009 00:42:24 +0000 (00:42 +0000)]
Static Analyzer: When generating plists for errors reports, generate one plist file per translation unit that contains all of the diagnostics.

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

15 years agoCommented objective-c's metadata types. Minor clean up.
Fariborz Jahanian [Wed, 21 Jan 2009 00:39:53 +0000 (00:39 +0000)]
Commented objective-c's metadata types. Minor clean up.
No change in functionality.

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

15 years agoConvert expressions over to Sebastian's spiffy ASTContext::new() operator.
Steve Naroff [Wed, 21 Jan 2009 00:14:39 +0000 (00:14 +0000)]
Convert expressions over to Sebastian's spiffy ASTContext::new() operator.
No functionality change.

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

15 years agoccc: Unbreak -pipe handling broken in previous refactoring.
Daniel Dunbar [Wed, 21 Jan 2009 00:05:15 +0000 (00:05 +0000)]
ccc: Unbreak -pipe handling broken in previous refactoring.

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

15 years agoFix: <rdar://problem/6510344> [pth] PTH slows down regular lexer considerably (when...
Ted Kremenek [Tue, 20 Jan 2009 23:28:34 +0000 (23:28 +0000)]
Fix: <rdar://problem/6510344> [pth] PTH slows down regular lexer considerably (when it has substantial work)

Changes to IdentifierTable:
- High-level summary: StringMap never owns IdentifierInfos.  It just
references them.
- The string map now has StringMapEntry<IdentifierInfo*> instead of
  StringMapEntry<IdentifierInfo>.  The IdentifierInfo object is
  allocated using the same bump pointer allocator as used by the
  StringMap.

Changes to IdentifierInfo:
- Added an extra pointer to point to the
  StringMapEntry<IdentifierInfo*> in the string map.  This pointer
  will be null if the IdentifierInfo* is *only* used by the PTHLexer
  (that is it isn't in the StringMap).

Algorithmic changes:
- Non-PTH case:
   IdentifierInfo::get() will always consult the StringMap first to
   see if we have an IdentifierInfo object.  If that StringMapEntry
   references a null pointer, we allocate a new one from the BumpPtrAllocator
   and update the reference in the StringMapEntry.
- PTH case:
   We do the same lookup as with the non-PTH case, but if we don't get
   a hit in the StringMap we do a secondary lookup in the PTHManager for
   the IdentifierInfo.  If we don't find an IdentifierInfo we create a
   new one as in the non-PTH case.  If we do find and IdentifierInfo
   in the PTHManager, we update the StringMapEntry to refer to it so
   that the IdentifierInfo will be found on the next StringMap lookup.
   This way we only do a binary search in the PTH file at most once
   for a given IdentifierInfo.  This greatly speeds things up for source
   files containing a non-trivial amount of code.

Performance impact:
   While these changes do add some extra indirection in
   IdentifierTable to access an IdentifierInfo*, I saw speedups even
   in the non-PTH case as well.

   Non-PTH: For -fsyntax-only on Cocoa.h, we see a 6% speedup.
   PTH (with Cocoa.h in token cache): 11% speedup.

   I also did an experiment where we did -fsyntax-only on a source file
   including a large header and Cocoa.h, but the token cache did not
   contain the larger header.  For this file, we were seeing a performance
   *regression* when using PTH of 3% over non-PTH.  Now we are seeing
   a performance improvement of 9%!

Tests:
   The serialization tests are now failing.  I looked at this extensively,
   and I my belief is that this change is unmasking a bug rather than
   introducing a new one.  I have disabled the serialization tests for now.

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

15 years agoAdd -analyze action to run static analyzer, instead of inferring from
Daniel Dunbar [Tue, 20 Jan 2009 23:17:32 +0000 (23:17 +0000)]
Add -analyze action to run static analyzer, instead of inferring from
individual checker options.

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

15 years agoProvide a placement new taking an ASTContext argument.
Sebastian Redl [Tue, 20 Jan 2009 22:23:13 +0000 (22:23 +0000)]
Provide a placement new taking an ASTContext argument.
This allows more concise syntax when allocating an object using the ASTContext's allocator.
Convert a few allocations to this operator to for test purposes.

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

15 years agoFix ccclib building when building in a separate build tree.
Mike Stump [Tue, 20 Jan 2009 21:54:36 +0000 (21:54 +0000)]
Fix ccclib building when building in a separate build tree.

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

15 years agoFix some errors I noticed
Anders Carlsson [Tue, 20 Jan 2009 21:51:44 +0000 (21:51 +0000)]
Fix some errors I noticed

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

15 years agoccc: Allow downstream tools to be aware of final output name.
Daniel Dunbar [Tue, 20 Jan 2009 21:29:14 +0000 (21:29 +0000)]
ccc: Allow downstream tools to be aware of final output name.
 - This is a hack to allow the Darwin linker to get -final_output when
   doing universal builds; the mechanism should be generalized.

 - Handle multiple redundant -arch arguments correctly.

 - Forward -arch_multiple and -final_output to gcc when necessary.

 - Simplified implementation of derived gcc tools.

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

15 years agoFix make test when configuring for a seperate build directory.
Mike Stump [Tue, 20 Jan 2009 21:10:41 +0000 (21:10 +0000)]
Fix make test when configuring for a seperate build directory.

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

15 years agoFix a crash Anders' was seeing due to free'ing an invalid pointer
Chris Lattner [Tue, 20 Jan 2009 21:06:38 +0000 (21:06 +0000)]
Fix a crash Anders' was seeing due to free'ing an invalid pointer
caused by my previous commit.

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

15 years agoConvert more exprs to use ASTContext's Allocator.
Steve Naroff [Tue, 20 Jan 2009 21:06:31 +0000 (21:06 +0000)]
Convert more exprs to use ASTContext's Allocator.

When using a BumpPtrAllocator, this reduces malloc overhead from 2.2->1.9% (for Cocoa.h).

At this point, malloc() has dropped the fourth most expensive routine (behind Preprocessor::HandleIdentifier()).

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

15 years agoUse the ASTContext's allocator for FunctionTypeNoProto and TypeOfExpr
Douglas Gregor [Tue, 20 Jan 2009 21:02:13 +0000 (21:02 +0000)]
Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExpr

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

15 years agoImprovements to Sema of asm statements. Fixes <rdar://problem/6156893>
Anders Carlsson [Tue, 20 Jan 2009 20:49:22 +0000 (20:49 +0000)]
Improvements to Sema of asm statements. Fixes <rdar://problem/6156893>

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

15 years agoDetailed documentation for encoding of properties and a test
Fariborz Jahanian [Tue, 20 Jan 2009 20:04:12 +0000 (20:04 +0000)]
Detailed documentation for encoding of properties and a test
case.

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

15 years agoAllocate expresssions through ASTContext (still more work to do).
Steve Naroff [Tue, 20 Jan 2009 19:53:53 +0000 (19:53 +0000)]
Allocate expresssions through ASTContext (still more work to do).
Add debug hook to DeclContext.

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

15 years agoImproving on encoding of objective-c's property types. More to come.
Fariborz Jahanian [Tue, 20 Jan 2009 19:14:18 +0000 (19:14 +0000)]
Improving on encoding of objective-c's property types. More to come.

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

15 years agoOptimize Declarator to avoid malloc/free traffic for the argument list of a
Chris Lattner [Tue, 20 Jan 2009 19:11:22 +0000 (19:11 +0000)]
Optimize Declarator to avoid malloc/free traffic for the argument list of a
function DeclaratorChunk in common cases.  This uses a fixed array in
Declarator when it is small enough for the first function declarator chunk
in a declarator.

This eliminates all malloc/free traffic from DeclaratorChunk::getFunction
when running on Cocoa.h except for five functions: signal/bsd_signal/sigset,
which have multiple Function DeclChunk's, and
CFUUIDCreateWithBytes/CFUUIDGetConstantUUIDWithBytes, which take more than
16 arguments.

This patch was pair programmed with Steve.

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

15 years agoPixel font sizes are evil.
Eli Friedman [Tue, 20 Jan 2009 17:56:18 +0000 (17:56 +0000)]
Pixel font sizes are evil.

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

15 years agoSlight cleanup, and fix for va_arg on architectures where va_list is a
Eli Friedman [Tue, 20 Jan 2009 17:46:04 +0000 (17:46 +0000)]
Slight cleanup, and fix for va_arg on architectures where va_list is a
struct.

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