]> granicus.if.org Git - clang/log
clang
16 years agoAdded SSE4.1 packusdw
Mon P Wang [Tue, 9 Sep 2008 02:49:09 +0000 (02:49 +0000)]
Added SSE4.1 packusdw

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

16 years agoChange CodeGen to emit calls using (RValue,Type) list:
Daniel Dunbar [Tue, 9 Sep 2008 01:06:48 +0000 (01:06 +0000)]
Change CodeGen to emit calls using (RValue,Type) list:
 - Add CodeGenFunction::EmitAnyExprToTemp
   o Like EmitAnyExpr, but emits aggregates to a temporary location if
     none is available. Seems like this should be simpler (even aside
     from using first class aggregates).

 - Killed CodeGenFunction::EmitCallArg (just append the pair)

 - Conversion of RValues to actual call arguments is now isolated in
   CodeGenFunction::EmitCall.

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

16 years agoAdded SSE41 pmovsx pmovzx intrinsics
Mon P Wang [Tue, 9 Sep 2008 00:19:01 +0000 (00:19 +0000)]
Added SSE41 pmovsx pmovzx intrinsics

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

16 years agoFix a number of issues w.r.t. emission of global for functions and
Daniel Dunbar [Mon, 8 Sep 2008 23:44:31 +0000 (23:44 +0000)]
Fix a number of issues w.r.t. emission of global for functions and
aliases.
 - Attributes specific to a definition are only set when the
   definition is seen.
 - Alias generation is delayed until the end of the module; necessary
   since the alias may reference forward.
 - Fixes: PR2743, <rdr://6140807&6094512>
 - Improves: <rdr://6095112> (added XFAIL)

Also, print module on verification failures.

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

16 years agoRefactor parameter attribute handling:
Daniel Dunbar [Mon, 8 Sep 2008 21:33:45 +0000 (21:33 +0000)]
Refactor parameter attribute handling:
  - Add CGCall.h for dealing with ABI issues related to calls.
  - Add CGFunctionInfo and CGCallInfo for capturing ABI relevant
    information about functions and calls.
  - Isolate LLVM parameter attribute handling inside CGCall.cpp

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

16 years agoAdd ThreadSpecified bit to Decl.
Daniel Dunbar [Mon, 8 Sep 2008 20:05:47 +0000 (20:05 +0000)]
Add ThreadSpecified bit to Decl.
 - Patch from Kevin Tew.

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

16 years agoAdd missing RUN line
Daniel Dunbar [Mon, 8 Sep 2008 18:01:15 +0000 (18:01 +0000)]
Add missing RUN line

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

16 years agoSupport C++'s declaration-statement.
Argyrios Kyrtzidis [Sun, 7 Sep 2008 18:58:01 +0000 (18:58 +0000)]
Support C++'s declaration-statement.

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

16 years agorename libclangSEMA to libclangSema
Nico Weber [Sun, 7 Sep 2008 17:09:06 +0000 (17:09 +0000)]
rename libclangSEMA to libclangSema

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

16 years agoskip test if llvm-gcc is requires but not found on the path.
Nuno Lopes [Sat, 6 Sep 2008 16:42:14 +0000 (16:42 +0000)]
skip test if llvm-gcc is requires but not found on the path.
someone with llvm-gcc installed please test if the Codegen/function-attributes.c test isn't skip in your system. thanks.

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

16 years agoKey LLVM types for TagDecl's off of the clang Type, since there is now
Daniel Dunbar [Sat, 6 Sep 2008 02:26:43 +0000 (02:26 +0000)]
Key LLVM types for TagDecl's off of the clang Type, since there is now
a many-to-one relationship between TagDecl's and types.

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

16 years agoPer PR2773, define __USER_LABEL_PREFIX__ for x86-32 Linux and Windows.
Eli Friedman [Sat, 6 Sep 2008 01:37:51 +0000 (01:37 +0000)]
Per PR2773, define __USER_LABEL_PREFIX__ for x86-32 Linux and Windows.

If you're on some other platform, the correct definition for this macro
would be appreciated; to find the correct definition, just run the
following command:

echo | gcc -dM -E - | grep USER_LABEL_PREFIX

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

16 years agoMore type checking for blocks. Still incomplete (will hopefully finish up this weekend).
Steve Naroff [Fri, 5 Sep 2008 22:11:13 +0000 (22:11 +0000)]
More type checking for blocks. Still incomplete (will hopefully finish up this weekend).

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

16 years agoAdd comment back that Argiris pointed out that I mistakenly removed (the comments...
Ted Kremenek [Fri, 5 Sep 2008 17:39:33 +0000 (17:39 +0000)]
Add comment back that Argiris pointed out that I mistakenly removed (the comments below it were stale, so I accidently removed the whole thing).

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

16 years agoChange struct forward declarations and definitions to use unique RecordDecls, as...
Ted Kremenek [Fri, 5 Sep 2008 17:16:31 +0000 (17:16 +0000)]
Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it.

This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).

The motivation of this patch is as follows:
- Capture more source information, necessary for refactoring/rewriting clients.

- Pave the way to resolve ownership issues with RecordDecls with the forthcoming
  addition of DeclGroups.

Current caveats:
- Until DeclGroups are in place, we will leak RecordDecls not explicitly
  referenced by the AST.  For example:

    typedef struct { ... } x;

  The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
  refer to it.  This will be solved with DeclGroups.

- This patch also (temporarily) breaks CodeGen.  More below.

High-level changes:
- As before, TagType still refers to a TagDecl, but it doesn't own it.  When
  a struct/union/class is first referenced, a RecordType and RecordDecl are
  created for it, and the RecordType refers to that RecordDecl.  Later, if
  a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
  updated to point to the RecordDecl that defines the struct/union/class.

- TagDecl and RecordDecl now how a method 'getDefinition()' to return the
  TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
  enum/struct/class/union. This is useful from going from a RecordDecl* that
  defines a forward declaration to the RecordDecl* that provides the actual
  definition. Note that this also works for EnumDecls, except that in this case
  there is no distinction between forward declarations and definitions (yet).

- Clients should no longer assume that 'isDefinition()' returns true from a
  RecordDecl if the corresponding struct/union/class has been defined.
  isDefinition() only returns true if a particular RecordDecl is the defining
  Decl. Use 'getDefinition()' instead to determine if a struct has been defined.

- The main changes to Sema happen in ActOnTag. To make the changes more
  incremental, I split off the processing of enums and structs et al into two
  code paths. Enums use the original code path (which is in ActOnTag) and
  structs use the ActOnTagStruct. Eventually the two code paths will be merged,
  but the idea was to preserve the original logic both for comparison and not to
  change the logic for both enums and structs all at once.

- There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
  that correspond to the same type simply have a pointer to that type. If we
  need to figure out what are all the RecordDecls for a given type we can build
  a backmap.

- The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
  changes to RecordDecl. For some reason 'svn' marks the entire file as changed.

Why is CodeGen broken:
- Codegen assumes that there is an equivalence between RecordDecl* and
  RecordType*. This was true before because we only created one RecordDecl* for
  a given RecordType*, but it is no longer true. I believe this shouldn't be too
  hard to change, but the patch was big enough as it is.

I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).

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

16 years agoSupport "typeof unary-expression" (GNU C++ extension).
Argyrios Kyrtzidis [Fri, 5 Sep 2008 11:26:19 +0000 (11:26 +0000)]
Support "typeof unary-expression" (GNU C++ extension).

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

16 years agoSet different header search paths for the Windows platform.
Argyrios Kyrtzidis [Fri, 5 Sep 2008 09:41:20 +0000 (09:41 +0000)]
Set different header search paths for the Windows platform.

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

16 years agoAdd header search paths for Mingw32 (GCC version 4).
Argyrios Kyrtzidis [Fri, 5 Sep 2008 09:03:53 +0000 (09:03 +0000)]
Add header search paths for Mingw32 (GCC version 4).

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

16 years agoLine endings: CRLF -> LF
Argyrios Kyrtzidis [Fri, 5 Sep 2008 08:53:53 +0000 (08:53 +0000)]
Line endings: CRLF -> LF

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

16 years agoFix placement of const on a number of X86 builtins.
Daniel Dunbar [Fri, 5 Sep 2008 05:56:16 +0000 (05:56 +0000)]
Fix placement of const on a number of X86 builtins.

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

16 years agoTest case for previous commit (Workaround gcc bug causing crash on our
Daniel Dunbar [Fri, 5 Sep 2008 03:23:51 +0000 (03:23 +0000)]
Test case for previous commit (Workaround gcc bug causing crash on our
preprocessed outputs)

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

16 years agoWorkaround gcc bug causing crash on our preprocessed outputs.
Daniel Dunbar [Fri, 5 Sep 2008 03:22:57 +0000 (03:22 +0000)]
Workaround gcc bug causing crash on our preprocessed outputs.
 - gcc is not happy if we start a preprocessed file with
#line 1 "XXX" 1
 - Workaround by making sure file starts with a simple #line change.

Also, factored WriteLineInfo out.

Also, fixed bug where FileType was not being correctly updated.

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

16 years agoRemove stale comments.
Ted Kremenek [Fri, 5 Sep 2008 01:38:34 +0000 (01:38 +0000)]
Remove stale comments.

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

16 years agoRemove "NextDecl" from RecordDecl. This change touches many files that where RecordD...
Ted Kremenek [Fri, 5 Sep 2008 01:34:33 +0000 (01:34 +0000)]
Remove "NextDecl" from RecordDecl.  This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.

The motivation behind this change is that chaining the RecordDecls is simply unnecessary.  Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.

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

16 years agoSet sext/zext on function result.
Daniel Dunbar [Fri, 5 Sep 2008 00:57:45 +0000 (00:57 +0000)]
Set sext/zext on function result.
 - <rdar://problem/6156739>

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

16 years agoPatch to scan-build by Jordan Breeding:
Ted Kremenek [Thu, 4 Sep 2008 23:56:36 +0000 (23:56 +0000)]
Patch to scan-build by Jordan Breeding:
- Don't remove $BaseDir; may be unsafe
- Always create HTML directory with parents

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

16 years agoSet function attributes (sext, zext, etc.) on Objective-C methods.
Daniel Dunbar [Thu, 4 Sep 2008 23:41:35 +0000 (23:41 +0000)]
Set function attributes (sext, zext, etc.) on Objective-C methods.

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

16 years agoUpdated checker build.
Ted Kremenek [Thu, 4 Sep 2008 23:13:30 +0000 (23:13 +0000)]
Updated checker build.

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

16 years agoFix unintended use of doxygen comment strings.
Daniel Dunbar [Thu, 4 Sep 2008 21:54:53 +0000 (21:54 +0000)]
Fix unintended use of doxygen comment strings.

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

16 years agoFix infinite loop in for ... in code generation.
Daniel Dunbar [Thu, 4 Sep 2008 21:54:37 +0000 (21:54 +0000)]
Fix infinite loop in for ... in code generation.
 - Patch via Thomas Clement, thanks!

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

16 years agoAdded test case for the dead stores checker that was originally an FP reported in...
Ted Kremenek [Thu, 4 Sep 2008 21:52:52 +0000 (21:52 +0000)]
Added test case for the dead stores checker that was originally an FP reported in PR 2763.

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

16 years agoFix CFG construction bug:
Ted Kremenek [Thu, 4 Sep 2008 21:48:47 +0000 (21:48 +0000)]
Fix CFG construction bug:
- Within for loops, 'continue' should jump to a basic block containing the
  increment code

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

16 years agoFix FindSpecRefs to be Python 2.4 compatible and get the SVN revision
Daniel Dunbar [Thu, 4 Sep 2008 20:26:14 +0000 (20:26 +0000)]
Fix FindSpecRefs to be Python 2.4 compatible and get the SVN revision
in a more obvious fashion.

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

16 years agoPrevent invalid warnings about incomplete implementations for methods
Daniel Dunbar [Thu, 4 Sep 2008 20:01:15 +0000 (20:01 +0000)]
Prevent invalid warnings about incomplete implementations for methods
which are inherited from base clases or protocols.

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

16 years agofix running tests with valgrind (there were a lot of bogus failures and warnings)
Nuno Lopes [Thu, 4 Sep 2008 18:33:57 +0000 (18:33 +0000)]
fix running tests with valgrind (there were a lot of bogus failures and warnings)
currently clang passes all tests under valgrind with the leak checker disabled :P (and fails most otherwise)

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

16 years agoscan-build:
Ted Kremenek [Thu, 4 Sep 2008 17:52:41 +0000 (17:52 +0000)]
scan-build:
- Only set the environment variable 'CXX' if the user specifies --use-c++.
- Fix regression when setting LDPLUSPLUS: add a 'which' to determine the location of g++.  This regression was pointed out by Jordan Breeding!

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

16 years agoTouchup CheckSingleAssignmentConstraints() and CheckCompareOperands() to check for...
Steve Naroff [Thu, 4 Sep 2008 16:56:14 +0000 (16:56 +0000)]
Touchup CheckSingleAssignmentConstraints() and CheckCompareOperands() to check for block pointers.
Added a couple FIXME's wrt PointLikeType. If the author reads this, it would be great to get some background on this class (thanks in advance).

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

16 years agoFix a handful of typos (closure->block) to avoid confusion.
Steve Naroff [Thu, 4 Sep 2008 15:31:07 +0000 (15:31 +0000)]
Fix a handful of typos (closure->block) to avoid confusion.

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

16 years agoAdd type checking for blocks.
Steve Naroff [Thu, 4 Sep 2008 15:10:53 +0000 (15:10 +0000)]
Add type checking for blocks.

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

16 years agoGenerate error if we try to implicit cast between different address
Mon P Wang [Thu, 4 Sep 2008 08:38:01 +0000 (08:38 +0000)]
Generate error if we try to implicit cast between different address
spaces

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

16 years agoAdd some Objective-C code generation tests.
Daniel Dunbar [Thu, 4 Sep 2008 04:36:23 +0000 (04:36 +0000)]
Add some Objective-C code generation tests.
 - Note that these don't really test anything other than that code
   generation doesn't fail or crash. Better than nothing though!

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

16 years agoNeXT: Emit lazy reference to Protocol class for forward protocol
Daniel Dunbar [Thu, 4 Sep 2008 04:33:15 +0000 (04:33 +0000)]
NeXT: Emit lazy reference to Protocol class for forward protocol
references (to match gcc).

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

16 years agoAvoid superfluous errors regarding variable-length arrays (casts).
Daniel Dunbar [Thu, 4 Sep 2008 03:43:08 +0000 (03:43 +0000)]
Avoid superfluous errors regarding variable-length arrays (casts).

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

16 years agoImplement codegen of aggregates as lvalues in binary expressions,
Daniel Dunbar [Thu, 4 Sep 2008 03:20:13 +0000 (03:20 +0000)]
Implement codegen of aggregates as lvalues in binary expressions,
e.g. "(a = b).somefield".

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

16 years agoUpdated checker build.
Ted Kremenek [Thu, 4 Sep 2008 02:36:37 +0000 (02:36 +0000)]
Updated checker build.

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

16 years agoCapture 'uname' and 'gcc -v' output to .info files.
Ted Kremenek [Thu, 4 Sep 2008 00:41:45 +0000 (00:41 +0000)]
Capture 'uname' and 'gcc -v' output to .info files.

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

16 years agoUpdate TestRunner to not report failure for XFAIL tests
Daniel Dunbar [Thu, 4 Sep 2008 00:30:11 +0000 (00:30 +0000)]
Update TestRunner to not report failure for XFAIL tests

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

16 years agoOutput "ANALYZE:" diagnostics to STDOUT instead of STDERR.
Ted Kremenek [Thu, 4 Sep 2008 00:02:50 +0000 (00:02 +0000)]
Output "ANALYZE:" diagnostics to STDOUT instead of STDERR.

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

16 years agoccc-analyzer:
Ted Kremenek [Thu, 4 Sep 2008 00:02:34 +0000 (00:02 +0000)]
ccc-analyzer:
 - Capture the STDERR output of 'clang' to a file for use with crash reporting.

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

16 years agoSet register storage class correctly for function parameters.
Daniel Dunbar [Wed, 3 Sep 2008 21:54:21 +0000 (21:54 +0000)]
Set register storage class correctly for function parameters.
 - PR2730

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

16 years agoFollowing gcc's behavior, only enable trigraphs if '-trigraphs' or '-ansi' is
Ted Kremenek [Wed, 3 Sep 2008 21:22:16 +0000 (21:22 +0000)]
Following gcc's behavior, only enable trigraphs if '-trigraphs' or '-ansi' is
specified, or -std is set to a conforming mode.

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

16 years agoAdd svn:ignore on SemaObjC/Output.
Daniel Dunbar [Wed, 3 Sep 2008 21:18:38 +0000 (21:18 +0000)]
Add svn:ignore on SemaObjC/Output.

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

16 years agoAdd two test cases for builtins (mostly related to object size
Daniel Dunbar [Wed, 3 Sep 2008 21:17:21 +0000 (21:17 +0000)]
Add two test cases for builtins (mostly related to object size
builtins).

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

16 years agoAdd __builtin_object_size support.
Daniel Dunbar [Wed, 3 Sep 2008 21:13:56 +0000 (21:13 +0000)]
Add __builtin_object_size support.
 - Currently CodeGen always returns a conservative value for this (-1
   or 0 depending on the context).

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

16 years agoModify object size checking builtins to lower to libc calls.
Daniel Dunbar [Wed, 3 Sep 2008 20:28:50 +0000 (20:28 +0000)]
Modify object size checking builtins to lower to libc calls.

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

16 years agoAdd semantic analysis for "blocks".
Steve Naroff [Wed, 3 Sep 2008 18:15:37 +0000 (18:15 +0000)]
Add semantic analysis for "blocks".

Highlights...

- 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr.
- Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt().

Next steps...

- hack Sema::ActOnIdentifierExpr() to deal with block decl refs.
- add attribute handler for byref decls.
- add test cases.

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

16 years agoFix 80 col violations.
Ted Kremenek [Wed, 3 Sep 2008 18:03:35 +0000 (18:03 +0000)]
Fix 80 col violations.

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

16 years agoAdded --use-cxx option to scan-build.
Ted Kremenek [Wed, 3 Sep 2008 17:59:35 +0000 (17:59 +0000)]
Added --use-cxx option to scan-build.

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

16 years agoImprove type-checking of ?: for Objective-C types.
Daniel Dunbar [Wed, 3 Sep 2008 17:53:25 +0000 (17:53 +0000)]
Improve type-checking of ?: for Objective-C types.
 - Allow any Objective-C object types to devolve to type id in a ?:
   expression. This matches gcc behavior more closely.

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

16 years agoStore: (static analyzer)
Ted Kremenek [Wed, 3 Sep 2008 03:06:11 +0000 (03:06 +0000)]
Store: (static analyzer)
- Change definition of store::Region and store::Binding (once again) to make
  them real classes that just wrap pointers. This makes them more strictly
  typed, and allows specific implementations of Regions/Bindings to just
  subclass them.
- minor renamings to RegionExtent and its subclasses
- added a bunch of doxygen comments

StoreManager: (static analyzer)
- added 'iterBindings', an iteration method for iterating over the bindings of a
  store. It that takes a callback object (acting like a poor man's closure).
- added 'getRVal' version for store::Binding. Will potentially phase the other
  versions of GetRVal in StoreManager out.
- reimplemented 'getBindings' to be non-virtual and to use 'iterBindings'

BasicStoreManager: (static analyzer)
- implemented 'iterBindings' for BasicStoreManager

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

16 years agoRestore Objective-C dot-syntax access of methods.
Daniel Dunbar [Wed, 3 Sep 2008 01:05:41 +0000 (01:05 +0000)]
Restore Objective-C dot-syntax access of methods.
 - Now also searches for correct setter method.
 - There are still some issues regarding validation of the setter
   method and access of read-only properties.

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

16 years agoFix ObjCPropertRefExpr to be able to encode all the information for
Daniel Dunbar [Wed, 3 Sep 2008 00:27:26 +0000 (00:27 +0000)]
Fix ObjCPropertRefExpr to be able to encode all the information for
uses which refer to methods not properties.
 - Not yet wired in Sema.

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

16 years agoWhen creating CXXRecordDecls and RecordDecls within ActOnTag, hook up the new [CXX...
Ted Kremenek [Tue, 2 Sep 2008 21:26:19 +0000 (21:26 +0000)]
When creating CXXRecordDecls and RecordDecls within ActOnTag, hook up the new [CXX]RecordDecl with the RecordDecl chain.

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

16 years agoRecordDecl:
Ted Kremenek [Tue, 2 Sep 2008 21:12:32 +0000 (21:12 +0000)]
RecordDecl:
- Remove method 'isForwardDecl'; this functionality is already provided by
  'isDefinition()'
- Move method definitions to be co-located with other RecordDecl methods.

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

16 years agoRecordDecl serialization:
Ted Kremenek [Tue, 2 Sep 2008 20:42:52 +0000 (20:42 +0000)]
RecordDecl serialization:
- Don't serialize out the NextDeclarator field.  It is unused and deprecated.
- Serialize out the NextDecl pointer.

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

16 years agoRecordDecl:
Ted Kremenek [Tue, 2 Sep 2008 20:25:22 +0000 (20:25 +0000)]
RecordDecl:
- Added method 'isForwardDeclaration', a predicate method that returns true
  if a RecordDecl represents a forward declaration.
- Added method 'getDefinitionDecl', a query method that returns a pointer to
  the RecordDecl that provides the actual definition of a struct/union.

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

16 years agoCXXRecordDecl and RecordDecl:
Ted Kremenek [Tue, 2 Sep 2008 20:13:32 +0000 (20:13 +0000)]
CXXRecordDecl and RecordDecl:
- Change constructor and create methods to accept a CXXRecordDecl* (RecordDecl*)
  instead of a ScopedDecl* for PrevDecl.  This causes the type checking
  to be more tight and doesn't break any code.

RecordDecl:

- Don't use the NextDeclarator field in ScopedDecl to represent the previous
  declaration. This is a conflated use of the NextDeclarator field, which will
  be removed anyway when DeclGroups are fully implemented.

- Instead, represent (a soon to be implemented) chain of RecordDecls using a
  NextDecl field.  The last RecordDecl in the chain is always the 'defining'
  RecordDecl that owns the FieldDecls.  The other RecordDecls in the chain
  are forward declarations.

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

16 years ago- Implement __block.
Steve Naroff [Tue, 2 Sep 2008 18:50:17 +0000 (18:50 +0000)]
- Implement __block.
- Replace FIXME in Preprocessor::HandleIdentifier() with a check that avoids diagnosing extension tokens that originate from macro definitions.

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

16 years agoPull code from last commit. will put back soon.
Steve Naroff [Tue, 2 Sep 2008 18:04:36 +0000 (18:04 +0000)]
Pull code from last commit. will put back soon.

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

16 years agoImplement block pseudo-storage class modifiers (__block, __byref).
Steve Naroff [Tue, 2 Sep 2008 15:20:19 +0000 (15:20 +0000)]
Implement block pseudo-storage class modifiers (__block, __byref).

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

16 years agorecognise .s/.S file extensions. add default value for CCC_LANGUAGES
Nuno Lopes [Tue, 2 Sep 2008 10:27:37 +0000 (10:27 +0000)]
recognise .s/.S file extensions. add default value for CCC_LANGUAGES

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

16 years agoadd the other test case for completeness and to avoid regressions in the future
Nuno Lopes [Tue, 2 Sep 2008 10:10:14 +0000 (10:10 +0000)]
add the other test case for completeness and to avoid regressions in the future

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

16 years agoFix for PR2747: allow pointer->int casts with a null base; these are
Eli Friedman [Tue, 2 Sep 2008 09:37:00 +0000 (09:37 +0000)]
Fix for PR2747: allow pointer->int casts with a null base; these are
offset-of-like expressions.

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

16 years agoFix for PR2750; don't check for an 'e' in the trash after the token.
Eli Friedman [Tue, 2 Sep 2008 05:29:22 +0000 (05:29 +0000)]
Fix for PR2750; don't check for an 'e' in the trash after the token.

Note that this isn't really a complete fix; I think there are other
potential overrun situations.  I don't really know what the best
systematic fix is, though.

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

16 years agoAn extremely hacky version of transparent_union support; it isn't
Eli Friedman [Tue, 2 Sep 2008 05:19:23 +0000 (05:19 +0000)]
An extremely hacky version of transparent_union support; it isn't
anywhere near correct in terms of missing cases and missing
diagnostics, but it's good enough to handle the uses in the
Linux system headers, which are currently a constant pain for compiling
applications on Linux.

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

16 years agoMake sure to take the unqualified versions of the canonical types for
Eli Friedman [Tue, 2 Sep 2008 05:09:35 +0000 (05:09 +0000)]
Make sure to take the unqualified versions of the canonical types for
type-checking pointer subtraction; if the canonical types aren't used,
the qualifiers won't always get stripped off correctly.

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

16 years agoFit the comments into 80 columns.
Zhongxing Xu [Tue, 2 Sep 2008 03:29:51 +0000 (03:29 +0000)]
Fit the comments into 80 columns.

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

16 years agoUpdated checker build.
Ted Kremenek [Mon, 1 Sep 2008 22:51:34 +0000 (22:51 +0000)]
Updated checker build.

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

16 years agoreadd test as it passes correctly. nice, but weird
Nuno Lopes [Mon, 1 Sep 2008 22:28:55 +0000 (22:28 +0000)]
readd test as it passes correctly. nice, but weird

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

16 years agoBacking out r55607 due to logic errors and test regression.
Eli Friedman [Mon, 1 Sep 2008 22:08:17 +0000 (22:08 +0000)]
Backing out r55607 due to logic errors and test regression.

I'll try to come up with a correct fix for the testcase sometime soon.

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

16 years agoUpdated checker build.
Ted Kremenek [Mon, 1 Sep 2008 20:13:28 +0000 (20:13 +0000)]
Updated checker build.

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

16 years agoTidy up sema processing of attribute "nonull":
Ted Kremenek [Mon, 1 Sep 2008 19:57:52 +0000 (19:57 +0000)]
Tidy up sema processing of attribute "nonull":
- warn about nonnull being applied to functions with no pointer arguments
- continue processing argument list in the attribute when we encounter a non-pointer parameter being marked as nonnull
- when no argument list is specified, only mark pointers as nonnull.  This fixes PR 2732 and radar 6188814.

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

16 years agofix one more this-is-not-a-constant error. test included
Nuno Lopes [Mon, 1 Sep 2008 18:42:41 +0000 (18:42 +0000)]
fix one more this-is-not-a-constant error. test included

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

16 years agomake CheckArithmeticConstantExpression() aware of &foo and pointers
Nuno Lopes [Mon, 1 Sep 2008 14:47:06 +0000 (14:47 +0000)]
make CheckArithmeticConstantExpression() aware of &foo and pointers

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

16 years agocodegen constant data as such. add QualType::isConstant()
Nuno Lopes [Mon, 1 Sep 2008 11:33:04 +0000 (11:33 +0000)]
codegen constant data as such. add QualType::isConstant()

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

16 years agoPatch by Kovarththanan Rajaratnam!
Ted Kremenek [Sun, 31 Aug 2008 16:37:56 +0000 (16:37 +0000)]
Patch by Kovarththanan Rajaratnam!

"This minor patch adds markup of string literals with a red colour."

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

16 years agoHandle mutation while enumerating correctly. Fix some bugs.
Anders Carlsson [Sun, 31 Aug 2008 04:05:03 +0000 (04:05 +0000)]
Handle mutation while enumerating correctly. Fix some bugs.

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

16 years agoInitial support for CodeGen of for ... in statements.
Anders Carlsson [Sun, 31 Aug 2008 02:33:12 +0000 (02:33 +0000)]
Initial support for CodeGen of for ... in statements.

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

16 years agoStub out CodeGenFunction::EmitObjCForCollectionStmt.
Anders Carlsson [Sat, 30 Aug 2008 19:51:14 +0000 (19:51 +0000)]
Stub out CodeGenFunction::EmitObjCForCollectionStmt.

Add CodeGenFunction::EmitMemSetToZero and make AggExprEmitter::EmitAggregateClear use it.

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

16 years agoAdd code to create the fast enumeration state type
Anders Carlsson [Sat, 30 Aug 2008 19:34:46 +0000 (19:34 +0000)]
Add code to create the fast enumeration state type

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

16 years agoTemporarily disable some tests which due to dot-syntax
Daniel Dunbar [Sat, 30 Aug 2008 16:22:34 +0000 (16:22 +0000)]
Temporarily disable some tests which due to dot-syntax
access of methods.

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

16 years agoFix indentation on files in CodeGen and Sema.
Anders Carlsson [Sat, 30 Aug 2008 16:18:10 +0000 (16:18 +0000)]
Fix indentation on files in CodeGen and Sema.

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

16 years agoSimplify some calls to Builder.CreateCall
Anders Carlsson [Sat, 30 Aug 2008 16:17:45 +0000 (16:17 +0000)]
Simplify some calls to Builder.CreateCall

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

16 years agoAdd Objective-C property setter support.
Daniel Dunbar [Sat, 30 Aug 2008 05:35:15 +0000 (05:35 +0000)]
Add Objective-C property setter support.
 - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
   favor of just result type and selector. Necessary so it can be
   reused in situations where we don't want to cons up an
   ObjCMessageExpr.
 - Update aggregate binary assignment to know about special property
   ref lvalues.
 - Add CodeGenFunction::EmitCallArg overload which takes an already
   emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.

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

16 years agoRefactor handling of calls:
Daniel Dunbar [Sat, 30 Aug 2008 03:02:31 +0000 (03:02 +0000)]
Refactor handling of calls:
 - Added CodeGenFunction::EmitCall which just takes the callee, return
   type, and a list of (Value*,QualType) pairs.
 - Added CodeGenFunction::EmitCallArg which handles emitting code for
   a call argument and turning it into an appropriate
   (Value*,QualType) pair.
 - Changed Objective-C runtime interface so that the actual emission
   of arguments for message sends is (once again) done in the code to
   emit a message send.

No intended functionality change, this is prep work for better ABI
support and for Objective-C property setter support.

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

16 years agoAdd newline at end of file.
Daniel Dunbar [Sat, 30 Aug 2008 02:06:22 +0000 (02:06 +0000)]
Add newline at end of file.

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

16 years agoImprove ccc:
Daniel Dunbar [Fri, 29 Aug 2008 21:03:27 +0000 (21:03 +0000)]
Improve ccc:
 - Support environment variable CCC_LANGUAGES to control which
   languages clang is invoked on. If unset clang is invoked for all
   languages, otherwise CCC_LANGUAGES should be a comma separated list
   of the languages (as accepted by -x) for which clang should be
   invoked. Useful for only building C and Objective-C parts of a
   project with clang, for example.

 - Add environment variable CCC_FALLBACK. If set and non-empty then
   ccc will try and compile using the regular compiler if compilation
   with clang fails.

 - A few other tweaks to add options, flush stdout, recognize .mm as
   objective-c++, and infer languages for compile+link style
   invocations.

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

16 years agoDowngrade a number of FIXME asserts to ErrorUnsupported.
Daniel Dunbar [Fri, 29 Aug 2008 17:28:43 +0000 (17:28 +0000)]
Downgrade a number of FIXME asserts to ErrorUnsupported.
 - Notably VLAs

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

16 years agofix a comment that was forgotten in r54071
Nico Weber [Fri, 29 Aug 2008 17:24:46 +0000 (17:24 +0000)]
fix a comment that was forgotten in r54071

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

16 years agominor cleanup
Nico Weber [Fri, 29 Aug 2008 17:02:23 +0000 (17:02 +0000)]
minor cleanup

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