Commit Graph

23038 Commits

Author SHA1 Message Date
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