Commit Graph

25048 Commits

Author SHA1 Message Date
Tom Care 905c051e47 Modified pseudoconstant test case to make it a bit clearer and fix a missing line
llvm-svn: 111833
2010-08-23 19:57:25 +00:00
Tom Care e332c3b762 Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives

llvm-svn: 111832
2010-08-23 19:51:57 +00:00
Douglas Gregor 2529b55b4d Don't include macro results when we're completing a declarator.
llvm-svn: 111830
2010-08-23 19:33:40 +00:00
Fariborz Jahanian bf9294fb65 Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).

llvm-svn: 111823
2010-08-23 18:51:39 +00:00
Devang Patel df96c75731 test case for PR7920.
llvm-svn: 111821
2010-08-23 18:26:10 +00:00
Douglas Gregor c49f5b2f11 Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.

llvm-svn: 111818
2010-08-23 18:23:48 +00:00
Douglas Gregor f63e4c3334 Emit an error noting that Clang does not support code generation for
the ternary operator without a left-hand side in C++ (PR7726), from
Jean-Daniel Dupas!

llvm-svn: 111809
2010-08-23 14:50:27 +00:00
Douglas Gregor 6181a75d49 Add XML for CXXConstructExpr, from Benoit Belley!
llvm-svn: 111808
2010-08-23 14:44:46 +00:00
Douglas Gregor a05f5aba9a When complaining about a duplicate declspec, provide a Fix-It that
removes the copy. Patch from Eelis van der Weegen, tweaked/updated by
me.

llvm-svn: 111807
2010-08-23 14:34:43 +00:00
Douglas Gregor 34a462538e Clarify documentation of escaping for backslash
llvm-svn: 111806
2010-08-23 14:03:03 +00:00
Chandler Carruth 76c0cb493f Add a virtual destructor to the base of another class hierarchy with virtual
methods.

llvm-svn: 111804
2010-08-23 08:37:21 +00:00
Chandler Carruth c926240172 Relax the construction of a definition for implicit, trivial default
constructors. We perform semantic checking when creating the definition, and
this isn't needed in certain contexts (value initialization) but is in others
(default initialization). This fixes PR7948.

We add explicit code to the default initialization path to ensure the
definition is both present and valid.

Doug, please review. I think this follows your latest suggestion, and it ended
up remarkably cleaner than I anticipated. Also let me know if similar logic
should be followed for destructors and copy-constructors.

llvm-svn: 111802
2010-08-23 07:55:51 +00:00
John McCall 3e56fd4d22 Push DeclGroupRefs and TemplateNames in an opaque but type-safe way
through the parser.

llvm-svn: 111800
2010-08-23 07:28:44 +00:00
Argyrios Kyrtzidis 421ad5e1e6 In Sema::AddBuiltinOperatorCandidates, candidate pointer types set can also contain a ObjCObjectPointerType since r111699.
Don't assume that they are only PointerTypes or we will crash.

llvm-svn: 111798
2010-08-23 07:12:16 +00:00
John McCall 61a148881f chandlerc pointed out that ending a line with /\ is not very friendly. :)
llvm-svn: 111797
2010-08-23 06:56:36 +00:00
John McCall 572ccbc2c2 Kill off Parser::TemplateParameterList to avoid misparses.
llvm-svn: 111796
2010-08-23 06:53:58 +00:00
John McCall 37ad551a25 Sundry incremental steps towards killing off Action.
llvm-svn: 111795
2010-08-23 06:44:23 +00:00
Chris Lattner 65526f0190 fix rdar://8340348, a miscompile of boost that was exposed by r109848.
That revision started classifying truly empty structs like "Y" and "X"
as being NoClass/NoClass and turning them into 'ignore'.  The call code
turns around and allocates space for the ignored argument with 
GetUndefRValue.  The bug is that GetUndefRValue would return the address
as undef, instead of returning an object with a defined address but 
undefined contents.

llvm-svn: 111794
2010-08-23 05:26:13 +00:00
Zhongxing Xu fee32dc783 Adjust code placement.
llvm-svn: 111790
2010-08-23 01:37:32 +00:00
John McCall 7a9aac2d9f Abstract out everything having to do with member pointers into the ABI
class;  they should just be completely opaque throughout IR gen now,
although I haven't really audited that.

Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.

llvm-svn: 111789
2010-08-23 01:21:21 +00:00
John McCall aa4149a2aa Extract a method to check whether a function is the global placement
operator new[].

llvm-svn: 111788
2010-08-23 01:17:59 +00:00
John McCall 614dbdcd55 Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.

llvm-svn: 111786
2010-08-22 21:01:12 +00:00
Nick Lewycky 0b84914da0 Add x86intrin.h which is generic x86 intrinsics for more than just Intel. Thus
far, this just #include's immintrin.h for compatibility.

llvm-svn: 111785
2010-08-22 20:38:05 +00:00
Douglas Gregor ec3a3f5257 Do not elide copy construction when we're performing base-class initialization
llvm-svn: 111783
2010-08-22 18:27:02 +00:00
Douglas Gregor 932c19dc9f Eliminate a stale assertion. Fixes Clang self-host.
llvm-svn: 111782
2010-08-22 18:26:35 +00:00
Douglas Gregor b0a04fff51 Preserve the zero-initialization and construction-kind settings when
instantiating CXXConstructExpr expressions.

llvm-svn: 111780
2010-08-22 17:20:18 +00:00
Douglas Gregor 630c76efb0 When performing value-initialization for a class with a non-trivial,
implicitly-defined default constructor, zero-initialize the memory
before calling the default constructor. Previously, we would only
zero-initialize in the case of a trivial default constructor.

Also, simplify the hideous logic that determines when we have a
trivial default constructor and, therefore, don't need to emit any
call at all.

llvm-svn: 111779
2010-08-22 16:15:35 +00:00
John McCall c29eb8a9d1 Clean up a very silly use of first-class aggregates.
llvm-svn: 111777
2010-08-22 11:04:31 +00:00
John McCall a1dee5300b Experiment with using first-class aggregates to represent member function
pointers.  I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.

llvm-svn: 111776
2010-08-22 10:59:02 +00:00
John McCall 131d97d809 Extract member function pointer comparison and null comparison into
the ABI code.  Implement correct semantics for these on ARM.

I believe this completes the implementation of member function pointers
on ARM.

I think I'm going to switch member function pointers over to be
non-aggregates while I have all this in mind.

llvm-svn: 111774
2010-08-22 08:30:07 +00:00
Chandler Carruth 6f33bd9345 Add two new enumerations to the unsupported list for Windows so that all cases
are handled.

llvm-svn: 111773
2010-08-22 06:56:37 +00:00
John McCall 1c456c89dc Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.

llvm-svn: 111772
2010-08-22 06:43:33 +00:00
John McCall 84fa510aa9 Abstract more member-pointerness out.
llvm-svn: 111771
2010-08-22 04:16:24 +00:00
John McCall a8bbb82c55 Abstract out member-pointer conversions.
Pretty much everything having to do with member pointers is ABI-specific.

llvm-svn: 111770
2010-08-22 03:04:22 +00:00
Eli Friedman 04831926ec Detabify.
llvm-svn: 111768
2010-08-22 01:00:03 +00:00
John McCall d9c6c0b583 Implement the call parts of the member-function-pointer ARM C++ ABI.
llvm-svn: 111766
2010-08-22 00:59:17 +00:00
John McCall 475999dcf9 Extract calls to method pointers out as an ABI routine.
No functionality change.

llvm-svn: 111752
2010-08-22 00:05:51 +00:00
John McCall 86353416a7 The ARM C++ ABI is sufficiently different from the Itanium C++ ABI that
it deserves its own enumerator.  Obviously the implementations should
closely follow the Itanium ABI except in cases of divergence.

llvm-svn: 111749
2010-08-21 22:46:04 +00:00
Michael J. Spencer b186bc3c4b Visual Studio tools used on win32 hosts when targeting win32.
llvm-svn: 111748
2010-08-21 21:55:07 +00:00
Fariborz Jahanian f2afc804c3 twik to my previous patch for pr7936.
Build qualified version of ObjC pointers (not pointers) when
doing overload resolution.

llvm-svn: 111740
2010-08-21 17:11:09 +00:00
Benjamin Kramer 1e0cb91249 Avoid including mm_malloc.h in a cc1 test, it pulls in system headers.
llvm-svn: 111738
2010-08-21 13:39:38 +00:00
Zhongxing Xu faf150bbc3 Place method near its class.
llvm-svn: 111737
2010-08-21 12:24:38 +00:00
Zhongxing Xu 7a1a8e25ea Remove dead code.
llvm-svn: 111736
2010-08-21 11:05:46 +00:00
Zhongxing Xu e11f17f5ed Improve comments.
llvm-svn: 111735
2010-08-21 11:03:37 +00:00
Zhongxing Xu 5cba6c85c9 Remove a special case for OSAtomic functions. We can already bind and retrieve
with the same binding key. The only trick here is that sometimes the Symbolic
region is stored in with an LocAsInteger wrapper. We unwrap that in 
SVal::getAsLocSymbol().

llvm-svn: 111734
2010-08-21 11:00:26 +00:00
John McCall 4887165193 DeclPtrTy -> Decl *
llvm-svn: 111733
2010-08-21 09:40:31 +00:00
Zhongxing Xu e70b6d17a4 Remove dead code. We no longer need it because now we treat the first element
region and its base region as the same binding key.

llvm-svn: 111732
2010-08-21 08:55:42 +00:00
Zhongxing Xu cdadf8d9b2 remove unused variable.
llvm-svn: 111731
2010-08-21 06:51:45 +00:00
Zhongxing Xu adc3ac7012 When invalidating a struct region, whether its type definition exists is not
relavant any more, because we set its default value to a symbol, and the type of
default symbolic value is irrelavant.

llvm-svn: 111730
2010-08-21 06:26:59 +00:00
Michael J. Spencer 1d9c76d637 Fix typo in comment.
llvm-svn: 111729
2010-08-21 06:05:06 +00:00