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
John McCall
fed68df76c
This test needs a triple: it's checking the alignment of a pointer in bytes.
...
llvm-svn: 111727
2010-08-21 04:58:16 +00:00
Daniel Dunbar
5c816378f8
IRgen: Set the alignment correctly when creating LValue for a decls.
...
- Fixes PR5598.
- Review appreciated.
llvm-svn: 111726
2010-08-21 04:20:22 +00:00
Daniel Dunbar
49e5d12e59
CodeGenFunction: Eliminate unused MakeQualifiers() function.
...
llvm-svn: 111725
2010-08-21 04:13:07 +00:00
Daniel Dunbar
26d2c39b95
Simplify.
...
llvm-svn: 111724
2010-08-21 04:05:54 +00:00
Daniel Dunbar
226bddaff1
IRgen/CGValue: Give MakeAddrLValue() an alignment argument, and eliminate old form of MakeAddr().
...
llvm-svn: 111723
2010-08-21 03:58:45 +00:00
Daniel Dunbar
4bb04cee6a
IRgen: Move remaining LValue::Set... methods to LValue::set... (non-static) methods.
...
llvm-svn: 111722
2010-08-21 03:51:29 +00:00
Daniel Dunbar
f166a523f1
IRgen: Move remaining MakeAddr() calls to MakeAddrLValue().
...
llvm-svn: 111721
2010-08-21 03:44:13 +00:00
Daniel Dunbar
e8b6cda15a
IRgen: The CVR qualifiers in a subobject adjustment should just come from the
...
field (I think).
- Doug, please check.
llvm-svn: 111720
2010-08-21 03:37:02 +00:00
Daniel Dunbar
b657ac51cf
IRgen/CGValue: Add getQuals(), so qualifiers can be modified on an LValue.
...
llvm-svn: 111719
2010-08-21 03:29:54 +00:00
Daniel Dunbar
e50dda95ee
IRgen/LValue: Add LValue::setNonGC instead of SetObjCNonGC, for consistency with isNonGC().
...
llvm-svn: 111718
2010-08-21 03:22:38 +00:00
Daniel Dunbar
2e442a00b3
IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent.
...
llvm-svn: 111717
2010-08-21 03:15:20 +00:00
Daniel Dunbar
f6fb7e2b53
IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue.
...
llvm-svn: 111716
2010-08-21 03:08:16 +00:00
Daniel Dunbar
b1d94a98dd
IRgen: Eliminate EmitPredefinedFunctionName(), it doesn't need to be factored out.
...
llvm-svn: 111715
2010-08-21 03:01:12 +00:00
Daniel Dunbar
93b00a98a3
IRgen: Add an LValue::MakeAddr variant which takes a type and uses that to build
...
the qualifiers.
Also, add CodeGenFunction::MakeAddrLValue() helper function which passes in the
ASTContext.
llvm-svn: 111714
2010-08-21 02:53:44 +00:00
Daniel Dunbar
30eb5fa3ba
Improve test coverage.
...
llvm-svn: 111712
2010-08-21 02:46:28 +00:00
Dan Gohman
25f9aaedc6
Delete an obsolete comment.
...
llvm-svn: 111711
2010-08-21 02:41:29 +00:00
Daniel Dunbar
e3b8dd433c
IRgen/CGValue: Add alignment to LValue, and use that alignment when generating lvalue load/stores.
...
llvm-svn: 111710
2010-08-21 02:39:23 +00:00
Daniel Dunbar
ab4dbea096
IRgen/LValue: Rename SetQualifiers() to Initialize().
...
llvm-svn: 111708
2010-08-21 02:31:58 +00:00
Daniel Dunbar
0381634a61
IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and
...
update callers as best I can.
- This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement.
- Serious review appreciated.
llvm-svn: 111707
2010-08-21 02:24:36 +00:00
Daniel Dunbar
a94e3d1124
IRgen: Use Ty consistently in this function.
...
llvm-svn: 111705
2010-08-21 02:17:08 +00:00
Chris Lattner
fee309467b
filecheckize test
...
llvm-svn: 111702
2010-08-21 00:29:50 +00:00
Chris Lattner
20a2b46ca2
fix PR7943, a corner case with the GNU __VA_ARGS__ comma
...
swallowing extension.
llvm-svn: 111701
2010-08-21 00:27:00 +00:00
Fariborz Jahanian
7a3f3a0402
Contributed test case for PR7936
...
by Jean-Daniel Dupas.
llvm-svn: 111700
2010-08-21 00:17:33 +00:00
Fariborz Jahanian
e4151b590e
patch to support comparison involving
...
objctive-c pointer conversions. Fixes pr7936.
llvm-svn: 111699
2010-08-21 00:10:36 +00:00
Argyrios Kyrtzidis
d32ee89ea2
Fix an issue with writing to PCH another included PCH, introduced by the "using an AST on-disk hash table for name lookup" commit.
...
When including a PCH and later re-emitting to another PCH, the name lookup tables of DeclContexts
may be incomplete, since we now lazily deserialize the visible decls of a particular name.
Fix the issue by iterating over the un-deserialized visible decls and completing the lookup tables
of DeclContexts before writing them out.
llvm-svn: 111698
2010-08-20 23:35:55 +00:00
Argyrios Kyrtzidis
b155b21195
Add an iterator to OnDiskChainedHashTable to allow iterating over all the key/data pairs.
...
llvm-svn: 111697
2010-08-20 23:31:11 +00:00
Fariborz Jahanian
45b31616bd
Remove dead code.
...
llvm-svn: 111693
2010-08-20 23:02:01 +00:00
Benjamin Kramer
6f35f3cd80
Disallow direct inclusion of avxintrin.h. Users should include immintrin.h instead. This matches GCC's behavior.
...
llvm-svn: 111692
2010-08-20 23:00:03 +00:00
Dan Gohman
b1aac3362c
CreateTemporaryType doesn't needs its Context argument.
...
llvm-svn: 111688
2010-08-20 22:39:57 +00:00
Dan Gohman
196f71006e
Introduce a new temporary MDNode concept. Temporary MDNodes are
...
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.
llvm-svn: 111682
2010-08-20 22:02:57 +00:00
Fariborz Jahanian
662f05a035
Rmove dead code.
...
llvm-svn: 111680
2010-08-20 21:45:03 +00:00
Fariborz Jahanian
a50b3a20f1
objective-c ivar refactoring patch. Iterations
...
over ivars for a varienty of puposes is now
consolidated into two small routines; DeepCollectObjCIvars
and ShallowCollectObjCIvars.
llvm-svn: 111679
2010-08-20 21:21:08 +00:00
Nick Lewycky
fe71238b8d
Add a workaround for PR7947, a crash trying to recover from invalid C++ code.
...
llvm-svn: 111675
2010-08-20 20:54:15 +00:00
Dan Gohman
c47a56732c
Add a comment.
...
llvm-svn: 111674
2010-08-20 20:37:16 +00:00
John McCall
8b0666cf79
Another step in the process of making the parser depend on Sema:
...
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.
llvm-svn: 111667
2010-08-20 18:27:03 +00:00
Benjamin Kramer
65b9f7b255
Add immintrin meta header.
...
- This is the official way to get AVX intrinsics, we might want to disallow
direct inclusion of avxintrin.h, just like GCC does.
llvm-svn: 111660
2010-08-20 18:04:07 +00:00
Chris Lattner
1b55b75e24
alphabeticalize
...
llvm-svn: 111654
2010-08-20 17:24:02 +00:00
Chris Lattner
21a597a31d
hopefully unbreak the msvc buildbot.
...
llvm-svn: 111653
2010-08-20 17:23:33 +00:00
Douglas Gregor
e3b3464d4e
Fix a major regression with value-initialization of class types with
...
trivial default constructors. We're weren't zero-initializing them,
which manifested as <rdar://problem/8320532> (a regression in the GCC
test suite) and is likely to have caused significant other breakage.
llvm-svn: 111650
2010-08-20 16:57:37 +00:00
Benjamin Kramer
ae8ea1f715
Fix header comments.
...
llvm-svn: 111645
2010-08-20 16:47:17 +00:00
Chris Lattner
9052c35479
fix some vector extractions to return properly zero extended values
...
(instead of sign extending) to match ICC. GCC is changing this in
a series of their own PRs (e.g. 41323).
llvm-svn: 111637
2010-08-20 16:08:33 +00:00
Argyrios Kyrtzidis
ba88bfab37
Use the AST on-disk hash table for name lookup inside a DeclContext.
...
*Huge* improvement over the amount of deserializing that we do for C++ lookup.
e.g, if he have the Carbon header precompiled and include it on a file containing this:
int x;
these are the before/after stats:
BEFORE:
*** AST File Statistics:
578 stat cache hits
4 stat cache misses
548/30654 source location entries read (1.787695%)
15907/16501 types read (96.400223%)
53525/59955 declarations read (89.275291%)
33993/43525 identifiers read (78.099945%)
41516/51891 statements read (80.006165%)
77/5317 macros read (1.448185%)
0/6335 lexical declcontexts read (0.000000%)
1/5424 visible declcontexts read (0.018437%)
AFTER using the on-disk table:
*** AST File Statistics:
578 stat cache hits
4 stat cache misses
548/30654 source location entries read (1.787695%)
10/16501 types read (0.060602%)
9/59955 declarations read (0.015011%)
161/43525 identifiers read (0.369902%)
20/51891 statements read (0.038542%)
6/5317 macros read (0.112846%)
0/6335 lexical declcontexts read (0.000000%)
2/5424 visible declcontexts read (0.036873%)
There's only one issue affecting mostly the precompiled preambles which I will address soon.
llvm-svn: 111636
2010-08-20 16:04:35 +00:00
Argyrios Kyrtzidis
07347321c6
Introduce the mechanism for building an AST on-disk hash table for name lookup inside a DeclContext but don't use it yet.
...
llvm-svn: 111635
2010-08-20 16:04:27 +00:00
Argyrios Kyrtzidis
082e4613eb
Refactoring; move the functionality of ASTWriter::GetOrCreateTypeID to the more generic
...
MakeTypeID template function which accepts a type and a function object that returns a TypeIdx.
MakeTypeID is in PCHCommon.h so that it can be used by ASTReader too.
llvm-svn: 111634
2010-08-20 16:04:20 +00:00
Argyrios Kyrtzidis
9ab44ea6bd
Introduce ASTWriter::GetOrCreateTypeID and move most of the functionality of AddTypeRef there.
...
No functionality change.
llvm-svn: 111633
2010-08-20 16:04:14 +00:00
Argyrios Kyrtzidis
e394f2ca8b
A bit of refactoring; Introduce ASTWriter::GetOrCreateTypeIdx and move the emission of types there.
...
No functionality change.
llvm-svn: 111632
2010-08-20 16:04:09 +00:00
Argyrios Kyrtzidis
a7fbbb0546
Rename TypeIDs -> TypeIdxs. No functionality change.
...
llvm-svn: 111631
2010-08-20 16:04:04 +00:00
Argyrios Kyrtzidis
bb5c7eae4c
serialization::TypeID is used with or without qualifiers, both as index and as index + qualifiers.
...
Disambiguate and provide some type safety by using a new class TypeIdx for the "TypeID as index" semantics.
llvm-svn: 111630
2010-08-20 16:03:59 +00:00
Argyrios Kyrtzidis
4bd97102e9
Share the common code of ComputeHash(Selector Sel) instead of keeping 2 copies in PCHReader and PCHWriter.
...
No functionality change.
llvm-svn: 111629
2010-08-20 16:03:52 +00:00
Ted Kremenek
87562e8371
Remove dead code.
...
llvm-svn: 111616
2010-08-20 06:06:41 +00:00
Ted Kremenek
b14df8cb60
Update help text for -cc1 -unoptimized-cfg.
...
llvm-svn: 111615
2010-08-20 05:53:47 +00:00
Bob Wilson
b02244969d
Translate NEON vmovl intrinsics to zero/sign-extend operations.
...
llvm-svn: 111612
2010-08-20 03:36:08 +00:00
Douglas Gregor
5be1eb8daf
Revert r111609, which is failing its new test.
...
llvm-svn: 111611
2010-08-20 03:26:10 +00:00
Douglas Gregor
12e2a06824
Eliminate some extraneous whitespace in the machine-parseable Fix-It output.
...
llvm-svn: 111610
2010-08-20 03:17:33 +00:00
John McCall
a189f2eb0a
Detect efforts to declare a template member friend and explicitly ignore them.
...
Avoids a crash.
llvm-svn: 111609
2010-08-20 01:40:01 +00:00
Jordy Rose
796b5122d9
Handle nested compound values in BindArray for multidimensional arrays. Fixes PR7945.
...
llvm-svn: 111602
2010-08-20 01:05:59 +00:00
Douglas Gregor
b97b666c47
When performing code-completion in the presence of a preamble, make
...
sure to (1) actually use the remapped files we were given rather
than old data, and (2) keep the remapped files alive until the
code-completion results are destroyed. Big thanks to Daniel for the
test case.
llvm-svn: 111597
2010-08-20 00:59:43 +00:00
John McCall
f834bcd659
Mangle explicit template arguments in dependent or overloaded names.
...
llvm-svn: 111591
2010-08-20 00:17:19 +00:00
Douglas Gregor
7b02b583b2
When we decide not to reuse a precompiled preamble, clear out the
...
previous precompiled preamble completely. Fixes <rdar://problem/8330950>.
llvm-svn: 111590
2010-08-20 00:02:33 +00:00
John McCall
b3774b5c1e
Regularize the API for accessing explicit template arguments.
...
llvm-svn: 111584
2010-08-19 23:49:38 +00:00
Daniel Dunbar
77af1c564e
libclang: Execute clang_codeCompleteAt() inside a crash recovery context.
...
- Test case is disabled for now, because something isn't write with file
remapping.
llvm-svn: 111581
2010-08-19 23:44:10 +00:00
Daniel Dunbar
186f74215f
c-index-test: Diagnose parse / completion failures in -code-completion-at=.
...
llvm-svn: 111580
2010-08-19 23:44:06 +00:00
Daniel Dunbar
ffc11e2a53
c-index-test: As with reparse, only honor remapped false during the code
...
completion step with -code-completion-at=, to allow testing simulated source
changes.
llvm-svn: 111579
2010-08-19 23:44:04 +00:00
Daniel Dunbar
ce26b3ff2b
libclang/Darwin: Always set the compatibility version in the dylib.
...
llvm-svn: 111578
2010-08-19 23:44:02 +00:00
Douglas Gregor
a03c296e79
Fix some typos in the documentation of -fdiagnostics-parseable-fixits. Typos by me, patch by Eelis van der Weegen
...
llvm-svn: 111573
2010-08-19 23:31:13 +00:00
John McCall
13d031593e
Correctly instantiate templates with non-type template arguments that
...
are local externs. Fixes <rdar://problem/8302138>.
llvm-svn: 111570
2010-08-19 23:06:02 +00:00
Douglas Gregor
086cae6c1f
Fix the source range of an anonymous namespace, from Jan Bierbaum
...
llvm-svn: 111561
2010-08-19 20:55:47 +00:00
Douglas Gregor
fd329a86e3
Intialize all of the code-generation options
...
llvm-svn: 111560
2010-08-19 20:50:45 +00:00
Douglas Gregor
0e3da27c51
Fix a c-index-test leak with file remapping
...
llvm-svn: 111559
2010-08-19 20:50:29 +00:00
Douglas Gregor
eec975ce5a
Add machine-parseable Fix-It output as part of diagnostics, under the
...
flag -fdiagnostics-parseable-fixits, from Eelis van der Weegen!
llvm-svn: 111557
2010-08-19 20:24:43 +00:00
Daniel Dunbar
438c7724f9
Fix a loop overrun in ComputePreamble when the last remapped file was erased,
...
and reenable crash recovery test.
- Reparsing is still very crashy / weird, so I had to sprinkle random code into
the remapped input to get it to do what I want (i.e., crash!).
llvm-svn: 111550
2010-08-19 19:40:40 +00:00
Eli Friedman
3c93e3dae7
Test for PR7888.
...
llvm-svn: 111545
2010-08-19 19:13:24 +00:00
Jordy Rose
1cd2472ac2
Remove dead code. Patch by Jon Mulder!
...
llvm-svn: 111541
2010-08-19 18:59:37 +00:00
Douglas Gregor
c0afc67608
We don't actually need to check the implicit object argument's
...
conversion a second time for a conversion candidate (with the real
acting context), because the only problems we would find are access or
ambiguity issues that won't be diagnosed until we pick this
candidate. Add a test case to prove it to myself.
llvm-svn: 111526
2010-08-19 17:02:01 +00:00
Daniel Dunbar
e6a39d33e5
CrashRecovery: Disable the reparse test for now while I investigate, it goes
...
bonkers sometimes.
llvm-svn: 111523
2010-08-19 16:40:14 +00:00
Douglas Gregor
c9ed4681a8
Properly implement the part of C++ [over.match.funcs]p4 that treats
...
conversion functions as if their acting context were the class that
we're converting from (the implicit object argument's
type). Retroactively tweaking the implicit conversion sequence, as we
were trying to do before, breaks the invariants of that implicit
conversion sequence (e.g., the types and conversions don't match
up). Fixes <rdar://problem/8018274>.
llvm-svn: 111520
2010-08-19 15:57:50 +00:00
Douglas Gregor
6affc78f1b
Include a proper citation for the wacky hijinks involving conversion functions and the implicit object parameter type. No functionality change.
...
llvm-svn: 111519
2010-08-19 15:37:02 +00:00
Anton Yartsev
583a1cf7b5
support for predicates with bool/pixel arguments
...
llvm-svn: 111515
2010-08-19 11:57:49 +00:00
Eli Friedman
19013d90e2
Remove default argument from operator delete; per report on cfe-dev, fixes
...
compilation with MSVC. Note that on other platforms, the operator delete in
question is never used because we compile with -fno-exceptions.
llvm-svn: 111514
2010-08-19 06:13:01 +00:00
Eli Friedman
4202c34539
Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
...
for incomplete enum types. An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.
This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?
llvm-svn: 111512
2010-08-19 04:39:37 +00:00
Anton Yartsev
fc83c60755
support for the rest of AltiVec functions with bool/pixel arguments and return values (except predicates)
...
llvm-svn: 111511
2010-08-19 03:21:36 +00:00
Alexis Hunt
5ac173b69e
Add a missing initializer.
...
llvm-svn: 111510
2010-08-19 03:06:50 +00:00
Anton Yartsev
9e96898032
support for vec_perm and all dependent functions (vec_mergeh, vec_mergel, vec_pack, vec_sld, vec_splat) with bool/pixel arguments and return values
...
llvm-svn: 111509
2010-08-19 03:00:09 +00:00
Charles Davis
6bcb07ad71
Add some enum goodness as requested by Chris. Now instead of storing the
...
active C++ ABI as a raw string, we store it as an enum. This should improve
performance somewhat.
And yes, this time, I started from a clean build directory, and
all the tests passed. :)
llvm-svn: 111507
2010-08-19 02:18:14 +00:00
Douglas Gregor
a0734c5fbd
Plug a leak when precompiling the preamble in ASTUnit.
...
llvm-svn: 111504
2010-08-19 01:33:06 +00:00
John McCall
1ed0182413
Restore the build
...
llvm-svn: 111498
2010-08-19 01:21:57 +00:00
John McCall
5cf48cd17c
On second thought, don't warn about reinterpret_casts under -Wcast-align.
...
llvm-svn: 111497
2010-08-19 01:19:08 +00:00
Charles Davis
c2c576a9e7
Add a special RecordLayoutBuilder for the Microsoft C++ ABI.
...
All it does right now is add space for two vtable pointers instead of one
when a class has both virtual methods and virtual bases. This is a requirement
of the Microsoft ABI, since it has separate vtables for methods and bases. Other
stuff will come up over time, but we'll cross those bridges when we get to
them.
llvm-svn: 111493
2010-08-19 00:55:19 +00:00
Ted Kremenek
50e0105f1c
Add warning for functions/blocks that have attribute 'noreturn' but return a non-void result. (<rdar://problem/7562925>)
...
llvm-svn: 111492
2010-08-19 00:52:13 +00:00
Ted Kremenek
5295ce8120
HandleCommonNoReturnAttr() now only has a single caller. Move that logic to HandleAnalyzerNoReturnAttr.
...
llvm-svn: 111491
2010-08-19 00:51:58 +00:00
Douglas Gregor
4740c4501e
Make sure to initialize ASTUnit::UnsafeToFree
...
llvm-svn: 111490
2010-08-19 00:45:44 +00:00
Douglas Gregor
b473b07cff
Make sure to deallocate the identifier lookup tables and selector tables
...
when destroying an ASTReader. Plugs a leak that shows up in libclang.
llvm-svn: 111488
2010-08-19 00:28:17 +00:00
John McCall
f733268e7a
When deducing the element type of an array, ignore qualifiers if
...
the context allows us to ignore qualifiers on the array type itself.
llvm-svn: 111486
2010-08-19 00:20:19 +00:00
Sebastian Redl
539c506152
Rename pch namespace to serialization.
...
llvm-svn: 111478
2010-08-18 23:57:32 +00:00
Sebastian Redl
47c369f4ed
Rename PCHBitCodes.h -> ASTBitCodes.h
...
llvm-svn: 111476
2010-08-18 23:57:26 +00:00
Sebastian Redl
f164204baa
Rename stuff in PCHBitCodes.h
...
llvm-svn: 111475
2010-08-18 23:57:22 +00:00
Sebastian Redl
f5b1346738
Rename the ASTReader header files.
...
llvm-svn: 111474
2010-08-18 23:57:17 +00:00
Sebastian Redl
3b3c874f68
Rename the ASTReader implementation files.
...
llvm-svn: 111473
2010-08-18 23:57:11 +00:00
Sebastian Redl
d44cd6adba
More PCH -> AST renaming.
...
llvm-svn: 111472
2010-08-18 23:57:06 +00:00
Sebastian Redl
3e31c72497
Rename various classes from PCH to AST.
...
llvm-svn: 111471
2010-08-18 23:56:56 +00:00
Sebastian Redl
70c751de76
Rename PCHStmtReader -> ASTStmtReader.
...
llvm-svn: 111470
2010-08-18 23:56:52 +00:00
Sebastian Redl
b3298c3bb6
Rename PCHDeclReader -> ASTDeclReader.
...
llvm-svn: 111469
2010-08-18 23:56:48 +00:00
Sebastian Redl
2c499f6561
Rename PCHReader to ASTReader.
...
llvm-svn: 111467
2010-08-18 23:56:43 +00:00
Sebastian Redl
1914c6fef8
Rename PCHWriter.h to ASTWriter.h
...
llvm-svn: 111466
2010-08-18 23:56:37 +00:00
Sebastian Redl
d6522cfc6d
Rename the ASTWriter implementation files
...
llvm-svn: 111465
2010-08-18 23:56:31 +00:00
Sebastian Redl
42a0f6a7f2
Do the PCH->AST rename for ASTWriter's implementation parts.
...
llvm-svn: 111464
2010-08-18 23:56:27 +00:00
Sebastian Redl
55c0ad5772
Rename PCHWriter to ASTWriter
...
llvm-svn: 111463
2010-08-18 23:56:21 +00:00
Douglas Gregor
4c6ed904bf
When creating an ASTUnit by parsing source code, set DisableFree to
...
false (not true), so that the CompilerInstance will actually free data
structures when it's done. This fixes a major leak with libclang's
in-process code completion.
llvm-svn: 111457
2010-08-18 23:38:21 +00:00
Alexis Hunt
dcfba7b35b
Generate Attr subclasses with TableGen.
...
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.
Some other notes about newly-generated attribute classes:
- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td
- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).
Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.
llvm-svn: 111455
2010-08-18 23:23:40 +00:00
Daniel Dunbar
79acdd9402
libclang: Put clang_reparseTranslationUnit inside a crash recovery context.
...
llvm-svn: 111451
2010-08-18 23:09:31 +00:00
Daniel Dunbar
211a787eaf
CrashRecovery: Add #pragma clang __debug handle_crash, useful when debugging
...
CrashRecovery since it avoids sending a signal which may be intercepted by the
debugger.
llvm-svn: 111449
2010-08-18 23:09:23 +00:00
Daniel Dunbar
ec29d712d4
c-index-test: Change -test-load-source-repase to only use remapped files for the
...
reparse, to allow testing distinct inputs.
llvm-svn: 111448
2010-08-18 23:09:16 +00:00
Douglas Gregor
f0708dee83
Fix crasher with IgnoringDiagClient
...
llvm-svn: 111447
2010-08-18 23:03:13 +00:00
Douglas Gregor
2dd19f1d5f
Simplify the ownership model for DiagnosticClients, which was really
...
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.
llvm-svn: 111437
2010-08-18 22:29:43 +00:00
Douglas Gregor
fb640869ed
There is no pointer conversion between to similar types (i.e., same
...
type ignoring cv-qualifiers). These are qualification
conversions. Fixes PR7934.
llvm-svn: 111428
2010-08-18 21:25:30 +00:00
Dan Gohman
b37af7de47
Call llvm::remove_fatal_error_handler before deallocating objects
...
which are used by the error handling functions.
llvm-svn: 111427
2010-08-18 21:23:17 +00:00
Tom Care
b9933f365e
Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker.
...
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified
llvm-svn: 111426
2010-08-18 21:17:24 +00:00
John McCall
78fbb61ed7
Contextual arity is a feature of mangling expressions; kill off
...
mangleCallExpression. Also, operator names with unknown arity should
be mangled as binary operators; this is actually covered by an oddly-
positioned sentence in the ABI document. Fixes PR7891.
llvm-svn: 111395
2010-08-18 19:18:59 +00:00
Daniel Dunbar
583c3b775e
libclang: Put clang_parseTranslationUnit inside a crash recovery context.
...
llvm-svn: 111387
2010-08-18 18:43:17 +00:00
Daniel Dunbar
c91f2fff98
libclang: Implicitly enable crash recovery when using the libclang APIs. We may need to add an explicit API call, but hopefully we can make the crash recovery seamless enough that it doesn't make sense to turn it off.
...
llvm-svn: 111386
2010-08-18 18:43:14 +00:00
Chris Lattner
396639db95
zap dead code.
...
llvm-svn: 111365
2010-08-18 16:09:06 +00:00
Chris Lattner
66b67d209e
no need to pass bumppointer allocator into macroinfo::destroy
...
llvm-svn: 111364
2010-08-18 16:08:51 +00:00
Douglas Gregor
c1a42fdd53
Make sure to add MallocAttr to explicitly-declared operator new/new[]
...
when -fassume-sane-operator-new. Patch by Tom Jablin!
llvm-svn: 111363
2010-08-18 15:06:25 +00:00
Douglas Gregor
b13f5d99af
Simplify FixItHint by eliminated the unnecessary InsertionLoc
...
location. Patch by Eelis van der Weegen!
llvm-svn: 111362
2010-08-18 14:24:02 +00:00
John McCall
8f42893aff
Flesh out the test cases a little.
...
llvm-svn: 111359
2010-08-18 09:58:15 +00:00
John McCall
02db245d5e
Rip out the existing retroactive abstract-class usage checker,
...
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class. Also, look into templates when doing this.
llvm-svn: 111357
2010-08-18 09:41:07 +00:00
Argyrios Kyrtzidis
6e617ea509
Remove -Wunused-member-function from the 'Extra' diagnostic group too; llvm uses it.
...
This effectively disables -Wunused-member-function for building llvm/clang.
llvm-svn: 111356
2010-08-18 08:32:33 +00:00
Chandler Carruth
33646fd72a
Check whether errors should be included in the diagnostic counts. Previously,
...
only warnings did this check.
llvm-svn: 111355
2010-08-18 06:46:41 +00:00
Jordy Rose
8258499f42
Remove dead malloc symbols from the symbol-state map.
...
llvm-svn: 111353
2010-08-18 04:33:47 +00:00
Jordy Rose
bc80329f1f
Use RegionStateTy everywhere we mean ImmutableMap<SymbolRef, RefState>
...
llvm-svn: 111351
2010-08-18 04:26:59 +00:00
Chris Lattner
2a2a468d1a
zap dead code.
...
llvm-svn: 111347
2010-08-18 02:45:56 +00:00
Chris Lattner
e876fcd77a
zap a big dead method.
...
llvm-svn: 111346
2010-08-18 02:44:19 +00:00
Douglas Gregor
caa1bf434d
Emit an error if an array is too large. We're slightly more strict
...
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.
Fixes <rdar://problem/8212293>.
llvm-svn: 111338
2010-08-18 00:39:00 +00:00
Chris Lattner
aa94cc3fcd
fix typo
...
llvm-svn: 111334
2010-08-18 00:13:52 +00:00
Chris Lattner
b1995dffaf
Fix PR7889 by generalizing some over specialized code. There is no
...
reason that this should be limited to simple lvalues.
llvm-svn: 111331
2010-08-18 00:08:27 +00:00
Chris Lattner
00d5141aef
fix PR7892, a crash on valid in c++ codegen of __PRETTY_FUNCTION__
...
llvm-svn: 111330
2010-08-17 23:58:10 +00:00
Ted Kremenek
e890042c7b
TypedRegion::isBoundable() should return true by default. Since there is no TypedViewRegion anyore, it is not possible that the subclass (which doesn't override isBoundable) could return a null value type.
...
llvm-svn: 111329
2010-08-17 23:51:30 +00:00
Fariborz Jahanian
358acd5dff
Get rid of extra nesting when checking for invalid type,
...
per Doug's comment.
llvm-svn: 111328
2010-08-17 23:50:37 +00:00
Ted Kremenek
5322150a7f
Rewrite code fragment to avoide ICE in MSVC. Fixes PR 7875. Patch by Dimitry Andric!
...
llvm-svn: 111327
2010-08-17 23:29:06 +00:00
Fariborz Jahanian
9d7d3d84ac
Diagnose if type of iboutletcollection attribute is a builtin type.
...
llvm-svn: 111324
2010-08-17 23:19:16 +00:00
Sebastian Redl
dd0087154a
Get rid of pretty non-ASCII quotes.
...
llvm-svn: 111316
2010-08-17 22:42:34 +00:00
Daniel Dunbar
56df97761d
StringRef'ication of lots stuff, patch by Peter Davies!
...
llvm-svn: 111314
2010-08-17 22:39:59 +00:00
Daniel Dunbar
f2cf329ccd
Lex: Add #pragma clang __debug {llvm_fatal_error, llvm_unreachable}, for testing
...
those crash paths.
llvm-svn: 111311
2010-08-17 22:32:48 +00:00
Daniel Dunbar
b613ffc1aa
Driver: Claim the -mlinker-version synthesized argument, it shouldn't be
...
reported as unused.
llvm-svn: 111310
2010-08-17 22:32:45 +00:00
Argyrios Kyrtzidis
beb71b315a
Rename -Wunused-method -> -Wunused-member-function.
...
llvm-svn: 111305
2010-08-17 22:06:44 +00:00
Ted Kremenek
5c3cea7b09
Remove dead code.
...
llvm-svn: 111304
2010-08-17 22:05:33 +00:00
John McCall
6d86202fa7
Whoops. Don't fall through into the overload case when mangling a
...
dependent call expression.
llvm-svn: 111300
2010-08-17 21:51:21 +00:00
Argyrios Kyrtzidis
cad715fb9b
Introduce -Wunused-method option for warning on unused class methods in anonymous namespace.
...
This option is not part of the Unused diagnostic group until the warnings on llvm codebase are fixed
and we are ready to turn it on. Suggestion by Daniel.
llvm-svn: 111298
2010-08-17 21:43:11 +00:00
Fariborz Jahanian
798f83239c
Diagnose use of iboutletcollection on ivar/property
...
of non-object types. Radar 8308053.
llvm-svn: 111296
2010-08-17 21:39:27 +00:00
John McCall
815039af77
Implicit decl ref expressions might not have name locations; don't silently
...
fail to instantiate them.
llvm-svn: 111293
2010-08-17 21:27:17 +00:00
Sebastian Redl
7940e6fb1d
Fix CMake build
...
llvm-svn: 111284
2010-08-17 21:00:23 +00:00
Ted Kremenek
4f2ab5a549
Fix horrible CFG bug caused by a series of NullStmts appearing at the beginning of a do...while loop. This would cause
...
the body of the DoStmt to be disconnected from the preceding code.
llvm-svn: 111283
2010-08-17 21:00:06 +00:00
Ted Kremenek
110974dfa4
CFGBuilder: don't create the empty "loop back" block for DoStmts if the loop edge can never be taken.
...
llvm-svn: 111282
2010-08-17 20:59:56 +00:00
Sebastian Redl
135bcc791b
Reintroduce the serialization library, with fixed dependencies.
...
llvm-svn: 111279
2010-08-17 20:43:28 +00:00
Fariborz Jahanian
b5d59b66c2
Patch to add type parameter support for attribute iboutletcollection.
...
Radar 8308053.
llvm-svn: 111275
2010-08-17 20:23:12 +00:00
Douglas Gregor
600c4f6d84
Remove the last bit of the Clang Serialization library, for now
...
llvm-svn: 111267
2010-08-17 19:00:27 +00:00
Douglas Gregor
256a7282e4
Revert Sebastian's build-breaking patch.
...
llvm-svn: 111265
2010-08-17 18:31:01 +00:00
Dan Gohman
b1e20869a2
Add the clangSerialization library to libclang.
...
llvm-svn: 111261
2010-08-17 18:07:30 +00:00
Sebastian Redl
52ce9bb2fb
Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.
...
llvm-svn: 111258
2010-08-17 17:55:49 +00:00
Sebastian Redl
ea68af43e8
Fix a typo in a diag name.
...
llvm-svn: 111257
2010-08-17 17:55:38 +00:00
Daniel Dunbar
71323e66b6
Remove a gratuitous lie.
...
llvm-svn: 111253
2010-08-17 17:34:48 +00:00
Douglas Gregor
175ea046ee
A member function never has "C" linkage. Fixes <rdar://problem/8318976>.
...
llvm-svn: 111238
2010-08-17 16:09:23 +00:00
Douglas Gregor
7116a8c19a
When generating code completion patterns for method declarations, give
...
the resulting pattern the appropriate cursor kind of an instance or
class method declaration.
llvm-svn: 111237
2010-08-17 16:06:07 +00:00
Chris Lattner
b5050f3cd0
apparently msvc defines _STDCALL_SUPPORTED, so we should
...
too. Patch by Per Linden!
llvm-svn: 111236
2010-08-17 16:02:32 +00:00
Chris Lattner
d28e6cc554
Add a slightly better hack for microsoft style inline asm,
...
patch by Per Linden!
llvm-svn: 111235
2010-08-17 16:00:12 +00:00
Chris Lattner
c0a585d63c
Implement #pragma push_macro, patch by Francois Pichet!
...
llvm-svn: 111234
2010-08-17 15:55:45 +00:00
Douglas Gregor
b0ce9b79ba
1 != I. Fix the formulation of code-completion patterns for
...
Objective-C method declarations with > 2 parameters.
llvm-svn: 111233
2010-08-17 15:53:35 +00:00
Benjamin Kramer
35b077e674
Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
...
and remove getStrData(). Patch by Peter Davies (with some tweaks).
llvm-svn: 111229
2010-08-17 12:54:38 +00:00
John McCall
3696dcb171
Don't try to initialize a reference with a constructed temporary if either
...
of the classes is invalid. A class is invalid if a base is invalid.
llvm-svn: 111227
2010-08-17 07:23:57 +00:00
Douglas Gregor
2c8bd47a6a
When the # of top-level declarations changes after reparsing a
...
translation unit, refresh code-completion results because they've
probably changed. However, enforce a cooldown period between
refreshes, to avoid thrashing.
llvm-svn: 111218
2010-08-17 00:40:40 +00:00
Zhongxing Xu
a66d1694f4
Generate a node instead of a sink. A leak is not a fatal error.
...
llvm-svn: 111217
2010-08-17 00:36:37 +00:00
John McCall
2677e10732
A field of incomplete type is sufficiently disruptive that we should mark
...
the record invalid.
llvm-svn: 111211
2010-08-16 23:42:35 +00:00
Eli Friedman
c3e9df3cc0
Move a bunch of code out of the ComplexExprEvaluator class definition;
...
no functionality change.
llvm-svn: 111207
2010-08-16 23:27:44 +00:00
Jordy Rose
5ccde8593f
Allow the "size" of a buffer access check to be either signed or unsigned. Fixes PR7925.
...
llvm-svn: 111205
2010-08-16 23:25:19 +00:00
Douglas Gregor
40a5a7de1d
Move include to the proper place. No functionality change
...
llvm-svn: 111204
2010-08-16 23:08:34 +00:00
Douglas Gregor
59cab5564f
Implement support for cached code completions for
...
nested-name-specifiers. Also includes fixes to the generation of
nested-name-specifier result in the non-cached case; we were producing
lame results for namespaces and namespace aliases, which (1) didn't
always have nested-name-specifiers when we want them, and (2) did not
have the necessary "::" as part of the completion.
llvm-svn: 111203
2010-08-16 23:05:20 +00:00
Fariborz Jahanian
99311ba1a8
Diagnose assiging to an interface object in
...
non-fragile abi mode as sizes are not statically known.
Fixes radar 8315734.
llvm-svn: 111191
2010-08-16 21:51:12 +00:00
Tom Care
c129cc18f0
Added basic psuedoconstant checking in IdempotentOperationChecker and fixed some test cases.
...
llvm-svn: 111190
2010-08-16 21:43:52 +00:00
Douglas Gregor
df239670d4
Formatting fixes. No functionality change
...
llvm-svn: 111186
2010-08-16 21:23:13 +00:00
Douglas Gregor
6199f2d146
Implement name hiding of cached global code-completion results.
...
llvm-svn: 111184
2010-08-16 21:18:39 +00:00
Jordy Rose
63a38a1b94
Instead of using operator bool() for testing if a BindingKey is valid, use an explicit isValid() method.
...
llvm-svn: 111181
2010-08-16 20:53:01 +00:00
Jordy Rose
4a57ec86bb
Move GRState::AssumeInBound out of its header file -- it's not really inline-friendly anymore.
...
llvm-svn: 111179
2010-08-16 20:34:06 +00:00
Douglas Gregor
d46cf182a4
Move some code out-of-line which has long since grown too large to be
...
inlined. No functionality change.
llvm-svn: 111176
2010-08-16 20:01:48 +00:00
Sebastian Redl
6ebb51a41d
Add two options for playing with modules.
...
llvm-svn: 111166
2010-08-16 18:17:11 +00:00
Douglas Gregor
b61c07aca0
When caching code completions for global declarations, keep track of
...
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit.
For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.
llvm-svn: 111165
2010-08-16 18:08:11 +00:00
Fariborz Jahanian
055068df4a
Fix a crash when parsing malformed out-of-line member function
...
definition. radar 8307865.
llvm-svn: 111163
2010-08-16 17:58:53 +00:00
Argyrios Kyrtzidis
a3ae3eb690
Fix initialization for members of anonymous struct in a union.
...
llvm-svn: 111159
2010-08-16 17:27:13 +00:00
Argyrios Kyrtzidis
33aee3934a
Emit diagnostic error when the field of an anonymous struct is non trivial.
...
llvm-svn: 111158
2010-08-16 17:27:08 +00:00
Douglas Gregor
247474085e
Dereferencing NULL pointers is such poor form.
...
llvm-svn: 111150
2010-08-16 16:46:30 +00:00
Anton Yartsev
2cc136d4e3
support for vec_add, vec_adds, vec_and, vec_andc with bool arguments
...
llvm-svn: 111141
2010-08-16 16:22:12 +00:00
Douglas Gregor
6e24033bd2
When caching global completion results, keep track of the simplified
...
type class, so that we can adjust priorities appropriately when the
preferred type for the context and the actual type of the completion
are similar.
This gets us one step closer to parity of the cached completion
results with the non-cached completion results.
llvm-svn: 111139
2010-08-16 16:18:59 +00:00
Abramo Bagnara
217e902b1d
Fixed typo in conj, conjf, conjl signature.
...
llvm-svn: 111134
2010-08-16 15:57:05 +00:00
Jordy Rose
722f558f07
Model the effects of strcpy() and stpcpy() in CStringChecker. Other changes:
...
- Fix memcpy() and friends to actually invalidate the destination buffer.
- Emit a different message for out-of-bounds buffer accesses if the buffer is being written to.
- When conjuring symbols, let ValueManager figure out the type.
llvm-svn: 111120
2010-08-16 07:51:42 +00:00
Charles Davis
ebab1ed5d3
Error out if reinterpret_casting between member pointers of two different
...
sizes.
llvm-svn: 111119
2010-08-16 05:30:44 +00:00
Charles Davis
2d3694297d
Err on incomplete class types in member pointers when compiling for the
...
Microsoft C++ ABI, for now.
llvm-svn: 111118
2010-08-16 04:01:50 +00:00
Charles Davis
53c59df2f7
Implement support for member pointers under the Microsoft C++ ABI in the
...
AST library.
This also adds infrastructure for supporting multiple C++ ABIs in the AST.
llvm-svn: 111117
2010-08-16 03:33:14 +00:00
Jordy Rose
df28e8ec41
- Allow making ElementRegions with complex offsets (expressions or symbols) for the purpose of bounds-checking.
...
- Rewrite GRState::AssumeInBound to actually do that checking, and to use the normal constraint path.
- Remove ConstraintManager::AssumeInBound.
- Teach RegionStore and FlatStore to ignore those regions for now.
llvm-svn: 111116
2010-08-16 01:15:17 +00:00
David Chisnall
589a494352
Pass some things to the linker that gcc passes. -r is the only one of these that I'm sure about, but the others seem to be listed on FreeBSD by gcc -dumpspecs, so I hope they're right. Apparently -r is also not passed on GNU/Linux (and should be), but I can't see where the toolchain definition for this platform live.
...
llvm-svn: 111114
2010-08-15 22:58:12 +00:00
Jordy Rose
d2b777a409
Move GRState's bind* methods out of its header file -- they're too big for inlining now.
...
llvm-svn: 111113
2010-08-15 22:19:33 +00:00
Argyrios Kyrtzidis
b482eb8b28
Call the base class in StmtProfiler::VisitOverloadExpr.
...
llvm-svn: 111110
2010-08-15 20:53:20 +00:00
Benjamin Kramer
340045b204
Open AST/PCH files in binary mode.
...
llvm-svn: 111106
2010-08-15 16:54:31 +00:00
Nick Lewycky
53f1042dc1
Make the FixItOptions object required instead of optional.
...
llvm-svn: 111105
2010-08-15 16:47:39 +00:00
Zhongxing Xu
ee770d40fd
StoreManager::RemoveDeadBindings() can take a Store instead of an entire GRState now.
...
llvm-svn: 111103
2010-08-15 12:45:09 +00:00
Argyrios Kyrtzidis
499e6e49e7
Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.
...
llvm-svn: 111101
2010-08-15 10:17:39 +00:00
Argyrios Kyrtzidis
04c7fa09e4
Don't warn for the common pattern of disallowing copying:
...
class S {
S(const S&); // DO NOT IMPLEMENT
void operator=(const S&); // DO NOT IMPLEMENT
};
llvm-svn: 111100
2010-08-15 10:17:33 +00:00
Zhongxing Xu
0ba9fd6c47
Remove redundant method.
...
llvm-svn: 111099
2010-08-15 10:08:38 +00:00
Zhongxing Xu
bce831f7e0
Implement MallocChecker::EvalDeadSymbols() with the new API. This time we
...
iterate over symbols being tracked, instead of symbols being dead.
llvm-svn: 111097
2010-08-15 08:19:57 +00:00
Douglas Gregor
3998219789
Extend the code-completion caching infrastructure to include global
...
declarations (in addition to macros). Each kind of declaration maps to
a certain set of completion contexts, and the ASTUnit completion logic
introduces the completion strings for those declarations if the actual
code-completion occurs in one of the contexts where it matters.
There are a few new code-completion-context kinds. Without these,
certain completions (e.g., after "using namespace") would need to
suppress all global completions, which would be unfortunate.
Note that we don't get the priorities right for global completions,
because we don't have enough type information. We'll need a way to
compare types in an ASTContext-agnostic way before this can be
implemented.
llvm-svn: 111093
2010-08-15 06:18:01 +00:00
Eli Friedman
f8d9817f4b
Use Enumerators.data() instead of &Enumerators[0] to fix a potential
...
assertion failure.
llvm-svn: 111092
2010-08-15 02:27:09 +00:00
Argyrios Kyrtzidis
1cec2cc798
Remove dead code, caught by unused function warnings.
...
llvm-svn: 111091
2010-08-15 01:15:58 +00:00
Argyrios Kyrtzidis
c99bab034c
DependentTypeOfExprType and DependentDecltypeType are not seen by client code.
...
llvm-svn: 111090
2010-08-15 01:15:44 +00:00