]> granicus.if.org Git - clang/log
clang
14 years agoUpdate __builtin_setjmp codegen to match llvmCore changes in r104900.
Jim Grosbach [Thu, 27 May 2010 23:54:20 +0000 (23:54 +0000)]
Update __builtin_setjmp codegen to match llvmCore changes in r104900.

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

14 years agoFix typo.
Nick Lewycky [Thu, 27 May 2010 23:40:55 +0000 (23:40 +0000)]
Fix typo.

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

14 years agoImplement a code-completion hook for the receiver of an Objective-C
Douglas Gregor [Thu, 27 May 2010 23:06:34 +0000 (23:06 +0000)]
Implement a code-completion hook for the receiver of an Objective-C
message. This completion gives better results than just using the
"expression" completion, which is effectively what happened before.

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

14 years agoTweak the fix-it for a copy constructor declared to take its argument
Douglas Gregor [Thu, 27 May 2010 21:28:21 +0000 (21:28 +0000)]
Tweak the fix-it for a copy constructor declared to take its argument
by-value. We now only prepend a space if it is needed.

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

14 years agoAdd a comment to mention the memory ownership situation.
Dan Gohman [Thu, 27 May 2010 20:28:55 +0000 (20:28 +0000)]
Add a comment to mention the memory ownership situation.

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

14 years agoWhen handling raw_ostream errors manually, use clear_error() so that
Dan Gohman [Thu, 27 May 2010 20:16:37 +0000 (20:16 +0000)]
When handling raw_ostream errors manually, use clear_error() so that
raw_ostream doesn't try to do its own error handling.

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

14 years agoWhen null-initializing bases with data member pointers, don't assert on virtual bases...
Anders Carlsson [Thu, 27 May 2010 18:51:01 +0000 (18:51 +0000)]
When null-initializing bases with data member pointers, don't assert on virtual bases. Just initialize them to null.

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

14 years agoEnable the implementation of __builtin_setjmp and __builtin_longjmp. Not all
John McCall [Thu, 27 May 2010 18:47:06 +0000 (18:47 +0000)]
Enable the implementation of __builtin_setjmp and __builtin_longjmp.  Not all
LLVM backends support these yet.

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

14 years agoParse/Sema: Add support for '#pragma options align=packed', which, it should be
Daniel Dunbar [Thu, 27 May 2010 18:42:17 +0000 (18:42 +0000)]
Parse/Sema: Add support for '#pragma options align=packed', which, it should be
noted, is not the same as __attribute__((packed)). That would be ridiculous!

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

14 years agoParse/Sema: Add support for '#pragma options align=native'.
Daniel Dunbar [Thu, 27 May 2010 18:42:09 +0000 (18:42 +0000)]
Parse/Sema: Add support for '#pragma options align=native'.

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

14 years agoSilence warning about "enumeral and non-enumeral type in conditional
Bill Wendling [Thu, 27 May 2010 18:35:05 +0000 (18:35 +0000)]
Silence warning about "enumeral and non-enumeral type in conditional
expression".

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

14 years agoMore work on the empty subobject map. This code is not yet used.
Anders Carlsson [Thu, 27 May 2010 18:20:57 +0000 (18:20 +0000)]
More work on the empty subobject map. This code is not yet used.

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

14 years agoMemoryBuffer::getSTDIN may return a null pointer if an error occurs.
Dan Gohman [Thu, 27 May 2010 17:33:40 +0000 (17:33 +0000)]
MemoryBuffer::getSTDIN may return a null pointer if an error occurs.

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

14 years agoRemove clang_isFromMainFile(). It doesn't work correctly with CXDiagnostics, and...
Ted Kremenek [Thu, 27 May 2010 16:57:42 +0000 (16:57 +0000)]
Remove clang_isFromMainFile().  It doesn't work correctly with CXDiagnostics, and we shouldn't
have an API around that cannot be implemented correctly yet.

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

14 years agoFix 80-column.
Fariborz Jahanian [Thu, 27 May 2010 16:35:00 +0000 (16:35 +0000)]
Fix 80-column.

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

14 years agoAnother empty class layout test.
Anders Carlsson [Thu, 27 May 2010 16:15:06 +0000 (16:15 +0000)]
Another empty class layout test.

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

14 years agoAdd more empty class layout tests.
Anders Carlsson [Thu, 27 May 2010 16:07:49 +0000 (16:07 +0000)]
Add more empty class layout tests.

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

14 years agoObjective-c++ IR gen.
Fariborz Jahanian [Thu, 27 May 2010 16:05:06 +0000 (16:05 +0000)]
Objective-c++ IR gen.
Flag synthesized struct decl. as non-empty so
CXX side of ir gen does not skip its Null initialization.
Fixes radar 8027844 for objc++'s collection statement.

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

14 years agoWhen we've parsed a nested-name-specifier in a member access
Douglas Gregor [Thu, 27 May 2010 15:25:59 +0000 (15:25 +0000)]
When we've parsed a nested-name-specifier in a member access
expression, "forget" about the object type; only the
nested-name-specifier matters for name lookup purposes. Fixes PR7239.

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

14 years agoFixed missing initialization of member. Should we enable unused argument warning?.
Abramo Bagnara [Thu, 27 May 2010 07:42:50 +0000 (07:42 +0000)]
Fixed missing initialization of member. Should we enable unused argument warning?.

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

14 years agoDarwin/ARM seems to support mac68k align as well.
Daniel Dunbar [Thu, 27 May 2010 07:00:26 +0000 (07:00 +0000)]
Darwin/ARM seems to support mac68k align as well.

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

14 years agoDriver: Update -O -> -O2 replacement for addition of -O0 option.
Daniel Dunbar [Thu, 27 May 2010 06:51:08 +0000 (06:51 +0000)]
Driver: Update -O -> -O2 replacement for addition of -O0 option.

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

14 years agoRequire a complete type when performing the qualified lookup during
John McCall [Thu, 27 May 2010 06:40:31 +0000 (06:40 +0000)]
Require a complete type when performing the qualified lookup during
instantiation of a dependent elaborated type specifier.  Fixes PR 7199.

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

14 years agoUpdate checker build.
Ted Kremenek [Thu, 27 May 2010 06:27:45 +0000 (06:27 +0000)]
Update checker build.

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

14 years agoImplement __builtin_init_dwarf_reg_size_table and __builtin_dwarf_sp_column
John McCall [Thu, 27 May 2010 06:19:26 +0000 (06:19 +0000)]
Implement __builtin_init_dwarf_reg_size_table and __builtin_dwarf_sp_column
for 32-bit MIPS processors.  Hat-tip to rdivacky for providing gcc dumps
on this.

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

14 years agoDriver: Add support for -m[no-]relax-all, and make it the default at -O0.
Daniel Dunbar [Thu, 27 May 2010 06:18:05 +0000 (06:18 +0000)]
Driver: Add support for -m[no-]relax-all, and make it the default at -O0.

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

14 years agoSema: Add initial support for '#pragma options align=mac68k'.
Daniel Dunbar [Thu, 27 May 2010 05:45:51 +0000 (05:45 +0000)]
Sema: Add initial support for '#pragma options align=mac68k'.
 - Docs are fairly sketchy, if someone wants to pore through gcc to look for
   holes I'd appreciate any failing test cases!

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

14 years agoMore work on the new empty subobject map.
Anders Carlsson [Thu, 27 May 2010 05:41:06 +0000 (05:41 +0000)]
More work on the new empty subobject map.

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

14 years agoDriver: Add clang -cc1 -mrelax-all option, which sets relaxes all instructions when...
Daniel Dunbar [Thu, 27 May 2010 05:39:39 +0000 (05:39 +0000)]
Driver: Add clang -cc1 -mrelax-all option, which sets relaxes all instructions when using -integrated-as.

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

14 years agoStrip trailing whitespace.
Daniel Dunbar [Thu, 27 May 2010 02:25:46 +0000 (02:25 +0000)]
Strip trailing whitespace.

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

14 years agoAST: Add AlignMac68kAttr, not yet used.
Daniel Dunbar [Thu, 27 May 2010 02:25:39 +0000 (02:25 +0000)]
AST: Add AlignMac68kAttr, not yet used.

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

14 years agoSema: Factor out struct for alignment stack entries.
Daniel Dunbar [Thu, 27 May 2010 02:25:27 +0000 (02:25 +0000)]
Sema: Factor out struct for alignment stack entries.

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

14 years agoGive this test a triple.
John McCall [Thu, 27 May 2010 02:04:58 +0000 (02:04 +0000)]
Give this test a triple.

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

14 years agoSema: Replace getPragmaPackAlignment with AddAlignmentAttributesForRecord, which
Daniel Dunbar [Thu, 27 May 2010 01:53:40 +0000 (01:53 +0000)]
Sema: Replace getPragmaPackAlignment with AddAlignmentAttributesForRecord, which
exposes less details.

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

14 years agoWhen deciding whether a deferred declaration has already been emitted,
John McCall [Thu, 27 May 2010 01:45:30 +0000 (01:45 +0000)]
When deciding whether a deferred declaration has already been emitted,
aliases count as definitions regardless of whether their target has been
emitted yet.  Fixes PR 7142.

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

14 years agoAST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.
Daniel Dunbar [Thu, 27 May 2010 01:12:46 +0000 (01:12 +0000)]
AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.

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

14 years agoSema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.
Daniel Dunbar [Thu, 27 May 2010 00:35:16 +0000 (00:35 +0000)]
Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.

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

14 years agoDiscard qualifiers for ElementRegions so that a 'const' doesn't change the lookup...
Ted Kremenek [Thu, 27 May 2010 00:29:00 +0000 (00:29 +0000)]
Discard qualifiers for ElementRegions so that a 'const' doesn't change the lookup semantics
in the symbol store.  We may wish to push this down into the StoreManager itself.

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

14 years agoMore work on the empty subobjects map.
Anders Carlsson [Thu, 27 May 2010 00:07:01 +0000 (00:07 +0000)]
More work on the empty subobjects map.

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

14 years agoSema: Support for #pragma options align={reset,natural}. '#pragma options align'
Daniel Dunbar [Thu, 27 May 2010 00:04:40 +0000 (00:04 +0000)]
Sema: Support for #pragma options align={reset,natural}. '#pragma options align'
shares the stack with '#pragma pack', who knew!?

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

14 years agoParse: Add support for '#pragma options align'.
Daniel Dunbar [Wed, 26 May 2010 23:29:06 +0000 (23:29 +0000)]
Parse: Add support for '#pragma options align'.

Also, fix a source location bug with the rparen in #pragma pack.

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

14 years agoCorrectly pass aggregates by reference when emitting thunks.
John McCall [Wed, 26 May 2010 22:34:26 +0000 (22:34 +0000)]
Correctly pass aggregates by reference when emitting thunks.

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

14 years agoIntroduce priorities into the code-completion results.
Douglas Gregor [Wed, 26 May 2010 22:00:08 +0000 (22:00 +0000)]
Introduce priorities into the code-completion results.

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

14 years agoGrammar fix: s/it's/its/g in
Nick Lewycky [Wed, 26 May 2010 21:48:10 +0000 (21:48 +0000)]
Grammar fix: s/it's/its/g in
  "it's spelling location and it's instantiation location"

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

14 years agoPatch to fix a irgen crash accessing an initialized local static
Fariborz Jahanian [Wed, 26 May 2010 21:45:50 +0000 (21:45 +0000)]
Patch to fix a irgen crash accessing an initialized local static
variable in a local function. Fixes pr7101.

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

14 years agoPredefine the '__clang_analyzer__' macro when using '-analyze'.
Ted Kremenek [Wed, 26 May 2010 21:36:54 +0000 (21:36 +0000)]
Predefine the '__clang_analyzer__' macro when using '-analyze'.

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

14 years agoImprove on flexible array diagnostics (PR7029).
Fariborz Jahanian [Wed, 26 May 2010 20:46:24 +0000 (20:46 +0000)]
Improve on flexible array diagnostics (PR7029).

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

14 years agoFixes misc. flexible array bugs in c++ (PR7029).
Fariborz Jahanian [Wed, 26 May 2010 20:19:07 +0000 (20:19 +0000)]
Fixes misc. flexible array bugs in c++ (PR7029).

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

14 years agoUpdate .xcodeproj file.
Anders Carlsson [Wed, 26 May 2010 19:40:41 +0000 (19:40 +0000)]
Update .xcodeproj file.

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

14 years agoExtract the ObjC and blocks manglers into their own class. No functionality
Charles Davis [Wed, 26 May 2010 18:25:27 +0000 (18:25 +0000)]
Extract the ObjC and blocks manglers into their own class. No functionality
change.

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

14 years agoFixed comment.
Abramo Bagnara [Wed, 26 May 2010 18:17:40 +0000 (18:17 +0000)]
Fixed comment.

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

14 years agoAdded source order to CXXBaseOrMemberInitializer.
Abramo Bagnara [Wed, 26 May 2010 18:09:23 +0000 (18:09 +0000)]
Added source order to CXXBaseOrMemberInitializer.

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

14 years agoMove ComputeEmptySubobjectSizes to EmptySubobjectMap.
Anders Carlsson [Wed, 26 May 2010 15:54:25 +0000 (15:54 +0000)]
Move ComputeEmptySubobjectSizes to EmptySubobjectMap.

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

14 years agoStub out the EmptySubobjectsMap class.
Anders Carlsson [Wed, 26 May 2010 15:32:58 +0000 (15:32 +0000)]
Stub out the EmptySubobjectsMap class.

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

14 years agoInline the RecordLayoutBuilder constructor.
Anders Carlsson [Wed, 26 May 2010 15:20:08 +0000 (15:20 +0000)]
Inline the RecordLayoutBuilder constructor.

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

14 years agoAdd a Layout overload that takes a CXXRecordDecl.
Anders Carlsson [Wed, 26 May 2010 15:10:00 +0000 (15:10 +0000)]
Add a Layout overload that takes a CXXRecordDecl.

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

14 years agoMove RecordLayoutBuilder into an anonymous namespace.
Benjamin Kramer [Wed, 26 May 2010 09:58:31 +0000 (09:58 +0000)]
Move RecordLayoutBuilder into an anonymous namespace.

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

14 years agoWhen transforming a C++ "new" expression's constructor arguments, drop
Douglas Gregor [Wed, 26 May 2010 07:10:06 +0000 (07:10 +0000)]
When transforming a C++ "new" expression's constructor arguments, drop
any arguments that are default-argument expressions. The can show up
when we have a new expression whose constructor arguments are not
type-dependent and whose allocated type is not dependent and has a
constructor with default arguments. Fixes PR7202.

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

14 years agoRename ASTRecordLayoutBuilder to RecordLayoutBuilder.
Anders Carlsson [Wed, 26 May 2010 05:58:59 +0000 (05:58 +0000)]
Rename ASTRecordLayoutBuilder to RecordLayoutBuilder.

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

14 years agoRemove RecordLayoutBuilder.h
Anders Carlsson [Wed, 26 May 2010 05:49:19 +0000 (05:49 +0000)]
Remove RecordLayoutBuilder.h

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

14 years agoMove the ASTRecordLayoutBuilder class declaration into the .cpp file.
Anders Carlsson [Wed, 26 May 2010 05:41:04 +0000 (05:41 +0000)]
Move the ASTRecordLayoutBuilder class declaration into the .cpp file.

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

14 years agoASTRecordLayoutBuilder is no longer a friend of ASTRecordLayout.
Anders Carlsson [Wed, 26 May 2010 05:36:18 +0000 (05:36 +0000)]
ASTRecordLayoutBuilder is no longer a friend of ASTRecordLayout.

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

14 years agoTell the string literal parser when it's not permitted to emit
Douglas Gregor [Wed, 26 May 2010 05:35:51 +0000 (05:35 +0000)]
Tell the string literal parser when it's not permitted to emit
diagnostics. That would be while we're parsing string literals for the
sole purpose of producing a diagnostic about them. Fixes
<rdar://problem/8026030>.

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

14 years agoFix thinko and remove another unused function.
Anders Carlsson [Wed, 26 May 2010 05:31:23 +0000 (05:31 +0000)]
Fix thinko and remove another unused function.

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

14 years agoFix build.
Anders Carlsson [Wed, 26 May 2010 05:25:15 +0000 (05:25 +0000)]
Fix build.

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

14 years agoNo need to use the PrimaryBaseInfo struct in the builder.
Anders Carlsson [Wed, 26 May 2010 05:20:58 +0000 (05:20 +0000)]
No need to use the PrimaryBaseInfo struct in the builder.

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

14 years agoBe sure to use the standard substitutions when mangling the names of
Douglas Gregor [Wed, 26 May 2010 05:11:13 +0000 (05:11 +0000)]
Be sure to use the standard substitutions when mangling the names of
vtables, VTTs, and construction vtables. Fixes PR7201.

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

14 years agoRemove FIXME.
Anders Carlsson [Wed, 26 May 2010 05:11:02 +0000 (05:11 +0000)]
Remove FIXME.

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

14 years agoFold the other Layout overload into its sole call site.
Anders Carlsson [Wed, 26 May 2010 05:10:47 +0000 (05:10 +0000)]
Fold the other Layout overload into its sole call site.

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

14 years agoFold the ASTRecordLayoutBuilder::ComputeLayout overload that takes an ObjCInterfaceDe...
Anders Carlsson [Wed, 26 May 2010 05:04:25 +0000 (05:04 +0000)]
Fold the ASTRecordLayoutBuilder::ComputeLayout overload that takes an ObjCInterfaceDecl pointer into its only callsite.

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

14 years agoMove the relevant ASTContext member functions that deal with ASTRecordLayoutBuilder...
Anders Carlsson [Wed, 26 May 2010 04:56:53 +0000 (04:56 +0000)]
Move the relevant ASTContext member functions that deal with ASTRecordLayoutBuilder into RecordLayoutBuilder.cpp. This matches the way we interact with other builder classes (CGRecordLayoutBuilder, VTableBuilder and VTTBuilder) and it also allows for making ASTRecordLayoutBuilder a private class without a header file.

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

14 years agoSmall fix.
Zhongxing Xu [Wed, 26 May 2010 03:36:08 +0000 (03:36 +0000)]
Small fix.

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

14 years agoRemove extents of dead symbolic regions when RemoveDeadBindings.
Zhongxing Xu [Wed, 26 May 2010 03:27:35 +0000 (03:27 +0000)]
Remove extents of dead symbolic regions when RemoveDeadBindings.
This requires creating new persistent states due to the nature of GDM.

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

14 years agoOnly enable code patterns (e.g., try { statements } catch (...) {
Douglas Gregor [Tue, 25 May 2010 21:41:55 +0000 (21:41 +0000)]
Only enable code patterns (e.g., try { statements } catch (...) {
statements }) in the code-completion results if explicitly requested.

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

14 years agoAllocate the contents of TemplateArgumentList using ASTContext's allocator. This...
Ted Kremenek [Tue, 25 May 2010 20:43:29 +0000 (20:43 +0000)]
Allocate the contents of TemplateArgumentList using ASTContext's allocator.  This fixes
a massive memory leak when using a BumpPtrAllocator in ASTContext.

Added a FIXME, as the Destroy method for TemplateArgumentList isn't getting called.
This means we will instead leak when using the MallocAllocator.

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

14 years agoAdd Redeclarable boilerplate to TypedefDecl, from Peter Collingbourne!
Douglas Gregor [Tue, 25 May 2010 19:53:14 +0000 (19:53 +0000)]
Add Redeclarable boilerplate to TypedefDecl, from Peter Collingbourne!

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

14 years agoIRgen: Add a stub class for generating ABI-specific C++ code.
Charles Davis [Tue, 25 May 2010 19:52:27 +0000 (19:52 +0000)]
IRgen: Add a stub class for generating ABI-specific C++ code.

This class only supports name mangling (which is apparently used during C/ObjC
codegen). For now only the Itanium C++ ABI is supported. Patches to add a
second C++ ABI are forthcoming.

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

14 years agoDriver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not the
Daniel Dunbar [Tue, 25 May 2010 18:41:01 +0000 (18:41 +0000)]
Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not the
.s printer or .o writer.

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

14 years agomake -ast-dump print something like this for declstmts:
Chris Lattner [Tue, 25 May 2010 17:56:43 +0000 (17:56 +0000)]
make -ast-dump print something like this for declstmts:
  (DeclStmt 0x3405550 <line:3:4, col:11>
    0x34053a0 "int x")
instead of:
  (DeclStmt 0x3405550 <line:3:4, col:11>
    0x34053a0 "int x"

which has unbalanced parens (PR7228)

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

14 years agoFix testsuite for blocks mangling change
Douglas Gregor [Tue, 25 May 2010 17:46:21 +0000 (17:46 +0000)]
Fix testsuite for blocks mangling change

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

14 years agoRefactoring of block-pointer type rewrite.
Fariborz Jahanian [Tue, 25 May 2010 17:12:52 +0000 (17:12 +0000)]
Refactoring of block-pointer type rewrite.

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

14 years agoFix compilation failure
Douglas Gregor [Tue, 25 May 2010 17:12:30 +0000 (17:12 +0000)]
Fix compilation failure

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

14 years agoImprove name mangling for blocks and support mangling of static local
Douglas Gregor [Tue, 25 May 2010 17:04:15 +0000 (17:04 +0000)]
Improve name mangling for blocks and support mangling of static local
variables within blocks. We loosely follow GCC's mangling, but since
these are always internal symbols the names don't really matter. I
intend to revisit block mangling later, because GCC's mangling is
rather verbose. <rdar://problem/8015719>.

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

14 years agoPatch to rewrite block pointers as arguments to
Fariborz Jahanian [Tue, 25 May 2010 15:56:08 +0000 (15:56 +0000)]
Patch to rewrite block pointers as arguments to
methods. (Radar 7987817).

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

14 years agoMake sure to strip off top-level cv-qualifiers as part of a
Douglas Gregor [Tue, 25 May 2010 15:31:05 +0000 (15:31 +0000)]
Make sure to strip off top-level cv-qualifiers as part of a
derived-to-base conversion on a pointer. Fixes PR7224.

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

14 years agoPut -Wvla into the -Wgnu warning group
Douglas Gregor [Tue, 25 May 2010 15:04:55 +0000 (15:04 +0000)]
Put -Wvla into the -Wgnu warning group

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

14 years agoTurn vertical spacing into horizontal spacing in code-completion results
Douglas Gregor [Tue, 25 May 2010 06:14:46 +0000 (06:14 +0000)]
Turn vertical spacing into horizontal spacing in code-completion results

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

14 years agoImprove code completion in failure cases in two ways:
Douglas Gregor [Tue, 25 May 2010 05:58:43 +0000 (05:58 +0000)]
Improve code completion in failure cases in two ways:
  1) Suppress diagnostics as soon as we form the code-completion
  token, so we don't get any error/warning spew from the early
  end-of-file.
  2) If we consume a code-completion token when we weren't expecting
  one, go into a code-completion recovery path that produces the best
  results it can based on the context that the parser is in.

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

14 years agoCastSizeChecker checks when casting a malloc'ed symbolic region to type T,
Zhongxing Xu [Tue, 25 May 2010 04:59:19 +0000 (04:59 +0000)]
CastSizeChecker checks when casting a malloc'ed symbolic region to type T,
whether the size of the symbolic region is a multiple of the size of T.
Fixes PR6123 and PR7217.

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

14 years agoIf a function definition has any sort of weak linkage, its static local
John McCall [Tue, 25 May 2010 04:30:21 +0000 (04:30 +0000)]
If a function definition has any sort of weak linkage, its static local
variables should have that linkage.  Otherwise, its static local
variables should have internal linkage.  To avoid computing this excessively,
set a function's linkage before we emit code for it.

Previously we were assigning weak linkage to the static variables of
static inline functions in C++, with predictably terrible results.  This
fixes that and also gives better linkage than 'weak' when merging is required.

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

14 years agoMake this class useful as a base.
Nick Lewycky [Tue, 25 May 2010 01:51:06 +0000 (01:51 +0000)]
Make this class useful as a base.

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

14 years agoIRgen/C++: When mark vtables used, make sure to still append to the VTableUse array...
Daniel Dunbar [Tue, 25 May 2010 00:33:13 +0000 (00:33 +0000)]
IRgen/C++: When mark vtables used, make sure to still append to the VTableUse array if we promote a vtable from being just used to having its definition required. This ensures that we properly inform the consumer about whether the vtable is required or not, previously we could fail to do so when the vtable was in the VTableUses array before the decl which marked it as required.
 - I think this can be cleaned up, since this means we may notify the consumer about the vtable twice, but I didn't see an easy fix for this without more substantial refactoring.
 - Doug, please review!

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

14 years agoSimplify.
Daniel Dunbar [Tue, 25 May 2010 00:32:58 +0000 (00:32 +0000)]
Simplify.

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

14 years agoimprove the fixit for the missing : error when parsing ?:. When
Chris Lattner [Mon, 24 May 2010 22:31:37 +0000 (22:31 +0000)]
improve the fixit for the missing : error when parsing ?:.  When
there are already two spaces before the token where the : was expected,
put the : in between the spaces.  This means we get it right in both
of these cases:

t.c:2:17: error: expected ':'
  return a ? b  c;
                ^
               :
t.c:3:16: error: expected ':'
  return a ? b c;
               ^
               :

In the later case, the diagnostic says to insert ": ", in the former
case it says to insert ":" between the spaces.  This fixes rdar://8007231

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

14 years agoadd a few more categories.
Chris Lattner [Mon, 24 May 2010 21:54:02 +0000 (21:54 +0000)]
add a few more categories.

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

14 years agomissed an svn add
Chris Lattner [Mon, 24 May 2010 21:38:14 +0000 (21:38 +0000)]
missed an svn add

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

14 years agopush categories forward a bit more: document them, add some
Chris Lattner [Mon, 24 May 2010 21:35:18 +0000 (21:35 +0000)]
push categories forward a bit more: document them, add some
major buckets to catch parser and sema issues, add inline asm
category, and make diag groups take precedence over the
sweeping categories just added.

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

14 years agoDon't complain about VLAs of non-POD types when the array type is
Douglas Gregor [Mon, 24 May 2010 20:42:30 +0000 (20:42 +0000)]
Don't complain about VLAs of non-POD types when the array type is
dependent. Fixes <rdar://problem/8021385>.

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

14 years agoA type- or value-dependent expression cannot use bitfield
Douglas Gregor [Mon, 24 May 2010 20:13:53 +0000 (20:13 +0000)]
A type- or value-dependent expression cannot use bitfield
promotion. Fixes <rdar://problem/8020920>.

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

14 years agowhen too many errors are emitted, and we produce:
Chris Lattner [Mon, 24 May 2010 18:37:03 +0000 (18:37 +0000)]
when too many errors are emitted, and we produce:
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Tell the user that this is controlled with -ferror-limit=, like above.

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