Anders Carlsson
173d51286b
When compiling with -fno-threadsafe-statics, guard variables for globals with internal linkage don't have to be i64, i8 works just fine!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 04:37:08 +00:00
Douglas Gregor
6add6fbc59
Fix test
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130285 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 04:02:56 +00:00
Douglas Gregor
27766d2501
Improve diagnostics for typo correction via Sema::ClassifyName(), by
...
looking at the context and the correction and using a custom
diagnostic. Also, enable some Fix-It tests that were somewhat lamely
disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130283 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 03:47:06 +00:00
Douglas Gregor
17ffd14040
Add triple in the hope of unbreaking the bubuildbot
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130280 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 03:24:57 +00:00
John McCall
f5307514ee
FixOverloadedFunctionReference needs to rebuild member accesses of
...
instance methods to have bound-member type.
Fixing that broke __unknown_anytype, which I've in turn fixed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130266 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 00:36:17 +00:00
Douglas Gregor
0f7b3dcece
When comparing Objective-C pointers during overload resolution to
...
determine which is a better conversion to "void*", be sure to perform
the comparison using the safe-for-id
ASTContext::canAssignObjCInterfaces() rather than the asserts-with-id
ASTContext::canAssignObjCInterfaces().
Fixes <rdar://problem/9327203>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 00:01:52 +00:00
Fariborz Jahanian
62055b0618
With ms_struct attribut, Zero-length bitfields following
...
non-bitfield members are ignore. // rdar://8823265 wip
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130257 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 23:52:16 +00:00
Douglas Gregor
028ea4bf0c
When computing Objective-C pointer conversions in C++, retain
...
the qualifiers (e.g., GC qualifiers) on the type we're converting
from, rather than just blindly adopting the qualifiers of the type
we're converting to or dropping qualifiers altogether.
As an added bonus, properly diagnose GC qualifier mismatches to
eliminate a crash in the overload resolution failure diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130255 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 23:16:46 +00:00
Manuel Klimek
7412494982
To be able to replay compilations we need to accurately remodel how
...
includes get resolved, especially when they are found relatively to
another include file. We also try to get it working for framework
includes, but that part of the code is untested, as I don't have a code
base that uses it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130246 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:50:03 +00:00
Devang Patel
37833b00d2
We need pointer size in bits here.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:16:49 +00:00
Argyrios Kyrtzidis
cd88b41717
Gcc pads the size of an array using the alignment of its elements.
...
The size of the array may not be aligned according to alignment of its elements if an alignment attribute is
specified in a typedef. Fixes rdar://8665729 & http://llvm.org/PR5637 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130242 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 21:05:39 +00:00
John McCall
864c041e11
Make yet another placeholder type, this one marking that an expression is a bound
...
member function, i.e. something of the form 'x.f' where 'f' is a non-static
member function. Diagnose this in the general case. Some of the new diagnostics
are probably worse than the old ones, but we now get this right much more
universally, and there's certainly room for improvement in the diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 20:42:42 +00:00
Daniel Dunbar
eab80782f6
IRgen/Darwin: Fix refacto introduced in Triple changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130233 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 19:43:00 +00:00
Fariborz Jahanian
c1a0a73c1f
Add ms_struct attribute on record typee
...
(and ignore it for now) - wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130224 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 17:54:40 +00:00
Argyrios Kyrtzidis
8a285ae6fc
Emit a -Wnull-dereference warning for "*null" not just "*null = something". Addresses rdar://9269271.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 17:41:22 +00:00
Argyrios Kyrtzidis
0cd7be4c4d
Disable a test that fails on windows; for some reason we don't detect that the header has different timestamp.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 16:49:25 +00:00
NAKAMURA Takumi
7a3a8148ab
include/clang/AST/StmtIterator.h: std::pair should be provided by <utility>. libcxx needs it.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130183 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 03:17:13 +00:00
Eric Christopher
ad27eeaf03
Temporarily revert r130176, it appears to have broken a few tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130179 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 01:02:04 +00:00
Devang Patel
50811d2e89
Emit intrinsic at current insert point, not at the end of current block.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130177 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:52:27 +00:00
Stuart Hastings
df39fa2811
Turn on byval parameters in Clang for ARM APCS. rdar://problem/7662569
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:48:12 +00:00
Devang Patel
e2d0191afb
Simplify. There is no need to have a method to just call another method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130175 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:43:36 +00:00
Fariborz Jahanian
dd697bc862
Generalize case for built-in expressions having
...
side-effect to generate their ir. Not just for
__builtin_expect. // rdar://9330105
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130172 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:10:07 +00:00
Argyrios Kyrtzidis
abdd3b3861
For the warnings related to -Wparentheses, display first the note about how to silence the warning and
...
any other suggestion after that. Related to rdar://9300260.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130169 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 23:01:29 +00:00
Ted Kremenek
72e3a0a2a5
Re-enable disable free optimization where the FrontendAction is not freed when -disable-free is passed. This accidentally was commited in r128011.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:57:55 +00:00
Ted Kremenek
1e713f50e9
When generating printf fixits, preserve the original formating for unsigned integers (e.g., 'x', 'o').
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:32:59 +00:00
Fariborz Jahanian
ec99195490
Ir-gen the side-effect(s) when __builtin_expect is
...
constant-folded. // rdar://9330105
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130163 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:30:02 +00:00
Argyrios Kyrtzidis
8d8f2c20f3
Fix a crash when ASTReader emits diagnostic when another one is in flight. Fixes rdar//9334563.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130162 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:23:56 +00:00
Lenny Maiorani
357f6ee9f1
Implements the strncmp() checker just like the strcmp() checker, but with bounds. Requires LLVM svn r129582.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130161 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 22:21:00 +00:00
Argyrios Kyrtzidis
865dd8c8fe
'extern' variables in functions don't shadow externs in global scope. Fixes rdar://8883302, this time for C++ as well.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130157 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 21:39:50 +00:00
Nico Weber
014f9720bc
Add libstdc++ search paths for GCC 4.6.0 on Arch Linux. Patch by Jakub Wieczorek.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130152 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:59:30 +00:00
Daniel Dunbar
8ac127a09a
Driver: When compilation fails, don't try to remove output files we don't have
...
write access to.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130150 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:43:05 +00:00
Chris Lattner
85e59d79e3
don't use compound literals in MM macros, since they will be instantiated
...
into user code which may warn about them with -pedantic. Patch by Jonathan Sauer!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130149 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:42:40 +00:00
Chris Lattner
223de2497f
fix PR9474, a crash with -fshort-enum and C++ templates: when instantiating
...
the enum decl, we need to use an integer type the same size as the enumerator,
which may not be the promoted type with packed enums.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130148 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:37:58 +00:00
Fariborz Jahanian
62c9258f4a
Recognize gcc's ms_struct pragma (and ignore for now).
...
This is wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130138 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 18:49:15 +00:00
Douglas Gregor
621c92a582
Minor tweak to avoid having to dig through canonical types multiple times when checking a qualification conversion
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130136 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 18:40:17 +00:00
Francois Pichet
8d5fcc7e3f
Add Windows SEH keywords.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130132 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 17:23:15 +00:00
Douglas Gregor
ec385cf3c7
When Sema::ClassifyName() finds an invalid ivar reference, return an
...
invalid expression rather than the far-more-generic "error". Fixes a
mild regression in error recovery uncovered by the GCC testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130128 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 15:05:41 +00:00
Chandler Carruth
81542fd91b
Remove some more hard CR-LF lines. These were particularly weird as they were
...
only a few lines of the file. Also set their properties to have explicitly
native eol sytle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 07:09:43 +00:00
Chandler Carruth
8c54cb90fd
Set the native EOL property on this now that I've fixed it. Fixing some other
...
instances of this momentarily.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130123 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 06:55:34 +00:00
John Wiegley
552622067d
t/clang/expr-traits
...
Patch authored by David Abrahams.
These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for
parsing code that employs certain features of the Embarcadero C++ compiler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130122 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 06:54:41 +00:00
Chandler Carruth
62395c9666
Remove hard coded dos line endings, let subversion translate them on
...
update.
Despite the diff, nothing but line endings changed here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130121 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 06:34:35 +00:00
Nico Weber
80585d8c96
Let clang detect gcc triple on Ubuntu Natty. Patch by Thomas Jablin.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130119 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 03:17:35 +00:00
Eli Friedman
912d372642
Missing bit of r130117.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130118 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 22:31:41 +00:00
Eli Friedman
a47317bbee
PR4304: Add warning for designators in strict c89 mode.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 22:14:22 +00:00
Benjamin Kramer
6e089c687c
Use template magic to make dumping of vectors slightly less fragile.
...
No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130114 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 17:44:50 +00:00
Ken Dyck
1a8c15a8b7
Convert size and alignment variables to CharUnits in EmitAggregateCopy(). No
...
change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130113 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 17:37:26 +00:00
Ken Dyck
5ff1a3508b
Convert type size and alignment to CharUnits in CheckAggExprForMemSetUse().
...
No change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130112 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 17:25:32 +00:00
Ken Dyck
02c45333b8
Convert the return type of GetNumNonZeroBytesInInit() to CharUnits. No
...
change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130111 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 17:17:56 +00:00
Ken Dyck
479b61ccd8
Eliminate some literal 8s by converting size variables in EmitGCMove() and
...
EmitFinalDestCopy() to CharUnits. No change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 17:08:00 +00:00
Ken Dyck
243a4aa8af
Replace calls to ASTContext::getTypeInfo() with calls to
...
ASTContext::getTypeSize() when only the size part is used. No change in
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130109 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 17:02:38 +00:00