Fariborz Jahanian
2990c029ad
Fix a problem related to rewrite of anonymous unions.
...
(fixes radar 6948022)
llvm-svn: 93186
2010-01-11 21:17:32 +00:00
Benjamin Kramer
378083101c
Fix pasto.
...
llvm-svn: 93181
2010-01-11 20:15:06 +00:00
Chris Lattner
e3e76e2a69
Use the new isInteger() method in a couple places, some random cleanup, and
...
add a fixme.
llvm-svn: 93179
2010-01-11 19:58:10 +00:00
Douglas Gregor
b90b66178e
When resolving a single function template specialization to a
...
function, be sure to adjust the resulting argument type to a pointer
(if necessary). Fixes PR5910 and PR5949.
llvm-svn: 93178
2010-01-11 19:55:36 +00:00
Douglas Gregor
0662b16ad2
Test case for naming of conversion function template specializations
...
llvm-svn: 93177
2010-01-11 19:52:23 +00:00
Benjamin Kramer
0129bd7432
Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).
...
llvm-svn: 93175
2010-01-11 19:46:28 +00:00
Douglas Gregor
2159182078
When computing surrogates for calls to a value of object type, look
...
for all visible conversion functions.
llvm-svn: 93173
2010-01-11 19:36:35 +00:00
Ken Dyck
de37a67f50
Change return type of getObjCEncodingTypeSize() to CharUnits as the units are in characters.
...
llvm-svn: 93171
2010-01-11 19:19:56 +00:00
David Chisnall
c8fc573ea0
Fix type mismatch on 64-bit platforms (GNU ObjC).
...
llvm-svn: 93169
2010-01-11 19:02:35 +00:00
Douglas Gregor
217604ac71
Remove some pointless FIXMEs. No functionality change
...
llvm-svn: 93168
2010-01-11 19:00:50 +00:00
Douglas Gregor
133bc74d7a
Add support for out-of-line definitions of conversion function
...
templates. Previously, a little thinko in the code that replaced a
conversion function template with its redeclaration was causing some
very weird lookup behavior.
llvm-svn: 93166
2010-01-11 18:53:25 +00:00
Douglas Gregor
bb91767b82
Tighten up the "cannot return array or function type" diagnostic to
...
say either "array type" or "function type", whichever it is. No reason
to make the user guess.
llvm-svn: 93164
2010-01-11 18:46:21 +00:00
Douglas Gregor
ea0a0a9b3f
Implement name lookup for conversion function template specializations
...
(C++ [temp.mem]p5-6), which involves template argument deduction based
on the type named, e.g., given
struct X { template<typename T> operator T*(); } x;
when we call
x.operator int*();
we perform template argument deduction to determine that T=int. This
template argument deduction is needed for template specialization and
explicit instantiation, e.g.,
template<> X::operator float*() { /* ... */ }
and when calling or otherwise naming a conversion function (as in the
first example).
This fixes PR5742 and PR5762, although there's some remaining ugliness
that's causing out-of-line definitions of conversion function
templates to fail. I'll look into that separately.
llvm-svn: 93162
2010-01-11 18:40:55 +00:00
Fariborz Jahanian
9146e44124
Fixup rewrite of ivars accessed via an explicit object
...
in a function. Fixes radar 7522803.
llvm-svn: 93159
2010-01-11 17:50:35 +00:00
Ken Dyck
40775003e6
Roll out ASTContext::getTypeSizeInChars(), replacing instances of
...
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.
Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.
llvm-svn: 93153
2010-01-11 17:06:35 +00:00
Sebastian Redl
9a8dd0db89
Make Clang complain about taking the address of an unqualified member function. Fixes PR5985.
...
llvm-svn: 93150
2010-01-11 15:56:56 +00:00
Zhongxing Xu
e47550e452
Enhance ScanReachableSymbols::scan(). Now another OSAtomic test case passes.
...
The old test case has a little mistake.
llvm-svn: 93148
2010-01-11 07:40:00 +00:00
Zhongxing Xu
cbbf855432
Enhance SVals::getAsRegion: get the region that is converted to an integer.
...
This with previous patch fixes a OSAtomic test case.
llvm-svn: 93146
2010-01-11 06:52:53 +00:00
Chris Lattner
21d9b9a948
add a TODO for a perf improvement in LexIdentifier.
...
llvm-svn: 93141
2010-01-11 02:38:50 +00:00
Ted Kremenek
be909b5eff
Switch RegionStore over to using <BaseRegion+raw offset> to store
...
value bindings. Along with a small change to OSAtomicChecker, this
resolves <rdar://problem/7527292> and resolves some long-standing
issues with how values can be bound to the same physical address by
not have the same "key". This change is only a beginning; logically
RegionStore needs to better handle loads from addresses where the
stored value is larger/smaller/different type than the loaded value.
We handle these cases in an approximate fashion now (via
CastRetrievedVal and help in SimpleSValuator), but it could be made
much smarter.
llvm-svn: 93137
2010-01-11 02:33:26 +00:00
Ted Kremenek
8e994a2808
Preliminary reworking of value-binding logic in RegionStore:
...
(1) Introduce a new 'BindingKey' class to match 'BindingValue'. This
gives us the flexibility to change the current key value from 'const
MemRegion*' to something more interesting.
(2) Rework additions/removals/lookups from the store to use new
'Remove', 'Add', 'Lookup' utility methods.
No "real" functionality change; just prep work and abstraction.
llvm-svn: 93136
2010-01-11 00:07:44 +00:00
Alexis Hunt
91b78382b5
Do not parse hexadecimal floating point literals in C++0x mode because they are
...
incompatible with user-defined literals, specifically with the following form:
0x1p+1
The preprocessing-number token extends only as far as the 'p'; the '+' is not
included. Previously we could get away with this extension as p was an invalid
suffix, but now with user-defined literals, 'p' might well be a valid suffix
and we are forced to consider it as such.
This patch also adds a warning in non-0x C++ modes telling the user that
this extension is incompatible with C++0x that is enabled by default
(previously and with other languages, we warn only with a compliance
option such as -pedantic).
llvm-svn: 93135
2010-01-10 23:37:56 +00:00
Douglas Gregor
504a6ae83e
Improve code completion by introducing patterns for the various C and
...
C++ grammatical constructs that show up in top-level (namespace-level)
declarations, member declarations, template declarations, statements,
expressions, conditions, etc. For example, we now provide a pattern
for
static_cast<type>(expr)
when we can have an expression, or
using namespace identifier;
when we can have a using directive.
Also, improves the results of code completion at the beginning of a
top-level declaration. Previously, we would see value names (function
names, global variables, etc.); now we see types, namespace names,
etc., but no values.
llvm-svn: 93134
2010-01-10 23:08:15 +00:00
Ted Kremenek
ec144538ae
Make sure this test case tests analyzing both x86_64 and i386 archs.
...
llvm-svn: 93133
2010-01-10 22:31:25 +00:00
Benjamin Kramer
e056cea3a6
Silence MSVC warning.
...
RewriteObjC.cpp(4419) : warning C4804: '>' : unsafe use of type 'bool' in operation
llvm-svn: 93124
2010-01-10 19:57:50 +00:00
Anton Korobeynikov
3d364fddda
Make clone() method out-of-line for Attr classes.
...
llvm-svn: 93120
2010-01-10 14:38:13 +00:00
Anton Korobeynikov
b322c3a34b
Try to make cmake happy
...
llvm-svn: 93119
2010-01-10 13:06:34 +00:00
Anton Korobeynikov
55bcea1e65
Generalize target weirdness handling having proper layering in mind:
...
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes
As a proof-of-concept - implement msp430's 'interrupt' attribute.
llvm-svn: 93118
2010-01-10 12:58:08 +00:00
Anton Korobeynikov
89b14a4309
Rename file to generalization in next commits
...
llvm-svn: 93117
2010-01-10 12:57:30 +00:00
Benjamin Kramer
307c2c7ebc
Simplify code. No functionality change.
...
llvm-svn: 93114
2010-01-10 09:51:00 +00:00
Zhongxing Xu
9635f6f5ef
Enhance test case.
...
llvm-svn: 93101
2010-01-10 02:52:56 +00:00
Chris Lattner
d081f8c851
stringref'ize a bunch of filename handling logic. Much
...
nicer than passing around two const char*'s.
llvm-svn: 93094
2010-01-10 01:35:12 +00:00
Chris Lattner
e0d2e342b3
try to make this more stable?
...
llvm-svn: 93090
2010-01-10 00:59:17 +00:00
Daniel Dunbar
d281a7146a
Fix PR5982, a refacto in checking for '=' in a -D argument.
...
llvm-svn: 93088
2010-01-10 00:46:21 +00:00
Daniel Dunbar
620327d66b
Fix a FIXME.
...
llvm-svn: 93087
2010-01-10 00:46:10 +00:00
Daniel Dunbar
1c4788b66b
Darwin/ld: Don't pass '-weak_reference_mismatches non-weak' when
...
-weak_reference_mismatches is not present, it is the default.
llvm-svn: 93086
2010-01-10 00:46:00 +00:00
Chris Lattner
062a721c46
add comment to test.
...
llvm-svn: 93085
2010-01-10 00:36:16 +00:00
Chris Lattner
abcbb7c05b
clarify comment.
...
llvm-svn: 93084
2010-01-10 00:35:27 +00:00
Chris Lattner
2ceb625f59
implement rdar://7520940: published framework headers should
...
import other headers within the same framework with the full
framework path, not with a relative include.
llvm-svn: 93083
2010-01-10 00:24:58 +00:00
Ted Kremenek
c6aa800eb3
Fix overzealous assertion in GRExprEngine::VisitLValue(). A
...
CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it
returns a struct temporary. Currently the analyzer doesn't reason
about struct temporary returned by function calls, but we shouldn't
crash here either.
llvm-svn: 93081
2010-01-09 22:58:54 +00:00
Chris Lattner
e23003d1f1
implement -ftabstop=width, patch by Christian Adåker
...
llvm-svn: 93078
2010-01-09 21:54:33 +00:00
Chris Lattner
b71980f888
revert 91891, a workaround for PR5514.
...
llvm-svn: 93077
2010-01-09 21:45:57 +00:00
Chris Lattner
bb8976e36e
implement codegen support for preinc as an lvalue, PR5514.
...
llvm-svn: 93076
2010-01-09 21:44:40 +00:00
Chris Lattner
116ce8f172
refactor pre/postinc logic into CGF and require the caller to pass in the
...
lvalue to poke, no functionality change.
llvm-svn: 93075
2010-01-09 21:40:03 +00:00
Chris Lattner
34c72dd683
revert r92749, which is just dead code.
...
llvm-svn: 93074
2010-01-09 21:14:47 +00:00
Chris Lattner
5ed4390474
make missing prototypes warn by default in c99 mode like GCC does,
...
rdar://7083878
llvm-svn: 93073
2010-01-09 20:43:38 +00:00
Chris Lattner
f9895c48fd
add a bunch of missing prototypes to tests
...
llvm-svn: 93072
2010-01-09 20:43:19 +00:00
Ted Kremenek
9aa01441c3
Fix broken diagnostic when returning the address of a stack-allocated array.
...
llvm-svn: 93071
2010-01-09 20:05:00 +00:00
Benjamin Kramer
60fbd641ad
Simplify with StringSwitch.
...
llvm-svn: 93064
2010-01-09 18:53:11 +00:00
Chris Lattner
09ac1b888c
2010 is here.
...
llvm-svn: 93063
2010-01-09 18:40:42 +00:00
Benjamin Kramer
dc2f006f4e
Hopefully unbreak build with g++ >= 4.3.
...
llvm-svn: 93060
2010-01-09 18:20:57 +00:00
Benjamin Kramer
2d6fda3205
Use MacroBuilder for TargetDefines instead of std::vector.
...
llvm-svn: 93058
2010-01-09 17:55:51 +00:00
Benjamin Kramer
3f6323dea5
Move MacroBuilder into Frontend/Utils.h and clean it up a bit.
...
llvm-svn: 93057
2010-01-09 17:43:21 +00:00
Benjamin Kramer
f65e959035
Rework InitPreprocessor to use a MacroBuilder class instead of pushing around
...
std::vectors.
- MacroBuilder wraps a raw_ostream so it can easily write to any buffer
supported by raw_ostream.
- MacroBuilder's method take Twines for easy string concatenation (this was done
with sprintf and temporary buffers before).
- Targets still use std::vector as they don't have access to the builder.
llvm-svn: 93051
2010-01-09 16:17:37 +00:00
Kovarththanan Rajaratnam
e8ed5be89f
Switch UndefineBuiltinMacro() over to using StringRef
...
llvm-svn: 93049
2010-01-09 09:31:32 +00:00
Kovarththanan Rajaratnam
2f14619d89
Switch DefineBuiltinMacro() over to using StringRef
...
llvm-svn: 93048
2010-01-09 09:27:11 +00:00
Zhongxing Xu
f1eeb78ffc
When binding an rvalue to a reference, create a temporary object. Use
...
CXXObjectRegion to represent it.
In Environment, lookup a literal expression before make up a value for it.
llvm-svn: 93047
2010-01-09 09:16:47 +00:00
Chris Lattner
002ba6b4d0
improve support for dragonfly, patch by Sascha Wildner!
...
llvm-svn: 93044
2010-01-09 05:41:14 +00:00
Mike Stump
b3ed45b67c
Fix indentation.
...
llvm-svn: 93023
2010-01-08 19:28:41 +00:00
Mike Stump
9620622431
Add in final overrider logic.
...
llvm-svn: 93022
2010-01-08 19:25:36 +00:00
Ted Kremenek
b92304b42f
Fix handling in GRExprEngine of 'default' branch in switch statements
...
when the default case is winnowed down to be infeasible. When all
cases were ruled out (and the analysis state for the default case
would be infeasible) we would still consider the default case
possible. This fixes PR 5969.
llvm-svn: 93017
2010-01-08 18:54:04 +00:00
John McCall
af07fbe210
Organize testcase into namespaces.
...
llvm-svn: 93015
2010-01-08 18:40:32 +00:00
Ted Kremenek
ea903067e1
For now, add back clang_getDeclSource().
...
llvm-svn: 93003
2010-01-08 17:11:32 +00:00
John McCall
12f97bc48a
Change the printing of OR_Deleted overload results to print all the candidates,
...
not just the viable ones. This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls; users
therefore will want to figure out why some other options were excluded.
Started sorting overload results. Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.
Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.
llvm-svn: 92990
2010-01-08 04:41:39 +00:00
Dan Gohman
d1e76b957b
Use -fno-math-errno by default, and remove the IsMathErrnoDefault
...
targethook, which is no longer being used. This fixes PR5971.
llvm-svn: 92987
2010-01-08 02:20:44 +00:00
Fariborz Jahanian
39d70940e4
clang ObjC rewriter: generated code used in "for (x in y)" loop uses
...
incorrect cast, causing compile error (fixes radar 7342867).
llvm-svn: 92986
2010-01-08 01:29:44 +00:00
John McCall
d322416233
Reorganize PrintOverloadCandidates. No functionality change.
...
llvm-svn: 92979
2010-01-08 00:58:21 +00:00
Eli Friedman
5866fe306d
Fix for PR5967: Make const-marking for LLVM globals correct for cases requiring
...
run-time initialization, and emit run-time initializers aggresively to avoid
ordering issues with deferred globals.
llvm-svn: 92976
2010-01-08 00:50:11 +00:00
Douglas Gregor
fa1e36d0de
Improve the fix-its for -Wparentheses to ensure that the fix-it
...
suggestions follow recovery. Additionally, add a note to these
diagnostics which suggests a fix-it for changing the behavior to what
the user probably meant. Examples:
t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first
[-Wparentheses]
if (i & j == k) {
^~~~~~~~
( )
t.cpp:2:9: note: place parentheses around the & expression to evaluate it first
if (i & j == k) {
^
( )
t.cpp:14:9: warning: using the result of an assignment as a condition
without
parentheses [-Wparentheses]
if (i = f()) {
~~^~~~~
( )
t.cpp:14:9: note: use '==' to turn this assignment into an equality
comparison
if (i = f()) {
^
==
llvm-svn: 92975
2010-01-08 00:20:23 +00:00
David Chisnall
df34917a38
Export a public symbol for classes with the GNU runtime.
...
llvm-svn: 92973
2010-01-08 00:14:31 +00:00
Ted Kremenek
32b79317a2
More crashtracer enhancements to CIndex. When "popping" a crashtracer string
...
restore to the one most recently created.
llvm-svn: 92959
2010-01-07 23:13:53 +00:00
Douglas Gregor
b15af899fb
Add an "implicit" bit to CXXThisExpr, so that we can track
...
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.
llvm-svn: 92958
2010-01-07 23:12:05 +00:00
Fariborz Jahanian
bc6811c32e
Fixes a bug where we were rewriting two definitions of
...
_objc_method (part of radar 7490408).
llvm-svn: 92957
2010-01-07 22:51:18 +00:00
Mike Stump
a52cf2ca3f
Add checker for type infos.
...
llvm-svn: 92956
2010-01-07 22:50:03 +00:00
Ted Kremenek
7a5ede2ff0
Tidy up crashtracer logic in CIndex.
...
llvm-svn: 92955
2010-01-07 22:49:05 +00:00
Mike Stump
0015eb93c6
Add checked for VTTs.
...
llvm-svn: 92954
2010-01-07 22:28:10 +00:00
Mike Stump
24e9b0048c
Detailed vtable checker.
...
llvm-svn: 92953
2010-01-07 22:21:26 +00:00
Fariborz Jahanian
1444230c40
Fixes a bug in my last patch (related to radar 7490331).
...
llvm-svn: 92952
2010-01-07 22:15:31 +00:00
Mike Stump
441793352d
1/2 off all structs should not have any virtual functions.
...
Replace magic numbers with uuids.
llvm-svn: 92941
2010-01-07 20:55:28 +00:00
Mike Stump
2a83635337
Add a descriptive tag to each line to make the exact differences
...
easier to understand.
llvm-svn: 92932
2010-01-07 19:39:43 +00:00
John McCall
64fe233704
When parsing an identifier as an expression in C++, only try to annotate it
...
as a type or scope token if the next token requires it.
This eliminates a lot of redundant lookups in C++, but there's room for
improvement; a better solution would do a single lookup whose kind and
results would be passed through the parser.
llvm-svn: 92930
2010-01-07 19:29:58 +00:00
Mike Stump
bd0c5da5fc
Don't use two argument mixing function.
...
llvm-svn: 92929
2010-01-07 19:24:27 +00:00
Mike Stump
a771b0ad52
Also generate the .s files.
...
llvm-svn: 92928
2010-01-07 19:19:39 +00:00
Mike Stump
53b926c56f
Add a testcase generator for vtable/rtti testing. WIP.
...
llvm-svn: 92927
2010-01-07 18:58:28 +00:00
Fariborz Jahanian
9ab6349f2a
Avoid error when convering a pointer to integer in
...
rewriting.
llvm-svn: 92925
2010-01-07 18:31:42 +00:00
Fariborz Jahanian
0f3aecf272
Fix rewriting of ivars. Fixes radar 7490331.
...
llvm-svn: 92924
2010-01-07 18:18:32 +00:00
Kovarththanan Rajaratnam
49c8da95a3
Convert from char pointer to char array
...
llvm-svn: 92923
2010-01-07 18:11:14 +00:00
Ted Kremenek
db2ef3732f
Fix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().
...
llvm-svn: 92922
2010-01-07 18:00:35 +00:00
Kovarththanan Rajaratnam
b53c7d4d9d
Tigthen scope of local char array
...
llvm-svn: 92917
2010-01-07 16:01:54 +00:00
Nuno Lopes
950d5b2cd3
fix PR5869: mangle static symbols like gcc does to make it easier to diff symbol tables
...
llvm-svn: 92911
2010-01-07 09:36:51 +00:00
Douglas Gregor
3a08dcc156
Test linkage of typeinfo and typeinfo names for class templates
...
llvm-svn: 92897
2010-01-07 04:09:30 +00:00
John McCall
0237485287
Improve the lead diagnostic for C++ object subscript expressions with
...
no viable overloads. Use a different message when the class provides
no operator[] overloads at all; use it for operator(), too.
Partially addresses PR 5900.
llvm-svn: 92894
2010-01-07 02:04:15 +00:00
Ted Kremenek
c7c6431860
Change ObjCContainerDecl to contain the entire range for the '@end'
...
piece of the declaration. The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.
This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).
llvm-svn: 92891
2010-01-07 01:20:12 +00:00
Ted Kremenek
b58514e613
Add FileCheck prefix to another location in the output of c-index-test.
...
llvm-svn: 92890
2010-01-07 01:17:12 +00:00
Douglas Gregor
9134e737fc
Add a test case for code-completion in the presence of tabs
...
llvm-svn: 92882
2010-01-07 00:40:35 +00:00
Chris Lattner
4debb32fdd
_mm_xor_ps does a xor not a nxor. The other 'xor' builtins look fine,
...
but this one is wrong. Thanks to Tanya for noticing this.
llvm-svn: 92881
2010-01-07 00:36:41 +00:00
Fariborz Jahanian
6722fc0c09
Make this test be ingored for linux.
...
llvm-svn: 92880
2010-01-07 00:31:48 +00:00
Douglas Gregor
712dcfe921
Fix the search for visible declarations within a Scope to ensure that
...
we look into a Scope that corresponds to a compound statement whose
scope was combined with the scope of the function that owns it. This
improves typo correction in many common cases.
llvm-svn: 92879
2010-01-07 00:31:29 +00:00
Douglas Gregor
43a0857631
When we typo-correct a base class initializer, point to the base class
...
specifier that we corrected to.
llvm-svn: 92878
2010-01-07 00:26:25 +00:00
Douglas Gregor
6da83624e4
Whenever we emit a typo-correction diagnostic, also emit a note
...
pointing to the declaration that we found that has that name (if it is
unique).
llvm-svn: 92877
2010-01-07 00:17:44 +00:00
Fariborz Jahanian
bdf198bc59
Fixes the test.
...
llvm-svn: 92875
2010-01-06 23:54:34 +00:00
Douglas Gregor
10f1e4dda8
When suggesting a typo correction for an @implementation without a
...
corresponding @interface, provide a note showing which interface we're
referring to. This note has the fix-it hint on it.
Also, don't automatically apply fix-it hints for notes. They're meant
to express fix-its that would change semantics.
llvm-svn: 92870
2010-01-06 23:44:25 +00:00
Ted Kremenek
2a43fd58ee
Change clang_getDeclExtent() to have the endpoint point to the last character in the last token.
...
llvm-svn: 92869
2010-01-06 23:43:31 +00:00
Fariborz Jahanian
017a6067e5
Test case for rewriting of __weak byref objects.
...
llvm-svn: 92868
2010-01-06 23:31:34 +00:00
Douglas Gregor
03e8bdc07e
Move the allocation of designators in DesignatedInitExpr to the
...
ASTContext. Fixes <rdar://problem/7495428>.
llvm-svn: 92867
2010-01-06 23:17:19 +00:00
John McCall
7443052652
Don't assert when dealing with unsigned casts of lvalues. Fixes PR5961.
...
llvm-svn: 92866
2010-01-06 22:57:21 +00:00
Douglas Gregor
b3d8deecbf
Add test from PR5913, which has already been fixed
...
llvm-svn: 92863
2010-01-06 22:09:05 +00:00
John McCall
2ce81adbb3
Derive tighter ranges for & and >> in the conversion-checking code.
...
llvm-svn: 92862
2010-01-06 22:07:33 +00:00
Douglas Gregor
dfdda291e0
Add testcase for PR5817, although the bug was already fixed
...
llvm-svn: 92858
2010-01-06 22:06:13 +00:00
Douglas Gregor
2a34df3264
Fix linkage for RTTI names by re-using the logic for computing the
...
linkage of vtables. Before this, we were emitting RTTI names for
template instantiations with strong external linkage rather than with
weak ODR linkage.
llvm-svn: 92857
2010-01-06 22:00:56 +00:00
Fariborz Jahanian
8e356bfe28
Fix a bug when property is redeclared in multiple
...
continuation classes and its original declaration
is imported from a protocol. This fixes radar 7509234.
llvm-svn: 92856
2010-01-06 21:38:30 +00:00
Douglas Gregor
ccecc1bb43
Fix marking of virtual members for nested classes whose first non-pure virtual function has a body inlined in the class
...
llvm-svn: 92855
2010-01-06 20:27:16 +00:00
David Chisnall
9a2073c035
Fix for PR5691
...
llvm-svn: 92846
2010-01-06 18:02:59 +00:00
Douglas Gregor
859f0ae041
Make sure that the key-function computation produces the correct
...
result for a nested class whose first non-pure virtual member function
has an inline body. Previously, we were checking for the key function
before we had seen the (delayed) inline body.
llvm-svn: 92839
2010-01-06 17:00:51 +00:00
John McCall
fd0b2f8fe4
Improve the diagnostics used to report implicitly-generated class members
...
as parts of overload sets. Also, refer to constructors as 'constructors'
rather than functions.
Adjust a lot of tests.
llvm-svn: 92832
2010-01-06 09:43:14 +00:00
Daniel Dunbar
a671c2a9fe
Fix (invalid) may-be-uninitialized warning.
...
llvm-svn: 92828
2010-01-06 07:13:04 +00:00
Daniel Dunbar
143a5b9f3c
Add missing CINDEX_LINKAGE.
...
llvm-svn: 92827
2010-01-06 06:51:48 +00:00
Daniel Dunbar
4ff42d6500
Add _clang_getDeclExtent to export list.
...
llvm-svn: 92825
2010-01-06 05:41:00 +00:00
John McCall
70aa5391dd
Significantly rework the calculation of effective integer-expression ranges
...
for -Wsign-compare and -Wconversion, and use that coordinated logic to drive
both diagnostics. The new logic works more transparently with implicit
conversions, conditional operators, etc., as well as bringing -Wconversion's
ability to deal with pseudo-closed operations (e.g. arithmetic on shorts) to
-Wsign-compare.
Fixes PRs 5887, 5937, 5938, and 5939.
llvm-svn: 92823
2010-01-06 05:24:50 +00:00
Douglas Gregor
d01472beee
Revert my available_externally vtables experiment. It's breaking the LLVM-with-Clang build with linker errors that I have yet to investigate.
...
llvm-svn: 92822
2010-01-06 04:50:56 +00:00
Douglas Gregor
0a0f04dcb9
Make our marking of virtual members functions in a class be
...
deterministic and work properly with templates. Once a class that
needs a vtable has been defined, we now do one if two things:
- If the class has no key function, we place the class on a list of
classes whose virtual functions will need to be "marked" at the
end of the translation unit. The delay until the end of the
translation unit is needed because we might see template
specializations of these virtual functions.
- If the class has a key function, we do nothing; when the key
function is defined, the class will be placed on the
aforementioned list.
At the end of the translation unit, we "mark" all of the virtual
functions of the classes on the list as used, possibly causing
template instantiation and other classes to be added to the
list. This gets LLVM's lib/Support/CommandLine.cpp compiling again.
llvm-svn: 92821
2010-01-06 04:44:19 +00:00
Ted Kremenek
991eb3f6c0
Add enhanced crash reporter breadcrumbs for clang_createTranslationUnitFromSourceFile().
...
llvm-svn: 92820
2010-01-06 03:42:32 +00:00
Mike Stump
81478719a7
Reorder to avoid invalidating idx which is an accessor into VCall.
...
llvm-svn: 92819
2010-01-06 03:09:19 +00:00
Mike Stump
13c6670273
Fix spelling.
...
llvm-svn: 92816
2010-01-06 02:05:39 +00:00
Ted Kremenek
e51136ee05
Per offline discussion with Doug, don't perform typo correction when we have encountered a fatal error. On some files that are woefully wrong (missing headers) this can cause a 3x slowdown in some cases when parsing the file. It makes sense not to perform typo correction in this case because after a fatal error diagnostics will either be suppressed or not really make any sense.
...
llvm-svn: 92809
2010-01-06 00:23:04 +00:00
Fariborz Jahanian
1a5f292fbf
Do not diagnose method disguised as property setter
...
for a 'readonly' property. Fixes radar 7427072.
llvm-svn: 92808
2010-01-06 00:18:12 +00:00
John McCall
1be1c63634
Add Expr::EvaluateAsBooleanCondition(), which does unprincipled folding to
...
try to evaluate an expression as a constant boolean condition. This has
the same intended semantics as used in folding conditional operators.
llvm-svn: 92805
2010-01-05 23:42:56 +00:00
Ted Kremenek
e50486bbca
Remove unused variables.
...
llvm-svn: 92804
2010-01-05 23:22:20 +00:00
Ted Kremenek
bde648030b
Remove deprecated function 'clang_getDeclSource()'. Use 'clang_getDeclFile()' instead.
...
llvm-svn: 92803
2010-01-05 23:21:30 +00:00
Ted Kremenek
a44d99c934
Add C API hook 'clang_getDeclExtent()', which returns the source extent of a declaration. This implements <rdar://problem/7280072>.
...
llvm-svn: 92802
2010-01-05 23:18:49 +00:00
Fariborz Jahanian
b8646edecd
Fixed a bug where initializer is a macro in rewrite.
...
llvm-svn: 92801
2010-01-05 23:06:29 +00:00
Ted Kremenek
9cd9f6d861
Split (mostly nonexistent) USR code out from the main CIndex logic.
...
llvm-svn: 92789
2010-01-05 22:06:45 +00:00
Douglas Gregor
26751ffc53
Silence bogus GCC warning
...
llvm-svn: 92787
2010-01-05 21:55:26 +00:00
Daniel Dunbar
d79f40ac7a
Fix -plugin command line argument syntax for clang -cc1 change.
...
llvm-svn: 92780
2010-01-05 21:42:23 +00:00
Douglas Gregor
1a68ab6c83
Make use of available_externally linkage for vtables when the
...
non-inline key function of a class template instantiation, when no key
function is present, the class template instantiation itself was
instantiated with an explicit instantiation declaration (aka extern
template). I'm fairly certain that the C++0x specification gives us
this lattitude, although GCC doesn't take advantage of it.
llvm-svn: 92779
2010-01-05 21:40:05 +00:00
Ted Kremenek
902292d7ac
Add back #include of 'cstdio' to hopefully unbreak the build on Linux.
...
llvm-svn: 92765
2010-01-05 20:55:39 +00:00
Ted Kremenek
0ec2cca8f2
Split code in CIndex.cpp into multiple source files, and remove some unnecessary #includes.
...
llvm-svn: 92756
2010-01-05 19:32:54 +00:00
Fariborz Jahanian
7fac65572f
API support for __block variables which are also __weak.
...
llvm-svn: 92755
2010-01-05 19:21:35 +00:00
Douglas Gregor
a318efd1f2
Improve key-function computation for templates. In particular:
...
- All classes can have a key function; templates don't change that.
non-template classes when computing the key function.
- We always mark all of the virtual member functions of class
template instantiations.
- The vtable for an instantiation of a class template has weak
linkage.
We could probably use available_externally linkage for vtables of
classes instantiated by explicit instantiation declarations (extern
templates), but GCC doesn't do this and I'm not 100% that the ABI
permits it.
llvm-svn: 92753
2010-01-05 19:06:31 +00:00
Mike Stump
79ed590c85
Add code to skip the emission of available externally functions at -O0. WIP.
...
llvm-svn: 92749
2010-01-05 18:48:04 +00:00
Fariborz Jahanian
f794543472
Minor clean up.
...
llvm-svn: 92746
2010-01-05 18:15:57 +00:00
Steve Naroff
7bf01ea165
Remove bogus "C" from preamble block decls.
...
llvm-svn: 92744
2010-01-05 18:09:31 +00:00
Fariborz Jahanian
e389158dbf
More rewriting of __block APIs. wip.
...
llvm-svn: 92742
2010-01-05 18:04:40 +00:00
Steve Naroff
3d38a68b06
Fix <rdar://problem/7490212> clang rewriter: return of the mixed line endings, which is
...
related to <rdar://problem/6596843> clang ObjC rewriter: Line endings still mixed in rewrite output
This fix was dropped when I integrated the 'objective-rewrite' branch.
llvm-svn: 92737
2010-01-05 17:33:23 +00:00
Zhongxing Xu
f22afe32f9
Move test case to a more appropriate file.
...
llvm-svn: 92725
2010-01-05 11:49:21 +00:00
Zhongxing Xu
e6a238b1df
Add test case.
...
llvm-svn: 92724
2010-01-05 11:47:58 +00:00
Zhongxing Xu
662ba69a15
Revert r92318. Instead fix the analyzer: do not call
...
ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType.
llvm-svn: 92723
2010-01-05 09:27:03 +00:00
Zhongxing Xu
cd321a3544
if an arraytype is canonical, then its element is guaranteed to be canonical.
...
llvm-svn: 92715
2010-01-05 08:15:06 +00:00
Nate Begeman
0e1a625fe4
Allow clang to pass -x cl through to compiler driver.
...
llvm-svn: 92686
2010-01-05 06:00:15 +00:00
Anders Carlsson
a0b025e40f
When emitting member function pointers, use the canonical decl if the member function is virtual. Fixes PR5940.
...
llvm-svn: 92680
2010-01-05 05:04:05 +00:00
Mike Stump
d4c4fc4440
Add a radar reference.
...
llvm-svn: 92678
2010-01-05 03:16:33 +00:00
Mike Stump
8971a86538
Disallow captured arrays in blocks as well. Radar 7438948.
...
llvm-svn: 92677
2010-01-05 03:10:36 +00:00
Mike Stump
7dafa0d048
Disallow capturing vlas inside blocks.
...
llvm-svn: 92676
2010-01-05 02:56:35 +00:00
Ted Kremenek
acd71a4562
Make static analysis support for C++ 'this' expression context-sensitive. Essentially treat 'this' as a implicit parameter to the method call, and associate a region with it.
...
llvm-svn: 92675
2010-01-05 02:18:06 +00:00
Chris Lattner
579b551058
fix a bug mike noticed.
...
llvm-svn: 92559
2010-01-05 01:23:25 +00:00
Fariborz Jahanian
8c07e75a61
More rewriting of __block objective-c pointer variables. wip.
...
llvm-svn: 92558
2010-01-05 01:16:51 +00:00
Ted Kremenek
68872c9e26
Remove stale comment. We already do format string checking for functions with the format attribute.
...
llvm-svn: 92553
2010-01-05 00:37:42 +00:00
Mike Stump
f86bf4abfa
Fix warnings.
...
llvm-svn: 92551
2010-01-05 00:29:29 +00:00
Ted Kremenek
de8e7447b6
Remove references to 'Checker' and 'GRTransferFuncs' from
...
GRStateManager. Having these references was an abstraction violation,
as they really should only be known about GRExprEngine.
This change required adding a new 'ProcessAssume' callback in
GRSubEngine. GRExprEngine implements this callback by calling
'EvalAssume' on all registered Checker objects as well as the
registered GRTransferFunc object.
llvm-svn: 92549
2010-01-05 00:15:18 +00:00
John McCall
263a48b781
Move the -Wconversion logic into SemaChecking.cpp. There's a fair amount of
...
overlap between this and -Wsign-compare, which is why I want them in the same
place.
llvm-svn: 92543
2010-01-04 23:31:57 +00:00
John McCall
ca01b22ed6
Move the -Wsign-compare logic into SemaChecking.cpp.
...
llvm-svn: 92541
2010-01-04 23:21:16 +00:00
Mike Stump
28d89bd652
Avoid warnings for functions that return a value using MS-style inline
...
assembly code. This avoids changing the bahvior when normal asm("")
statements are used.
The type of code affected would be:
void* t4(void) { __asm mov eax, fs:[0x10] }
I hope people like this version, if not, let me know.
llvm-svn: 92531
2010-01-04 23:01:10 +00:00
Mike Stump
90be58afce
Remember if the AsmStmt came from Microsoft-style inline assembly code.
...
llvm-svn: 92526
2010-01-04 22:37:17 +00:00
John McCall
b8e66c3b14
-Wsign-compare shouldn't warn when the signed operand is a conditional operator
...
whose operands are non-negative integer constant expressions. This comes up
in LLVM in a few places.
llvm-svn: 92525
2010-01-04 22:35:07 +00:00
Douglas Gregor
936dc5638c
Make sure to use ASTContext::getAs*ArrayType() when decomposing array
...
types. Fixes APFloat.cpp compilation failure.
llvm-svn: 92523
2010-01-04 22:11:45 +00:00
Daniel Dunbar
699e014588
Add missing newline (which breaks MSVC build???)
...
llvm-svn: 92522
2010-01-04 22:04:01 +00:00
Fariborz Jahanian
d6cba5065f
More rewriting of __block declared objective-c/block pointers.
...
This is wip.
llvm-svn: 92501
2010-01-04 19:50:07 +00:00
Douglas Gregor
51af7f628c
Turn on code-completion for macros within CIndex
...
llvm-svn: 92500
2010-01-04 19:45:17 +00:00
Douglas Gregor
9882a5aac6
Teach Preprocessor::macro_begin/macro_end to lazily load all macro
...
definitions from a precompiled header. This ensures that
code-completion with macro names behaves the same with or without
precompiled headers.
llvm-svn: 92497
2010-01-04 19:18:44 +00:00
Daniel Dunbar
d443c0a02a
Revert r92431, this code isn't dead and broke the ntfs build.
...
llvm-svn: 92493
2010-01-04 18:47:06 +00:00
Daniel Dunbar
5b9019515a
Fix -Asserts warning.
...
llvm-svn: 92491
2010-01-04 18:02:28 +00:00
Douglas Gregor
40f7a007e9
When declaring an Objective-C implementation without a corresponding
...
interface, suggest correction of typos. For example, given:
@interface NSString
@end
@implementation NSstring
@end
we'll warn with:
t.m:4:19: warning: cannot find interface declaration for 'NSstring';
did you mean 'NSString'?
@implementation NSstring
^
However, since this is just a warning, we don't provide a fix-it
hint. Good idea, Ted!
llvm-svn: 92488
2010-01-04 17:27:12 +00:00
Benjamin Kramer
0128f668a9
__builtin_object_size(ptr, type) returns -1 for type = {0,1} if there are any side-effects.
...
llvm-svn: 92453
2010-01-03 18:18:37 +00:00
Douglas Gregor
35b0bac8c5
Implement typo correction for a variety of Objective-C-specific
...
constructs:
- Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
- Property name lookup ("foo.prop")
- Superclasses
- Various places where a class name is required
- Protocol names (e.g., id<proto>)
This seems to cover many of the common places where typos could occur.
llvm-svn: 92449
2010-01-03 18:01:57 +00:00
Eli Friedman
c6f59b1c49
Better coverage for -dump-record-layouts and -print-decl-contexts.
...
llvm-svn: 92441
2010-01-03 02:01:11 +00:00
Eli Friedman
50f6aa11cf
Improve coverage for test.
...
llvm-svn: 92440
2010-01-03 01:20:41 +00:00
Eli Friedman
6257e08a3d
Get rid of more dead code.
...
llvm-svn: 92439
2010-01-03 01:11:47 +00:00
Eli Friedman
906be1b580
Add test for annotate attribute for coverage.
...
llvm-svn: 92435
2010-01-03 00:51:58 +00:00
Eli Friedman
090adddf15
Fix minor oversight for increment/decrement of complex int. Add tests for
...
coverage.
llvm-svn: 92433
2010-01-03 00:20:48 +00:00
Eli Friedman
c52a9367b3
Get rid of some unnecessary code.
...
llvm-svn: 92432
2010-01-02 23:43:59 +00:00
Eli Friedman
14e4005851
Delete impossible case.
...
llvm-svn: 92431
2010-01-02 23:28:56 +00:00
Eli Friedman
bb333722c1
Add a couple more tests for coverage.
...
llvm-svn: 92430
2010-01-02 23:21:40 +00:00
Eli Friedman
81390dfcfd
Get rid of more unnecessary code.
...
llvm-svn: 92429
2010-01-02 22:56:07 +00:00
Eli Friedman
5906ea4f76
Get rid of some unnecessary code.
...
llvm-svn: 92428
2010-01-02 22:43:56 +00:00
Eli Friedman
d423dcc9bd
Eliminate dead code.
...
llvm-svn: 92424
2010-01-02 21:44:36 +00:00
Anders Carlsson
c92a37e917
Speculative MSVC fix.
...
llvm-svn: 92421
2010-01-02 18:46:23 +00:00
Anders Carlsson
93a1884fde
Move address points to CGVtableInfo, no functionality change.
...
llvm-svn: 92420
2010-01-02 18:02:32 +00:00
Anders Carlsson
e36a6b3e44
Correctly pass VTT parameters to constructors and destructors. The VTTs aren't yet used in the ctors/dtors, but that will follow.
...
llvm-svn: 92409
2010-01-02 01:01:18 +00:00
Anders Carlsson
27da15ba8e
Move a few more functions away from CGCXX and to CGClass and CGExprCXX.
...
llvm-svn: 92399
2010-01-01 20:29:01 +00:00
Douglas Gregor
4f2486353a
Make sure that the search for visible declarations looks into the semantic parents of out-of-line function contexts
...
llvm-svn: 92397
2010-01-01 17:44:25 +00:00
Douglas Gregor
3f8f44757f
Fix typo test RUN lines
...
llvm-svn: 92396
2010-01-01 17:23:17 +00:00
Mike Stump
9d44fdb397
Fix last patch, catch of reference to non-pointer.
...
llvm-svn: 92386
2010-01-01 03:20:32 +00:00
Mike Stump
5ee041873b
Fix catching a reference to a pointer.
...
llvm-svn: 92385
2010-01-01 02:51:52 +00:00
Douglas Gregor
2536398a5d
When typo correction for an id-expression finds a type (or Objective-C
...
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:
test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
mean 'NSString'?
NSstring *str = @"A string";
...
^
1 diagnostic generated.
llvm-svn: 92379
2010-01-01 00:15:04 +00:00
Douglas Gregor
4e0299b657
Typo correction for C99 designated field initializers, e.g.,
...
test/FixIt/typo.c:19:4: error: field designator 'bunds' does not refer to any
field in type 'struct Window'; did you mean 'bounds'?
.bunds.
^~~~~
bounds
llvm-svn: 92376
2010-01-01 00:03:05 +00:00
Anders Carlsson
2d21394190
If the key function of a record is inline, then the RTTI data should have weak_odr linkage.
...
llvm-svn: 92371
2009-12-31 19:36:25 +00:00
Anders Carlsson
0c9dd8476f
It's OK for a return type to be incomplete if it's being defined.
...
llvm-svn: 92367
2009-12-31 18:54:35 +00:00
Anders Carlsson
e60365b7b5
Make sure that an overriding return type is complete before checking if it's covariant. Fixes PR5920.
...
llvm-svn: 92365
2009-12-31 18:34:24 +00:00
Anders Carlsson
bc7def9850
Remove rtti.cpp, it's very fragile and has been marked XFAIL for a while now. Between rtti-layout.cpp and rtti-linkage.cpp, RTTI testing should be covered.
...
llvm-svn: 92361
2009-12-31 17:44:32 +00:00
Anders Carlsson
7ae81bb711
More RTTI builder cleanup.
...
llvm-svn: 92360
2009-12-31 17:43:53 +00:00
Benjamin Kramer
d77adb5b1c
Avoid an unnecessary copy of Predefines. getMemBufferCopy does the null termination for us.
...
llvm-svn: 92358
2009-12-31 15:33:09 +00:00
Benjamin Kramer
14488464be
Convert to StringRef, avoid a memcpy in the common case.
...
llvm-svn: 92357
2009-12-31 13:32:38 +00:00
Douglas Gregor
15e77a2fd3
Typo correction for C++ base and member initializers, e.g.,
...
test/FixIt/typo.cpp:41:15: error: initializer 'base' does not name a non-static
data member or base class; did you mean the base class 'Base'?
Derived() : base(),
^~~~
Base
test/FixIt/typo.cpp:42:15: error: initializer 'ember' does not name a non-static
data member or base class; did you mean the member 'member'?
ember() { }
^~~~~
member
llvm-svn: 92355
2009-12-31 09:10:24 +00:00
Douglas Gregor
103dae42d7
Add another typo test for nested-name-specifiers
...
llvm-svn: 92351
2009-12-31 08:27:32 +00:00
Douglas Gregor
532e68f1f3
Typo correction for identifiers within nested name specifiers, e.g.,
...
typo.cpp:18:1: error: use of undeclared identifier 'other_std'; did
you mean 'otherstd'?
other_std::strng str1;
^~~~~~~~~
otherstd
llvm-svn: 92350
2009-12-31 08:26:35 +00:00
Douglas Gregor
ff18cc1141
Typo correction for template names, e.g.,
...
typo.cpp:27:8: error: no template named 'basic_sting' in namespace 'std';
did you mean 'basic_string'?
std::basic_sting<char> b2;
~~~~~^~~~~~~~~~~
basic_string
llvm-svn: 92348
2009-12-31 08:11:17 +00:00
Douglas Gregor
af2bd473d2
Typo correction for member access into classes/structs/unions, e.g.,
...
s.fnd("hello")
llvm-svn: 92345
2009-12-31 07:42:17 +00:00
Zhongxing Xu
b0e15df36b
Let constraint manager inform checkers that some assumption logic has happend.
...
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.
Based on Lei Zhang's patch and discussion.
llvm-svn: 92342
2009-12-31 06:13:07 +00:00
Douglas Gregor
598b08f818
Implement typo correction for id-expressions, e.g.,
...
typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
you mean 'radius'?
return radious * pi;
^~~~~~~
radius
This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.
llvm-svn: 92341
2009-12-31 05:20:13 +00:00
Chris Lattner
b0283c06b2
improve diagnostics for case when a field type is unknown by
...
not emitting a follow-on error about 'int', which the user
never wrote. PR5924.
llvm-svn: 92339
2009-12-31 03:10:55 +00:00
Anders Carlsson
a442499072
Fix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.
...
llvm-svn: 92319
2009-12-30 23:47:56 +00:00
Zhongxing Xu
da3ddfce43
The element type should also be canonicalized. Add a case for VariableArrayType.
...
llvm-svn: 92318
2009-12-30 22:59:54 +00:00
Chris Lattner
d866c5a678
testcase for previous patch!
...
llvm-svn: 92317
2009-12-30 22:10:22 +00:00
Chris Lattner
8977c433d3
when making a decl for __builtin_fabsf() make sure to
...
attach the appropriate attributes to it. I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.
llvm-svn: 92316
2009-12-30 22:06:22 +00:00
Zhongxing Xu
1563a76fd3
Fix a comment.
...
llvm-svn: 92314
2009-12-30 21:24:23 +00:00
Chris Lattner
c3847ba3fa
fix PR5917, L'x' was getting the wrong type in c++ mode. Per
...
C++2.13.2p2: "A wide-character literal has type wchar_t"
llvm-svn: 92313
2009-12-30 21:19:39 +00:00
Fariborz Jahanian
92368a15f9
When rewriting a __block declaration, use a suitable API to get location of
...
the declaration in the presence of an initializer macro.
llvm-svn: 92312
2009-12-30 20:38:08 +00:00
Chris Lattner
1ca1d7adc2
remove extraneous #include
...
llvm-svn: 92310
2009-12-30 19:54:10 +00:00
Douglas Gregor
2d435306e5
Typo correction for type names when they appear in declarations, e.g., given
...
tring str2;
we produce the following diagnostic + fix-it:
typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
tring str2;
^~~~~
string
To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.
The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.
llvm-svn: 92308
2009-12-30 17:04:44 +00:00
Douglas Gregor
ad183ac3c7
Fix typo in comment
...
llvm-svn: 92307
2009-12-30 16:01:52 +00:00
Zhongxing Xu
4629e92e78
Remove an duplicated #include.
...
llvm-svn: 92306
2009-12-30 06:48:20 +00:00
Zhongxing Xu
7b8b4d70ef
Simplify code by using an equivalent template class.
...
llvm-svn: 92305
2009-12-30 06:38:20 +00:00
Chandler Carruth
c712ce1b60
More fixes to the handling of CVR-comparisons on array types. Adds a method to
...
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.
Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.
llvm-svn: 92289
2009-12-30 04:10:01 +00:00
Anders Carlsson
1e4cd33f13
Add base class checks.
...
llvm-svn: 92286
2009-12-30 01:29:05 +00:00
Anders Carlsson
a4bbe58c3b
Add more vtable tests.
...
llvm-svn: 92285
2009-12-30 01:25:42 +00:00
Anders Carlsson
ac2f681777
More RTTI cleanup, test that RTTI classes have the correct vtables.
...
llvm-svn: 92284
2009-12-30 01:00:12 +00:00
John McCall
91f1a02648
Typedefs can be redeclared. That seems like something we should record in
...
the AST lest we run into some crazy canonicalization bug like PR5874.
llvm-svn: 92283
2009-12-30 00:31:22 +00:00
Eli Friedman
be55976627
Test for PR5908.
...
llvm-svn: 92282
2009-12-30 00:20:14 +00:00
Eli Friedman
84341cd668
Make sure to explicitly pass type/value dependence to Expr constructor. This
...
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.
llvm-svn: 92281
2009-12-30 00:13:48 +00:00
Anders Carlsson
79c184e975
Match gcc and treat vector types as fundamental types.
...
llvm-svn: 92278
2009-12-29 22:30:11 +00:00
Anders Carlsson
ef88695860
Handle enum types as well.
...
llvm-svn: 92276
2009-12-29 22:13:01 +00:00
Anders Carlsson
0e4151c685
Test linkage of RTTI descriptors of array types.
...
llvm-svn: 92274
2009-12-29 21:58:32 +00:00
Anders Carlsson
26cf4ab8e2
Fix function type RTTI linkage and add tests.
...
llvm-svn: 92266
2009-12-29 20:20:19 +00:00
Chandler Carruth
585fb1e97e
Fix support for const_cast<>s of array types which actual change the
...
CV-qualifiers. Remove an error expectation from the 'good' set of const-cast
test cases. With this patch, the final non-template test case from PR5542
passes. (It's the same as the one already in const-cast.cpp.)
llvm-svn: 92257
2009-12-29 08:05:19 +00:00
Chris Lattner
3f8e5dd898
strength reduce this call away.
...
llvm-svn: 92253
2009-12-29 07:49:13 +00:00
Chris Lattner
426b709a81
fix whitespace in test to match llvm asmprinter change.
...
llvm-svn: 92251
2009-12-29 07:42:23 +00:00
Chandler Carruth
607f38e05f
Correctly refer to element CVR qualifications when determining if a type is
...
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.
This fixes several aspects of PR5542, but not all of them.
llvm-svn: 92248
2009-12-29 07:16:59 +00:00
Anders Carlsson
88ea2455f8
Get rid of FixedWidthIntType, as suggested by Chris and Eli.
...
llvm-svn: 92246
2009-12-29 07:07:36 +00:00
Chandler Carruth
c25c6ee3db
Handle using declarations in overloaded and template functions during ADL and
...
address resolution. This fixes PR5751.
Also, while we're here, remove logic from ADL which mistakenly included the
definition namespaces of overloaded and/or templated functions whose name or
address is used as an argument.
llvm-svn: 92245
2009-12-29 06:17:27 +00:00
Chris Lattner
9f021fd05d
adjust for llvm api changes.
...
llvm-svn: 92236
2009-12-28 23:41:39 +00:00
Chris Lattner
5e124bf913
this form of SetDebugLocation is about to go away, add some #includes that
...
are about to not come in implicitly.
llvm-svn: 92228
2009-12-28 21:44:41 +00:00
Zhongxing Xu
6de8201a63
Adjust indentation.
...
llvm-svn: 92205
2009-12-28 06:52:51 +00:00
Zhongxing Xu
947420d6ad
Fix 80-col violation.
...
llvm-svn: 92204
2009-12-28 06:49:22 +00:00
Chris Lattner
9e0005f445
use best-fit instead of first-fit when reusing a MacroArgs object,
...
this speeds up Eonly on the testcase in PR5888 from 30.5s to 0.85s
llvm-svn: 92203
2009-12-28 06:36:46 +00:00
Chris Lattner
394f589e73
The PreExpArgTokens array is indexed with an argument #,
...
not a token number. Fix the reserve logic to get the right
amount of space.
llvm-svn: 92202
2009-12-28 06:17:16 +00:00
Sam Weinig
b999f68ed9
Fix for PR5871. Make __PRETTY_FUNCTION__ work for member functions defined in a class local to a function.
...
llvm-svn: 92200
2009-12-28 03:19:38 +00:00
Eli Friedman
affd5fdf37
Make sure to give an error for template argument lists followed by junk.
...
llvm-svn: 92177
2009-12-27 22:31:18 +00:00
Anton Korobeynikov
73d50b9141
Promote arguments of frameaddr / returnaddr builtins to i32 type, when needed.
...
This is needed for the platforms, where bitwidth of "int" is not 32 bits
(e.g. 16 on msp430).
llvm-svn: 92176
2009-12-27 14:27:22 +00:00
Eli Friedman
1e26278b3b
Add a sanity assertion so that we don't silently generate bad code; I'll file
...
a bug with a testcase hitting this assertion in a moment.
llvm-svn: 92175
2009-12-27 07:02:50 +00:00
Eli Friedman
e513c6af97
Fix runline.
...
llvm-svn: 92174
2009-12-27 05:59:41 +00:00
Eli Friedman
847a2bce04
Fix PointerExprEvaluator::VisitCastExpr so it doesn't misfold C++ casts which
...
it doesn't know how to fold, like derived-to-base casts.
llvm-svn: 92173
2009-12-27 05:43:15 +00:00
Eli Friedman
af76ad73ed
Fix obvious mistake.
...
llvm-svn: 92172
2009-12-27 03:44:17 +00:00
Sam Weinig
4e83bd2795
Fix for PR5872. Add static specifier and const/volatile qualifiers to member functions in __PRETTY_FUNCTION__ predefined expressions.
...
llvm-svn: 92171
2009-12-27 01:38:20 +00:00
Daniel Dunbar
54f330f342
Tests: Tweak LLVM-Code-Symbols test to ignore common and undefined symbols for
...
now, let's start small.
llvm-svn: 92170
2009-12-26 22:58:48 +00:00
Eli Friedman
e14b1997db
Don't look through casts when looking for the underlying decl for a function
...
call; the standard doesn't expect us to, and the program could be doing
something crazy. Fixes PR5882.
llvm-svn: 92166
2009-12-26 03:35:45 +00:00
Eli Friedman
11c7b15148
Attempted fix for PR5884; this code will be dead soon, but this fix should
...
help for the moment.
llvm-svn: 92165
2009-12-25 23:59:21 +00:00
Daniel Dunbar
b2138e5529
Driver: Use "g++" as generic gcc name when running in C++ mode, for platforms
...
that lack real tool definitions.
llvm-svn: 92164
2009-12-25 20:21:23 +00:00
Benjamin Kramer
c06181b2a7
Make sure operator new[] and operator delete[] match. This will hopefully silence 3 remaining MSVC warnings.
...
llvm-svn: 92163
2009-12-25 17:06:27 +00:00
Benjamin Kramer
d20ef75b91
Remove some dead variables clang-analyzer found.
...
llvm-svn: 92162
2009-12-25 15:43:36 +00:00
Benjamin Kramer
a713b5d9a8
Fix typo spotted by MSVC.
...
GRExprEngine.cpp(1348) : warning C4305: 'argument' : truncation from 'clang::ProgramPoint::Kind' to 'bool'
llvm-svn: 92154
2009-12-25 09:44:02 +00:00
Eli Friedman
b8841af8bd
Minor optimization; emit proper unsupported messages for a couple of cases.
...
llvm-svn: 92153
2009-12-25 06:17:05 +00:00
Eli Friedman
2e06e8bbcc
Some small improvements to dead code elimination; helps a bit on
...
LLVM-Code-Symbols test.
llvm-svn: 92152
2009-12-25 05:29:40 +00:00
Eli Friedman
fddc26cc64
Make copy constructor elimination work in more cases; the case in question
...
here affects clang-on-clang.
llvm-svn: 92151
2009-12-24 23:33:34 +00:00
Sam Weinig
07d211ea40
Fix for PR5844. Be explicit about anonymous struct/class/union/namespaces in __PRETTY_FUNCTION__ predefined expression.
...
llvm-svn: 92149
2009-12-24 23:15:03 +00:00
Anders Carlsson
fb404888af
Move a bunch of class related functions to CGClass.cpp, no functionality change.
...
llvm-svn: 92148
2009-12-24 22:46:43 +00:00
Daniel Dunbar
c19b219280
Sketch a simple new C++Tests suite for checking that llvm-gcc and clang generate
...
the same visible symbols, useful for finding ABI/Mangler/vtable/etc. issues.
llvm-svn: 92147
2009-12-24 21:27:38 +00:00
Anders Carlsson
bfb3671b25
Pass the return value slot to all call exprs.
...
llvm-svn: 92145
2009-12-24 21:13:40 +00:00
Douglas Gregor
33636e66c7
Egregious, disgusting workaround for PR5866. We need to rework how we
...
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.
llvm-svn: 92143
2009-12-24 20:56:24 +00:00
Anders Carlsson
1749083e2e
Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.
...
llvm-svn: 92142
2009-12-24 20:40:36 +00:00
Douglas Gregor
4b65441598
Add test case for PR5868, and improve location information slightly for implicit "this" expressions
...
llvm-svn: 92141
2009-12-24 20:23:34 +00:00
Anders Carlsson
b2d47e0eaa
Add a test for x86-64 struct returns under gc.
...
llvm-svn: 92140
2009-12-24 20:21:41 +00:00
Douglas Gregor
8e8eaa14f7
When rebuilding a MemberExpr that refers to an anonymous union, be
...
sure to perform derived-to-base conversions on the base
expression. Fixes PR5868. Proper testcase is coming soon.
llvm-svn: 92139
2009-12-24 20:02:50 +00:00
Anders Carlsson
61a401caec
Pass ReturnValueSlot to EmitCall. No functionality change yet.
...
llvm-svn: 92138
2009-12-24 19:25:24 +00:00
Daniel Dunbar
2db411f5a7
Fix -Asserts warning.
...
llvm-svn: 92137
2009-12-24 19:19:26 +00:00
Anders Carlsson
0435ed5875
Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.
...
llvm-svn: 92136
2009-12-24 19:08:58 +00:00
Douglas Gregor
363b151ff7
When transforming CXXExprWithTemporaries and CXXBindTemporaryExpr
...
expressions (e.g., for template instantiation), just transform the
subexpressions and return those, since the temporary-related nodes
will be implicitly regenerated. Fixes PR5867, but I said that
before...
llvm-svn: 92135
2009-12-24 18:51:59 +00:00
Douglas Gregor
5c13090bd4
Fix double-destruction assertion to account for temporaries in conditionals
...
llvm-svn: 92134
2009-12-24 18:16:21 +00:00
Douglas Gregor
4cd5d53ebf
Assert that we aren't trying to push the same C++ temporary onto the live temporary stack twice. A little insurance against PR5867 surprising us again
...
llvm-svn: 92132
2009-12-24 17:48:05 +00:00
Douglas Gregor
f82bead3fd
InitializationSequence handles binding to temporaries, so that
...
argument-passing doesn't have to. Fixes PR5867, where we were binding
a temporary twice in the AST and, therefore, calling its destructor
twice.
llvm-svn: 92131
2009-12-24 17:16:46 +00:00
John McCall
122c8313ff
Fix the clang-on-clang build: APFloat reports underflow whenever we get a
...
denormal, but we only want to diagnose if we underflowed to zero. This
allows people to write constants in the denormal range.
llvm-svn: 92129
2009-12-24 11:09:08 +00:00
John McCall
0e21fccfae
Tweak the text of several main() diagnostics and punch a hole specifically for
...
Darwin's sekrit fourth argument. This should probably be factored to
let targets make target-specific decisions about what main() should look like.
Fixes rdar://problem/7414990
or if different platforms have radically different ideas of what they want in
llvm-svn: 92128
2009-12-24 09:58:38 +00:00
John McCall
53b93a091e
Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641
...
llvm-svn: 92127
2009-12-24 09:08:04 +00:00
Mike Stump
d538a6d364
Remove some dead code.
...
llvm-svn: 92123
2009-12-24 07:29:41 +00:00
Mike Stump
4a779b93e4
Cleanup some dead code.
...
llvm-svn: 92122
2009-12-24 06:52:05 +00:00
Zhongxing Xu
51f1ca852f
As Ted suggested, record the callsite information with the StackFrameContext.
...
llvm-svn: 92121
2009-12-24 03:34:38 +00:00
Ted Kremenek
fd97ce6573
Add analyzer test case for 'ForStmt' with condition variable.
...
llvm-svn: 92120
2009-12-24 02:41:19 +00:00
Ted Kremenek
9c951ab4f1
Enhance dataflow analyses to recognize branch statements in the CFG used as hooks for the initialization of condition variables.
...
llvm-svn: 92119
2009-12-24 02:40:30 +00:00
Mike Stump
bb2f57dd39
Don't set hidden for a non-external symbol as that would make it extenal.
...
Refine codegen for visibility and hidden. WIP.
llvm-svn: 92118
2009-12-24 02:33:48 +00:00
David Chisnall
3a509cd8cc
Fix for bug 5691.
...
This fixes throwing exceptions inside @catch blocks nested inside outer @try blocks and also fixes jumping from an inner @finally to an outer @finally (via any relevant @catch blocks).
The code exhibiting this bug was based on code from CGObjCMac. I believe that this bug may still be present on the Mac runtimes, although the test case in the bug contains a few GNUisms and won't compile without some minor tweaks with Apple's libobjc.
llvm-svn: 92117
2009-12-24 02:26:34 +00:00
Zhongxing Xu
1704c4331b
Inter-procedural analysis: now we can return from the callee.
...
llvm-svn: 92116
2009-12-24 02:25:21 +00:00
Ted Kremenek
17113255a8
Fix bug I just introduced in ForStmt::child_end() where we could iterate off into garbage values.
...
llvm-svn: 92115
2009-12-24 01:59:46 +00:00
Ted Kremenek
b135a13564
Teach GRExprEngine to handle the initialization of the condition variable of a ForStmt.
...
llvm-svn: 92114
2009-12-24 01:49:25 +00:00
Ted Kremenek
ec92f9492b
Add CFG support for the initializer of the condition variable of a ForStmt.
...
llvm-svn: 92113
2009-12-24 01:49:06 +00:00
Ted Kremenek
1c3ab07968
Coelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator returned by ForStmt to include the initializer of the condition variable.
...
llvm-svn: 92112
2009-12-24 01:48:39 +00:00
Ted Kremenek
1ce53c4320
CFG tweak: in a WhileStmt, the condition variable initializer is evaluated every time the condition is checked.
...
llvm-svn: 92111
2009-12-24 01:34:10 +00:00
Mike Stump
a8a2a33af9
Fix recent regression caught by g++.old-deja/g++.mike/eh19.C.
...
llvm-svn: 92109
2009-12-24 01:10:27 +00:00
Ted Kremenek
09bc3b7df6
Teach GRExprEngine to handle the initialization of the condition variable of a WhileStmt.
...
llvm-svn: 92106
2009-12-24 00:54:56 +00:00
Ted Kremenek
1f07b4c439
Add CFG support for the initializer of the condition variable of a WhileStmt.
...
llvm-svn: 92105
2009-12-24 00:54:37 +00:00
Ted Kremenek
b04c5cb0ba
Modify WhileStmt::child_begin()/child_end() to include the initializer for the condition variable.
...
llvm-svn: 92104
2009-12-24 00:54:19 +00:00
Ted Kremenek
284d764418
Add test case for PR 4358.
...
llvm-svn: 92103
2009-12-24 00:48:11 +00:00
Ted Kremenek
589493227b
Teach GRExprEngine to handle the initialization of the condition variable of a SwitchStmt.
...
llvm-svn: 92102
2009-12-24 00:40:03 +00:00
Ted Kremenek
8b5dc12e52
Add CFG support for the initializer of the condition variable of a SwitchStmt.
...
llvm-svn: 92101
2009-12-24 00:39:26 +00:00
Ted Kremenek
ee7553de62
Modify SwitchStmt::child_begin()/child_end() to include the initializer for the condition variable.
...
llvm-svn: 92100
2009-12-24 00:39:05 +00:00
Nuno Lopes
c095b5361a
support the warn_unused_result in C++ class methods
...
llvm-svn: 92095
2009-12-24 00:28:18 +00:00
Nuno Lopes
0e7860f21e
allow the noreturn attribute to be used in class methods
...
llvm-svn: 92090
2009-12-23 23:40:33 +00:00
Ted Kremenek
b27a6d24a6
Add StmtIterator support for iterating over both the condition
...
variable initializer and the other expressions in an IfStmt.
This change required adding a 'DoDestroy()' method for IfStmt that did
not include destroying the initializer (since that is owned by the
VarDecl).
llvm-svn: 92089
2009-12-23 23:38:34 +00:00
Ted Kremenek
bff9844327
Tidy up FindSubExprAssignments to not deference the child_iterator multiple times.
...
llvm-svn: 92087
2009-12-23 23:37:10 +00:00
Douglas Gregor
033f675f61
When we see a CXXDefaultArgExpr during template instantiation, rebuild
...
the default argument so that we're sure to mark any referenced
declarations. This gets us another little step closer to fixing
PR5810.
llvm-svn: 92078
2009-12-23 23:03:06 +00:00
Mike Stump
f3c23c0cd4
Fix regression found by g++.dg/eh/alias1.C.
...
llvm-svn: 92072
2009-12-23 22:48:20 +00:00
Ted Kremenek
1bc899f4d3
Increase StmtIterator size by one pointer (separating out the Stmt** from the union including Decl* and Decl**).
...
This change is setup for adding StmtIterator support for condition variables in IfStmt, WhileStmt, etc.
llvm-svn: 92070
2009-12-23 22:31:49 +00:00
Anders Carlsson
a88d197284
Mangle block pointer types. Fixes PR5858.
...
llvm-svn: 92069
2009-12-23 22:31:44 +00:00
Chris Lattner
9ac2b586c7
fix typo
...
llvm-svn: 92065
2009-12-23 22:06:12 +00:00
Douglas Gregor
247894b361
There is no such thing as typeinfo for a cv-qualified type. Assert
...
that this is true when mangling, then fix up the various places in
Sema and/or CodeGen that need to remove qualifiers. Addresses a
linking issue when building LLVM with Clang.
llvm-svn: 92064
2009-12-23 22:04:40 +00:00
Fariborz Jahanian
65e6bd6246
More cleanup/refactoring of the rewrite.
...
llvm-svn: 92062
2009-12-23 21:52:32 +00:00
Chris Lattner
f0a9ba37d4
simplify my previous patch.
...
llvm-svn: 92057
2009-12-23 21:33:41 +00:00
Chris Lattner
4e1a323b85
fix opencl extvector element extraction on rvalues. We previously
...
error_unsupported on test10 and crashed on test11.
llvm-svn: 92056
2009-12-23 21:31:11 +00:00
Chris Lattner
43c8be526d
comment tweak
...
llvm-svn: 92055
2009-12-23 21:29:53 +00:00
Fariborz Jahanian
4bf727d9e1
Some cleanup and refactoring of rewriter.
...
llvm-svn: 92049
2009-12-23 21:18:41 +00:00
Ted Kremenek
40ee0cc813
Tidy up ~ASTContext a bit by turning orphan compound statements into
...
for loops. Also do not manually free the Type objects when the
'FreeMemory' flag is set, as they will be deallocated when the
BumpPtrAllocator is destroyed.
llvm-svn: 92047
2009-12-23 21:13:52 +00:00
Douglas Gregor
721fb2b6e4
Diagnose the use of incomplete types in C++ typeid expressions
...
llvm-svn: 92045
2009-12-23 21:06:06 +00:00
Ted Kremenek
b8e6dc88bb
Rename test file.
...
llvm-svn: 92044
2009-12-23 20:59:39 +00:00
Ted Kremenek
778231cb18
Change test case to use 'clang -cc1' (without --disable-free) instead of c-index-test (whose memory management behavior may change in the future).
...
llvm-svn: 92043
2009-12-23 20:58:27 +00:00
Douglas Gregor
f45f6828c6
Remove cv-qualifiers from the argument to typeid
...
llvm-svn: 92041
2009-12-23 20:51:04 +00:00
Fariborz Jahanian
cbdcfe802a
This patch concludes rewriteing of __block variables to allow
...
a small test case using Block_copy(...) API to pass.
llvm-svn: 92038
2009-12-23 20:32:38 +00:00
Anders Carlsson
910847c149
Mangle template template parameters. Fixes PR5861.
...
llvm-svn: 92030
2009-12-23 19:30:55 +00:00
Fariborz Jahanian
25c07fa224
Removed a FIXME comment.
...
llvm-svn: 92028
2009-12-23 19:26:34 +00:00
Fariborz Jahanian
7df3980609
More rewriting of __block variables.
...
llvm-svn: 92027
2009-12-23 19:22:33 +00:00
Chris Lattner
3859c74b32
fix the microsoft "charify" extension to return the charified token
...
as a character literal, not a string literal. This might fix
rdar://7486575
llvm-svn: 92025
2009-12-23 19:15:27 +00:00
Chris Lattner
4af1aadeb5
update comments
...
llvm-svn: 92022
2009-12-23 19:08:19 +00:00
Chris Lattner
b089c1de55
switch -Werror/-Wfatal-errors error conditions to use diagnostics instead
...
of printf, patch by Christian Adaker!
llvm-svn: 92019
2009-12-23 18:53:37 +00:00
Eli Friedman
38b9ad88e2
Fix the overflow calculation in Sema::CheckTemplateArgument to be a bit more
...
accurate.
llvm-svn: 92018
2009-12-23 18:44:58 +00:00
Douglas Gregor
25ab25f39d
When using a default function argument for a function template (or
...
member function thereof), perform the template instantiation each time
the default argument is needed. This ensures that
(1) We get different CXXTemporary objects for each instantiation, and
(2) Any other instantiations or definitions triggered by the
instantiation of the default argument expression are guaranteed to
happen; previously, they might have been suppressed, e.g., because
they happened in an unevaluated context.
This fixes the majority of PR5810. However, it does not address the
problem where we may have multiple uses of the same CXXTemporary
within an expression when the temporary came from a non-instantiated
default argument expression.
llvm-svn: 92015
2009-12-23 18:19:08 +00:00
Kovarththanan Rajaratnam
55e74a1a6a
Remove RewriteBlocks. It has been superseded by RewriteObjC
...
llvm-svn: 92014
2009-12-23 18:03:34 +00:00
Nuno Lopes
cfca1f0dc1
move a few more symbols to .rodata/.data.rel.ro
...
llvm-svn: 92012
2009-12-23 17:49:57 +00:00
Douglas Gregor
53982d577d
Don't commit my silly little local changes
...
llvm-svn: 92010
2009-12-23 17:43:32 +00:00
Douglas Gregor
72e9f2f0b9
Don't disable smart pointers, silly
...
llvm-svn: 92009
2009-12-23 17:42:06 +00:00
Douglas Gregor
e6600379b1
Fix DISABLE_SMART_POINTERS build
...
llvm-svn: 92008
2009-12-23 17:40:29 +00:00
Steve Naroff
13468371a7
Add support for handling initializers in RewriteObjC::RewriteByRefVar().
...
As the FIXME indicates, RewriteByRefVar() won't work for multiple declarators (in general). I've discussed this with Fariborz and he is aware of the limitation.
llvm-svn: 92007
2009-12-23 17:24:33 +00:00
Zhongxing Xu
d803cc51af
Register call inliner as the last checker.
...
llvm-svn: 91992
2009-12-23 09:15:19 +00:00
Zhongxing Xu
2923046ec4
Migrate the call inliner to the Checker interface.
...
llvm-svn: 91991
2009-12-23 08:56:18 +00:00
Ted Kremenek
00d19ee130
Add 'DeclStmt::DoDestroy()' which doesn't actually recurse over its child expressions (via StmtIterator), as those expressions are owned by the Decls and Types (which are destroyed elsewhere). This fixes a crasher reported in <rdar://problem/7487294>.
...
llvm-svn: 91990
2009-12-23 08:56:00 +00:00
Zhongxing Xu
d2ab38e3f4
For inter-procedural analysis, predecessor node may be in another function.
...
So we should use the current program point.
llvm-svn: 91989
2009-12-23 08:54:57 +00:00
Ted Kremenek
a7bcbde814
Add CFG support for the condition variable that can appear in IfStmts in C++ mode.
...
Add transfer function support in GRExprEngine for IfStmts with initialized condition variables.
llvm-svn: 91987
2009-12-23 04:49:01 +00:00
Ted Kremenek
857f41c650
Suppress dead store warnings involving objects initialized with CXXExprTemporaries.
...
llvm-svn: 91986
2009-12-23 04:11:44 +00:00
Ted Kremenek
76d5225271
Add stack trace pretty printing in GRExprEngine::VisitLValue().
...
llvm-svn: 91985
2009-12-23 04:09:43 +00:00
Ted Kremenek
49ace5cd62
Fix CXXConstructExpr::getSourceRange() to not include the source ranges of CXXDefaultArgExprs when computing its range (since these expressions have no source range, and using them will make the encompassing range invalid).
...
llvm-svn: 91984
2009-12-23 04:00:48 +00:00
Eric Christopher
c87915629b
Update for the intrinsic changes in llvm: the object size intrinsic
...
only takes a boolean second argument now. Update tests accordingly.
Currently the builtin still accepts the full range for compatibility.
llvm-svn: 91983
2009-12-23 03:49:37 +00:00
Ted Kremenek
9a05f20d41
Teach GRExprEngine::VisitLValue to ignore CXXExprWithTempories (for now).
...
llvm-svn: 91982
2009-12-23 03:14:23 +00:00
Ted Kremenek
25e280bf02
Fix PR 5857. When casting from a symbolic region to an integer back to a pointer value, we were not correctly layering the correct ElementRegion on the original SymbolicRegion.
...
llvm-svn: 91981
2009-12-23 02:52:14 +00:00
Ken Dyck
73536eab67
Remove CharUnits::toString() to eliminate dependence on <string>.
...
llvm-svn: 91978
2009-12-23 02:44:11 +00:00
Fariborz Jahanian
02e07737a9
Patch to do more rewrite of __block variables.
...
Still WIP.
llvm-svn: 91977
2009-12-23 02:07:37 +00:00
John McCall
230a5d527e
Eliminate a completely unnecessary buffer copy when parsing float literals.
...
llvm-svn: 91974
2009-12-23 01:37:10 +00:00
Ted Kremenek
bb7a826844
Teach GRExprEngine::VisitLValue that we don't handle CXXZeroInitValueExprs yet.
...
llvm-svn: 91970
2009-12-23 01:25:13 +00:00
Ted Kremenek
343b51271d
Also treat the type of the subexpression as a pointer in GRExprEngine::VisitCast when the expression is handled as an lvalue.
...
llvm-svn: 91969
2009-12-23 01:19:20 +00:00
Ted Kremenek
1f76b51d3f
Add assertion to check for valid source ranges.
...
llvm-svn: 91966
2009-12-23 01:09:59 +00:00
John McCall
b50c443df2
Test case for PR5134.
...
llvm-svn: 91965
2009-12-23 01:09:14 +00:00
Daniel Dunbar
e0d2691b88
Driver: Fix '... -O4 -O0 ...', which was generating bitcode.
...
llvm-svn: 91962
2009-12-23 00:47:42 +00:00
Daniel Dunbar
f4894fe0eb
Driver: Drop ToolChain::getHost()
...
llvm-svn: 91960
2009-12-23 00:46:38 +00:00
John McCall
db3062cd4e
Test case from PR5476.
...
llvm-svn: 91957
2009-12-23 00:44:38 +00:00
John McCall
0a4bb26ed0
Set a member's access specifier even if it doesn't match the previous specifier.
...
Prevents an assert on successive redeclarations.
Fixed PR5573.
llvm-svn: 91956
2009-12-23 00:37:40 +00:00
Ted Kremenek
22cc1a8438
Add basic support for analyzing CastExprs as lvalues.
...
llvm-svn: 91952
2009-12-23 00:26:16 +00:00
Douglas Gregor
04c5f973ee
Objective-C methods can be variadic, too. Who knew.
...
llvm-svn: 91951
2009-12-23 00:21:46 +00:00
Douglas Gregor
8d48e9a26e
Switch Sema::CreateOverloadedUnaryOp over to InitializationSequence.
...
llvm-svn: 91948
2009-12-23 00:02:00 +00:00
Nuno Lopes
56abcbdb47
warn when attribute warn_unused_result is applied to void functions.
...
while at it, remove an outdated FIXME
llvm-svn: 91946
2009-12-22 23:59:52 +00:00
Douglas Gregor
684d7bdc43
Allow the first parameter of operator new to be a cv-qualified
...
size_t. Also, fix an issue with initialization of parameters in calls,
where we weren't removing the cv-qualifiers on the parameter type
itself. Fixes PR5823.
llvm-svn: 91941
2009-12-22 23:42:49 +00:00
Daniel Dunbar
c7a67b7877
Driver: When linking, don't warn about unused arguments which are obviously only
...
used during compilation.
- There is no easy way to define this group properly, unfortunately, and maybe
this is a losing strategy. For now this is unambiguous more friendly, though.
llvm-svn: 91940
2009-12-22 23:19:32 +00:00
Chris Lattner
801fda871b
implement -W[no-]fatal-errors, patch by Christian Adåker!
...
llvm-svn: 91938
2009-12-22 23:12:53 +00:00
Ted Kremenek
c0895eb730
Add c++-analyzer symlink (which is used by scan-build)
...
llvm-svn: 91937
2009-12-22 23:00:32 +00:00
Douglas Gregor
19fc0b753a
Make sure that reinterpret_cast gets a CastKind on all successful
...
paths. Fixes "cannot compile this unexpected cast lvalue yet" error in
llvm/lib/Analysis/IPA/GlobalsModRef.cpp.
llvm-svn: 91932
2009-12-22 22:47:22 +00:00
Douglas Gregor
39740dce30
Revert accidental commit
...
llvm-svn: 91930
2009-12-22 22:30:51 +00:00
Chris Lattner
261dd5ec06
accept -Wcomments as an alias for -Wcomment, PR5855
...
llvm-svn: 91929
2009-12-22 22:29:12 +00:00
John McCall
a1d8550778
Add using shadow decls to the "instantiated locals" map, fixing PR5847.
...
llvm-svn: 91928
2009-12-22 22:26:37 +00:00
Douglas Gregor
b6ea60872d
Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequence
...
llvm-svn: 91927
2009-12-22 22:17:25 +00:00
Ted Kremenek
e19711d223
Add transfer functions support for visiting an Objective-C message expression as an lvalue when the return type is a C++ reference.
...
llvm-svn: 91926
2009-12-22 22:13:46 +00:00
Daniel Dunbar
42fe663e3b
ARM: Remove a FIXME, it's not actually more complicated than that.
...
llvm-svn: 91924
2009-12-22 21:59:17 +00:00
Douglas Gregor
0a70c4d9a2
Switch parameter passing for overloaded binary operators to
...
InitializationSequence. Fixes the -fsyntax-only failure in
llvm/lib/Transforms/Scalar/InstructionCombining.cpp.
llvm-svn: 91921
2009-12-22 21:44:34 +00:00
Douglas Gregor
dc72875d25
Serialize the NoReturn bit on FunctionTypes for precompiled headers
...
llvm-svn: 91911
2009-12-22 18:11:50 +00:00
Douglas Gregor
613bf10470
Enter the scope of an initializer for direct-initialization as well as
...
for copy-initialization.
llvm-svn: 91909
2009-12-22 17:47:17 +00:00
Douglas Gregor
2e9c795df0
When transforming a C++ "new" expression that was not explicitly given
...
a size, check whether the transformed type is itself an array type. If
so, take the major array bound as the size to allocate. Fixes PR5833.
llvm-svn: 91907
2009-12-22 17:13:37 +00:00
Douglas Gregor
bbeb5c391c
Switch parameter-passing for calls via function pointers (where we
...
don't have a FunctionDecl) over to InitializationSequence.
llvm-svn: 91906
2009-12-22 16:09:06 +00:00
Douglas Gregor
1b3039344b
Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't use the location information but we did spend a bunch of time building faked-up TypeLocs
...
llvm-svn: 91905
2009-12-22 15:35:07 +00:00
Ken Dyck
8c89d59c82
Move the implementation of ASTContext::getTypeSizeInChars() to the .cpp file to
...
avoid #including CharUnits.h in ASTContext.h.
llvm-svn: 91903
2009-12-22 14:23:30 +00:00
Douglas Gregor
96596c98fb
Switch initialization of parameters in a call over to
...
InitializationSequence (when a FunctionDecl is present). This required
a few small fixes to initialization sequences:
- Make sure to use the adjusted parameter type for initialization of
function parameters.
- Implement transparent union calling semantics in C
llvm-svn: 91902
2009-12-22 07:24:36 +00:00
Anders Carlsson
8a35c7982c
Make sure that we mangle overloaded operators that are member functions correctly, giving them the correct arity.
...
With this seemingly insignificant fix, we are now able to build and link clang using clang itself! (LLVM still has to be built with gcc for the time being).
llvm-svn: 91893
2009-12-22 06:36:32 +00:00
Anders Carlsson
3caa2b486d
Work around PR5514.
...
llvm-svn: 91891
2009-12-22 06:13:42 +00:00
Chris Lattner
d806cbc98d
fix a bug handling the gnu ?: extension. Patch by Storlek on IRC,
...
who prefers to be stealthy and mysterious.
llvm-svn: 91888
2009-12-22 06:00:13 +00:00
Anders Carlsson
9c45ad7a1b
When we simply return a retained member expression when instantiating, we must also mark the member decl as referenced.
...
llvm-svn: 91887
2009-12-22 05:24:09 +00:00
Eli Friedman
e2808379b8
Zap CheckInitializerTypes.
...
llvm-svn: 91884
2009-12-22 02:50:30 +00:00
Eli Friedman
5f101b95c6
Switch default arguments over to InitializationSequence.
...
llvm-svn: 91883
2009-12-22 02:46:13 +00:00
Eli Friedman
a553d4ac95
Switch compound literals over to InitializationSequence.
...
llvm-svn: 91882
2009-12-22 02:35:53 +00:00
Eli Friedman
463e523ad8
Switch file-scope assignment initialization over to InitializationSequence.
...
llvm-svn: 91881
2009-12-22 02:10:53 +00:00
Daniel Dunbar
3780f0b680
x86_64: Structures with no fields but which have padding should be classified as
...
integer.
- This is consistent, but may not be correct. I will revisit x86_64 ABI handling for C++ as a whole at some point.
- PR5831.
llvm-svn: 91874
2009-12-22 01:19:25 +00:00
Douglas Gregor
da8cdbce35
Centralize the emission/suppression/delay of diagnostics describing runtime before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments.
...
llvm-svn: 91870
2009-12-22 01:01:55 +00:00
John McCall
463e10cbd5
Stop diagnosing the use of inner classes as friends. ddunbar asked whether
...
this was useful, and on review Doug and I decided it was probably on the level
of a bug in the standard and therefore not worth a warning even in -pedantic.
If someone disagrees and urgently wants clang++ to warn about this in strict
c++98 mode, we can talk about it.
llvm-svn: 91868
2009-12-22 00:59:39 +00:00
Fariborz Jahanian
8120346c57
Template code for rewrite of __block variables - wip.
...
llvm-svn: 91865
2009-12-22 00:48:54 +00:00
Douglas Gregor
507eb87f05
Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl
...
llvm-svn: 91862
2009-12-22 00:34:07 +00:00
Douglas Gregor
4141d5bea2
When converting from a type to itself or one of its base classes via a
...
constructor call, the conversion is only a standard conversion
sequence if that constructor is a copy constructor. This fixes PR5834
in a semi-lame way, because the "real" fix will be to move over to
InitializationSequence. That will happen "soonish", but not now.
llvm-svn: 91861
2009-12-22 00:21:20 +00:00
Douglas Gregor
2bb0765bb4
When filling in value initializations within an initializer list, be
...
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.
llvm-svn: 91858
2009-12-22 00:05:34 +00:00
Fariborz Jahanian
e175eeb117
Providing support for rewriting of block copy/dispose of
...
imported block variables. WIP.
llvm-svn: 91856
2009-12-21 23:31:42 +00:00
Daniel Dunbar
0def3d17cb
ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".
...
- Correctly is in quotes, because we are following what I interpreted as GCC's
intent (which diverges from practice, naturally).
- Also, fix the arch define for arm1136jf-s.
llvm-svn: 91855
2009-12-21 23:28:17 +00:00