Ted Kremenek
31729162bc
Remove clang_isFromMainFile(). It doesn't work correctly with CXDiagnostics, and we shouldn't
...
have an API around that cannot be implemented correctly yet.
llvm-svn: 104849
2010-05-27 16:57:42 +00:00
Fariborz Jahanian
c77f0f394a
Fix 80-column.
...
llvm-svn: 104847
2010-05-27 16:35:00 +00:00
Anders Carlsson
3e88da9fe5
Another empty class layout test.
...
llvm-svn: 104839
2010-05-27 16:15:06 +00:00
Anders Carlsson
1ff101cb1a
Add more empty class layout tests.
...
llvm-svn: 104838
2010-05-27 16:07:49 +00:00
Fariborz Jahanian
9ea5839cb6
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.
llvm-svn: 104837
2010-05-27 16:05:06 +00:00
Douglas Gregor
205a361413
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.
llvm-svn: 104834
2010-05-27 15:25:59 +00:00
Abramo Bagnara
7e9938a2c4
Fixed missing initialization of member. Should we enable unused argument warning?.
...
llvm-svn: 104829
2010-05-27 07:42:50 +00:00
Daniel Dunbar
3eeeccd6e2
Darwin/ARM seems to support mac68k align as well.
...
llvm-svn: 104828
2010-05-27 07:00:26 +00:00
Daniel Dunbar
9296f63ff0
Driver: Update -O -> -O2 replacement for addition of -O0 option.
...
llvm-svn: 104823
2010-05-27 06:51:08 +00:00
John McCall
bf8c519a0d
Require a complete type when performing the qualified lookup during
...
instantiation of a dependent elaborated type specifier. Fixes PR 7199.
llvm-svn: 104822
2010-05-27 06:40:31 +00:00
Ted Kremenek
f9d147bddb
Update checker build.
...
llvm-svn: 104817
2010-05-27 06:27:45 +00:00
John McCall
943fae95f5
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.
llvm-svn: 104816
2010-05-27 06:19:26 +00:00
Daniel Dunbar
06e2cc3f86
Driver: Add support for -m[no-]relax-all, and make it the default at -O0.
...
llvm-svn: 104815
2010-05-27 06:18:05 +00:00
Daniel Dunbar
6da1098b4b
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!
llvm-svn: 104809
2010-05-27 05:45:51 +00:00
Anders Carlsson
439edd1aea
More work on the new empty subobject map.
...
llvm-svn: 104808
2010-05-27 05:41:06 +00:00
Daniel Dunbar
c43b6b20d5
Driver: Add clang -cc1 -mrelax-all option, which sets relaxes all instructions when using -integrated-as.
...
llvm-svn: 104807
2010-05-27 05:39:39 +00:00
Daniel Dunbar
592a85c137
Strip trailing whitespace.
...
llvm-svn: 104801
2010-05-27 02:25:46 +00:00
Daniel Dunbar
fc6507ef58
AST: Add AlignMac68kAttr, not yet used.
...
llvm-svn: 104800
2010-05-27 02:25:39 +00:00
Daniel Dunbar
4dbe15d437
Sema: Factor out struct for alignment stack entries.
...
llvm-svn: 104799
2010-05-27 02:25:27 +00:00
John McCall
1cfca7292a
Give this test a triple.
...
llvm-svn: 104798
2010-05-27 02:04:58 +00:00
Daniel Dunbar
8804f2e253
Sema: Replace getPragmaPackAlignment with AddAlignmentAttributesForRecord, which
...
exposes less details.
llvm-svn: 104797
2010-05-27 01:53:40 +00:00
John McCall
c2af939ab4
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.
llvm-svn: 104796
2010-05-27 01:45:30 +00:00
Daniel Dunbar
401304462a
AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.
...
llvm-svn: 104795
2010-05-27 01:12:46 +00:00
Daniel Dunbar
bd60652ace
Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.
...
llvm-svn: 104789
2010-05-27 00:35:16 +00:00
Ted Kremenek
15a0abd399
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.
llvm-svn: 104788
2010-05-27 00:29:00 +00:00
Anders Carlsson
c121b4e59f
More work on the empty subobjects map.
...
llvm-svn: 104787
2010-05-27 00:07:01 +00:00
Daniel Dunbar
69dac58e7d
Sema: Support for #pragma options align={reset,natural}. '#pragma options align'
...
shares the stack with '#pragma pack', who knew!?
llvm-svn: 104786
2010-05-27 00:04:40 +00:00
Daniel Dunbar
75c9be7e80
Parse: Add support for '#pragma options align'.
...
Also, fix a source location bug with the rparen in #pragma pack.
llvm-svn: 104784
2010-05-26 23:29:06 +00:00
John McCall
23f6626262
Correctly pass aggregates by reference when emitting thunks.
...
llvm-svn: 104778
2010-05-26 22:34:26 +00:00
Douglas Gregor
a2db793ff0
Introduce priorities into the code-completion results.
...
llvm-svn: 104751
2010-05-26 22:00:08 +00:00
Nick Lewycky
de2291a717
Grammar fix: s/it's/its/g in
...
"it's spelling location and it's instantiation location"
llvm-svn: 104746
2010-05-26 21:48:10 +00:00
Fariborz Jahanian
5f81b9f3f6
Patch to fix a irgen crash accessing an initialized local static
...
variable in a local function. Fixes pr7101.
llvm-svn: 104743
2010-05-26 21:45:50 +00:00
Ted Kremenek
34ddec630c
Predefine the '__clang_analyzer__' macro when using '-analyze'.
...
llvm-svn: 104742
2010-05-26 21:36:54 +00:00
Fariborz Jahanian
b0e28471a6
Improve on flexible array diagnostics (PR7029).
...
llvm-svn: 104739
2010-05-26 20:46:24 +00:00
Fariborz Jahanian
1138ba6693
Fixes misc. flexible array bugs in c++ (PR7029).
...
llvm-svn: 104733
2010-05-26 20:19:07 +00:00
Anders Carlsson
a5d067aae8
Update .xcodeproj file.
...
llvm-svn: 104721
2010-05-26 19:40:41 +00:00
Charles Davis
c9e78145b0
Extract the ObjC and blocks manglers into their own class. No functionality
...
change.
llvm-svn: 104715
2010-05-26 18:25:27 +00:00
Abramo Bagnara
f9e1214298
Fixed comment.
...
llvm-svn: 104714
2010-05-26 18:17:40 +00:00
Abramo Bagnara
341d783488
Added source order to CXXBaseOrMemberInitializer.
...
llvm-svn: 104712
2010-05-26 18:09:23 +00:00
Anders Carlsson
c5ca1f7799
Move ComputeEmptySubobjectSizes to EmptySubobjectMap.
...
llvm-svn: 104702
2010-05-26 15:54:25 +00:00
Anders Carlsson
f58de11b61
Stub out the EmptySubobjectsMap class.
...
llvm-svn: 104701
2010-05-26 15:32:58 +00:00
Anders Carlsson
ce7f77729a
Inline the RecordLayoutBuilder constructor.
...
llvm-svn: 104700
2010-05-26 15:20:08 +00:00
Anders Carlsson
c28a6c9251
Add a Layout overload that takes a CXXRecordDecl.
...
llvm-svn: 104695
2010-05-26 15:10:00 +00:00
Benjamin Kramer
c7656cdf83
Move RecordLayoutBuilder into an anonymous namespace.
...
llvm-svn: 104693
2010-05-26 09:58:31 +00:00
Douglas Gregor
1b30b3c9fa
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.
llvm-svn: 104690
2010-05-26 07:10:06 +00:00
Anders Carlsson
c222620adf
Rename ASTRecordLayoutBuilder to RecordLayoutBuilder.
...
llvm-svn: 104688
2010-05-26 05:58:59 +00:00
Anders Carlsson
b47c482cf0
Remove RecordLayoutBuilder.h
...
llvm-svn: 104687
2010-05-26 05:49:19 +00:00
Anders Carlsson
35a36eb78d
Move the ASTRecordLayoutBuilder class declaration into the .cpp file.
...
llvm-svn: 104686
2010-05-26 05:41:04 +00:00
Anders Carlsson
c7a800e8d4
ASTRecordLayoutBuilder is no longer a friend of ASTRecordLayout.
...
llvm-svn: 104685
2010-05-26 05:36:18 +00:00
Douglas Gregor
9af03022ff
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>.
llvm-svn: 104684
2010-05-26 05:35:51 +00:00
Anders Carlsson
b48414f4cb
Fix thinko and remove another unused function.
...
llvm-svn: 104683
2010-05-26 05:31:23 +00:00
Anders Carlsson
1d1e4cf04d
Fix build.
...
llvm-svn: 104682
2010-05-26 05:25:15 +00:00
Anders Carlsson
d20e7cd3c6
No need to use the PrimaryBaseInfo struct in the builder.
...
llvm-svn: 104681
2010-05-26 05:20:58 +00:00
Douglas Gregor
0094eb26fc
Be sure to use the standard substitutions when mangling the names of
...
vtables, VTTs, and construction vtables. Fixes PR7201.
llvm-svn: 104675
2010-05-26 05:11:13 +00:00
Anders Carlsson
87209bb54b
Remove FIXME.
...
llvm-svn: 104674
2010-05-26 05:11:02 +00:00
Anders Carlsson
d295486012
Fold the other Layout overload into its sole call site.
...
llvm-svn: 104673
2010-05-26 05:10:47 +00:00
Anders Carlsson
6ed3a9a494
Fold the ASTRecordLayoutBuilder::ComputeLayout overload that takes an ObjCInterfaceDecl pointer into its only callsite.
...
llvm-svn: 104672
2010-05-26 05:04:25 +00:00
Anders Carlsson
df291d8d8b
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.
...
llvm-svn: 104671
2010-05-26 04:56:53 +00:00
Zhongxing Xu
eb4fc4a64c
Small fix.
...
llvm-svn: 104669
2010-05-26 03:36:08 +00:00
Zhongxing Xu
d4f1294f1e
Remove extents of dead symbolic regions when RemoveDeadBindings.
...
This requires creating new persistent states due to the nature of GDM.
llvm-svn: 104668
2010-05-26 03:27:35 +00:00
Douglas Gregor
f64acca2f5
Only enable code patterns (e.g., try { statements } catch (...) {
...
statements }) in the code-completion results if explicitly requested.
llvm-svn: 104637
2010-05-25 21:41:55 +00:00
Ted Kremenek
f5bcc6a285
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.
llvm-svn: 104633
2010-05-25 20:43:29 +00:00
Douglas Gregor
ecd99b1a40
Add Redeclarable boilerplate to TypedefDecl, from Peter Collingbourne!
...
llvm-svn: 104631
2010-05-25 19:53:14 +00:00
Charles Davis
4e786ddccb
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.
llvm-svn: 104630
2010-05-25 19:52:27 +00:00
Daniel Dunbar
4c77a64391
Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not the
...
.s printer or .o writer.
llvm-svn: 104623
2010-05-25 18:41:01 +00:00
Chris Lattner
edde8a99df
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)
llvm-svn: 104620
2010-05-25 17:56:43 +00:00
Douglas Gregor
aab11ede6e
Fix testsuite for blocks mangling change
...
llvm-svn: 104618
2010-05-25 17:46:21 +00:00
Fariborz Jahanian
31b8a9d83f
Refactoring of block-pointer type rewrite.
...
llvm-svn: 104614
2010-05-25 17:12:52 +00:00
Douglas Gregor
02df9da2ac
Fix compilation failure
...
llvm-svn: 104613
2010-05-25 17:12:30 +00:00
Douglas Gregor
7e10f3699a
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>.
llvm-svn: 104610
2010-05-25 17:04:15 +00:00
Fariborz Jahanian
19c6240713
Patch to rewrite block pointers as arguments to
...
methods. (Radar 7987817).
llvm-svn: 104608
2010-05-25 15:56:08 +00:00
Douglas Gregor
b9f907bafc
Make sure to strip off top-level cv-qualifiers as part of a
...
derived-to-base conversion on a pointer. Fixes PR7224.
llvm-svn: 104607
2010-05-25 15:31:05 +00:00
Douglas Gregor
4fb17cc6f8
Put -Wvla into the -Wgnu warning group
...
llvm-svn: 104606
2010-05-25 15:04:55 +00:00
Douglas Gregor
09737ee885
Turn vertical spacing into horizontal spacing in code-completion results
...
llvm-svn: 104586
2010-05-25 06:14:46 +00:00
Douglas Gregor
6da3db4af3
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.
llvm-svn: 104585
2010-05-25 05:58:43 +00:00
Zhongxing Xu
658dd8b176
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.
llvm-svn: 104584
2010-05-25 04:59:19 +00:00
John McCall
7cb0220e53
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.
llvm-svn: 104581
2010-05-25 04:30:21 +00:00
Nick Lewycky
129b381a58
Make this class useful as a base.
...
llvm-svn: 104578
2010-05-25 01:51:06 +00:00
Daniel Dunbar
532177685a
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!
llvm-svn: 104577
2010-05-25 00:33:13 +00:00
Daniel Dunbar
105ce6db87
Simplify.
...
llvm-svn: 104576
2010-05-25 00:32:58 +00:00
Chris Lattner
fb58515bc3
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
llvm-svn: 104569
2010-05-24 22:31:37 +00:00
Chris Lattner
f95c7c8ed2
add a few more categories.
...
llvm-svn: 104566
2010-05-24 21:54:02 +00:00
Chris Lattner
f294c560da
missed an svn add
...
llvm-svn: 104562
2010-05-24 21:38:14 +00:00
Chris Lattner
b997626120
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.
llvm-svn: 104561
2010-05-24 21:35:18 +00:00
Douglas Gregor
9a414458ff
Don't complain about VLAs of non-POD types when the array type is
...
dependent. Fixes <rdar://problem/8021385>.
llvm-svn: 104550
2010-05-24 20:42:30 +00:00
Douglas Gregor
e05d3cb770
A type- or value-dependent expression cannot use bitfield
...
promotion. Fixes <rdar://problem/8020920>.
llvm-svn: 104545
2010-05-24 20:13:53 +00:00
Chris Lattner
787aef9aed
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.
llvm-svn: 104528
2010-05-24 18:37:03 +00:00
Fariborz Jahanian
36680dd751
Fix a rewriting bug where a local static objective-c
...
pointer is copied into a block. Fixes radar 7924024.
llvm-svn: 104526
2010-05-24 18:32:56 +00:00
Fariborz Jahanian
427ee8b5f3
Fix an objective-c rewriter bug when pre-processed file's
...
class declaration's @end is not followed by a new-line.
(radar 7946975).
llvm-svn: 104512
2010-05-24 17:22:38 +00:00
Douglas Gregor
5a5073e4d6
Make sure that we instantiate variably modified types, even if they
...
aren't dependent. Fixes <rdar://problem/8020206>.
llvm-svn: 104511
2010-05-24 17:22:01 +00:00
Douglas Gregor
bb3348ed33
Downgrade deletion of a void* from an error (which is should be) to an
...
extension warning (which other compilers seem to use). Works around a
known bug in Xalan.
llvm-svn: 104509
2010-05-24 17:01:56 +00:00
Douglas Gregor
e87561aa2e
An identity conversion is better than any non-identity
...
conversion. Fixes PR7095.
llvm-svn: 104476
2010-05-23 22:10:15 +00:00
Douglas Gregor
bea453a0fc
In C++, one cannot assign from an arithmetic type to an enumeration
...
type. Fixes PR7051.
llvm-svn: 104475
2010-05-23 21:53:47 +00:00
Douglas Gregor
01308a0e11
Make clang_isFromMainFile() robust against NULL source locations.
...
llvm-svn: 104474
2010-05-23 21:31:22 +00:00
Benjamin Kramer
dc99965343
Add a comment for r104472.
...
llvm-svn: 104473
2010-05-23 20:57:46 +00:00
Benjamin Kramer
11d4d9ec4e
PR5863: Don't erase unreachable BBs which have an associated cleanup size.
...
This works around a crash where malloc reused the memory of an erased BB for a
new BB leaving old cleanup information pointing at the new block.
llvm-svn: 104472
2010-05-23 20:00:44 +00:00
Douglas Gregor
a09387df9f
It turns out that people love using VLAs in templates, too. Weaken our
...
VLA restrictions so that one can use VLAs in templates (even
accidentally), but not as part of a non-type template parameter (which
would be very bad).
llvm-svn: 104471
2010-05-23 19:57:01 +00:00
Douglas Gregor
2788782164
Complain about sizeof(overloaded function) rather than crashing.
...
llvm-svn: 104470
2010-05-23 19:43:23 +00:00
Douglas Gregor
c69978f766
Move OverloadExpr over to a ASTContext-allocated pointer for its
...
storage, rather than an UnresolvedSet.
llvm-svn: 104469
2010-05-23 19:36:40 +00:00
Douglas Gregor
30a4f4c757
Provide the overloaded functions for UnresolvedLookupExpr and
...
UnresolvedMemberExpr in their constructors, rather than adding them
after the fact. No functionality change.
llvm-svn: 104468
2010-05-23 18:57:34 +00:00