Devang Patel
e67eca43d6
We need pointer size in bits here.
...
llvm-svn: 130244
2011-04-26 21:16:49 +00:00
Argyrios Kyrtzidis
ae40e4e10e
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 .
llvm-svn: 130242
2011-04-26 21:05:39 +00:00
John McCall
0009fcc39e
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.
llvm-svn: 130239
2011-04-26 20:42:42 +00:00
Daniel Dunbar
a59b0a6e3c
IRgen/Darwin: Fix refacto introduced in Triple changes.
...
llvm-svn: 130233
2011-04-26 19:43:00 +00:00
Fariborz Jahanian
6b4e26bee2
Add ms_struct attribute on record typee
...
(and ignore it for now) - wip.
llvm-svn: 130224
2011-04-26 17:54:40 +00:00
Argyrios Kyrtzidis
a9b630e4d7
Emit a -Wnull-dereference warning for "*null" not just "*null = something". Addresses rdar://9269271.
...
llvm-svn: 130207
2011-04-26 17:41:22 +00:00
Eric Christopher
6f095d613a
Temporarily revert r130176, it appears to have broken a few tests.
...
llvm-svn: 130179
2011-04-26 01:02:04 +00:00
Devang Patel
420c8de92e
Emit intrinsic at current insert point, not at the end of current block.
...
llvm-svn: 130177
2011-04-25 23:52:27 +00:00
Stuart Hastings
83da03c2ab
Turn on byval parameters in Clang for ARM APCS. rdar://problem/7662569
...
llvm-svn: 130176
2011-04-25 23:48:12 +00:00
Devang Patel
4f325d1f0f
Simplify. There is no need to have a method to just call another method.
...
llvm-svn: 130175
2011-04-25 23:43:36 +00:00
Fariborz Jahanian
24ac1599fc
Generalize case for built-in expressions having
...
side-effect to generate their ir. Not just for
__builtin_expect. // rdar://9330105
llvm-svn: 130172
2011-04-25 23:10:07 +00:00
Argyrios Kyrtzidis
e1b97c40c5
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.
llvm-svn: 130169
2011-04-25 23:01:29 +00:00
Ted Kremenek
4f76f4ae31
Re-enable disable free optimization where the FrontendAction is not freed when -disable-free is passed. This accidentally was commited in r128011.
...
llvm-svn: 130168
2011-04-25 22:57:55 +00:00
Ted Kremenek
8dcc466886
When generating printf fixits, preserve the original formating for unsigned integers (e.g., 'x', 'o').
...
llvm-svn: 130164
2011-04-25 22:32:59 +00:00
Fariborz Jahanian
5a866c0bf2
Ir-gen the side-effect(s) when __builtin_expect is
...
constant-folded. // rdar://9330105
llvm-svn: 130163
2011-04-25 22:30:02 +00:00
Argyrios Kyrtzidis
daa41f59e4
Fix a crash when ASTReader emits diagnostic when another one is in flight. Fixes rdar//9334563.
...
llvm-svn: 130162
2011-04-25 22:23:56 +00:00
Lenny Maiorani
e553e40467
Implements the strncmp() checker just like the strcmp() checker, but with bounds. Requires LLVM svn r129582.
...
llvm-svn: 130161
2011-04-25 22:21:00 +00:00
Argyrios Kyrtzidis
bd0a3fe5e8
'extern' variables in functions don't shadow externs in global scope. Fixes rdar://8883302, this time for C++ as well.
...
llvm-svn: 130157
2011-04-25 21:39:50 +00:00
Nico Weber
a0b2dddcf0
Add libstdc++ search paths for GCC 4.6.0 on Arch Linux. Patch by Jakub Wieczorek.
...
llvm-svn: 130152
2011-04-25 20:59:30 +00:00
Daniel Dunbar
462e7ed497
Driver: When compilation fails, don't try to remove output files we don't have
...
write access to.
llvm-svn: 130150
2011-04-25 20:43:05 +00:00
Chris Lattner
f03406f103
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!
llvm-svn: 130149
2011-04-25 20:42:40 +00:00
Chris Lattner
cdb591af03
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.
llvm-svn: 130148
2011-04-25 20:37:58 +00:00
Fariborz Jahanian
743dda49d9
Recognize gcc's ms_struct pragma (and ignore for now).
...
This is wip.
llvm-svn: 130138
2011-04-25 18:49:15 +00:00
Douglas Gregor
90609aa394
Minor tweak to avoid having to dig through canonical types multiple times when checking a qualification conversion
...
llvm-svn: 130136
2011-04-25 18:40:17 +00:00
Douglas Gregor
b90f5185b6
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.
llvm-svn: 130128
2011-04-25 15:05:41 +00:00
Chandler Carruth
bc0f9aeac3
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.
llvm-svn: 130124
2011-04-25 07:09:43 +00:00
John Wiegley
f9f6584e95
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.
llvm-svn: 130122
2011-04-25 06:54:41 +00:00
Nico Weber
adf8ba98e7
Let clang detect gcc triple on Ubuntu Natty. Patch by Thomas Jablin.
...
llvm-svn: 130119
2011-04-25 03:17:35 +00:00
Eli Friedman
ea7b85bfe0
PR4304: Add warning for designators in strict c89 mode.
...
llvm-svn: 130117
2011-04-24 22:14:22 +00:00
Benjamin Kramer
d47a12a4e2
Use template magic to make dumping of vectors slightly less fragile.
...
No intended functionality change.
llvm-svn: 130114
2011-04-24 17:44:50 +00:00
Ken Dyck
bb2c24008f
Convert size and alignment variables to CharUnits in EmitAggregateCopy(). No
...
change in functionality intended.
llvm-svn: 130113
2011-04-24 17:37:26 +00:00
Ken Dyck
239a3357af
Convert type size and alignment to CharUnits in CheckAggExprForMemSetUse().
...
No change in functionality intended.
llvm-svn: 130112
2011-04-24 17:25:32 +00:00
Ken Dyck
df94cb7dbe
Convert the return type of GetNumNonZeroBytesInInit() to CharUnits. No
...
change in functionality intended.
llvm-svn: 130111
2011-04-24 17:17:56 +00:00
Ken Dyck
3b4bd9a164
Eliminate some literal 8s by converting size variables in EmitGCMove() and
...
EmitFinalDestCopy() to CharUnits. No change in functionality intended.
llvm-svn: 130110
2011-04-24 17:08:00 +00:00
Ken Dyck
a8094505e2
Replace calls to ASTContext::getTypeInfo() with calls to
...
ASTContext::getTypeSize() when only the size part is used. No change in
functionality intended.
llvm-svn: 130109
2011-04-24 17:02:38 +00:00
Ken Dyck
272b6fa0f0
Simplify AppendTailPadding() by converting its parameter to CharUnits. No
...
change in functionality intended.
llvm-svn: 130108
2011-04-24 16:53:44 +00:00
Ken Dyck
7a0b19f978
Eliminate literal 8s from LayoutUnionField by converting NumBytesToAppend to
...
CharUnits. No change in functionality intended.
llvm-svn: 130107
2011-04-24 16:47:33 +00:00
Ken Dyck
345a6de9b4
Eliminate literal 8s from LayoutBitField(), converting variables to
...
CharUnits or replacing the 8s with char align. No change in functionality
intended.
llvm-svn: 130106
2011-04-24 16:40:29 +00:00
Sebastian Redl
010288f7c1
Set the correct anonymous namespace (must be last reopening), and behave correctly in the presence of the ever-annoying linkage specifications.
...
llvm-svn: 130105
2011-04-24 16:28:21 +00:00
Sebastian Redl
fa1f370b7d
Fix adding an anonymous namespace in a chained PCH to a namespace from a previous PCH.
...
Fix anonymous namespaces in PCH.
llvm-svn: 130104
2011-04-24 16:28:13 +00:00
Sebastian Redl
ab238a7d18
Synthesizing the definition of an implicit member is an AST modification, so notify any mutation listeners of it. This fixes a crasher in chained PCH, where an implicit destructor in a PCH gets a definition in a chained PCH, which is then lost. However, any further use of the destructor would cause its definition to be regenerated in the final file, hiding the bug.
...
llvm-svn: 130103
2011-04-24 16:28:06 +00:00
Sebastian Redl
f830df4e9d
On reading DeclContexts from PCH, check for visible updates even if the context was empty in the original version. Also, if there are any, tell the context that it has external visible decls. This fixes the problem that a namespace that was empty in the initial PCH (could also happen if the initial PCH didn't include any std header but caused implicit creation of namespace std, e.g. due to implicit declaration of a virtual destructor) never found any declaration declared in *any* chained PCH. Very ugly when the chained PCH includes all that std stuff, as the errors were effectively the same as not including std headers.
...
llvm-svn: 130102
2011-04-24 16:27:54 +00:00
Sebastian Redl
83f3b859ab
Make the invalid declarator recovery when parsing members work the same as when parsing global decls. It's still rather broken (skipping much too far when the declarator belongs to a function definition), but at least not so broken as to mismatch braces. Tested by the removal of the fixme in the template test case.
...
llvm-svn: 130101
2011-04-24 16:27:48 +00:00
Sebastian Redl
14afaf0093
Store the full list of pending instantiations in a chained PCH. Previously we attempted to store only new pending instantiations, but our filter was incorrect, dropping implicit instantiations of class template members. It's just not worth coming up with a complex filter that is correct, when the only cost is PCH files that are a few hundred bytes (at most) larger.
...
llvm-svn: 130098
2011-04-24 16:27:30 +00:00
Francois Pichet
dd876125df
Downgrade unnecessary "typename" from error to warning in Microsoft mode.
...
This fixes 1 error when parsing MSVC 2008 headers with clang.
Must "return true;" even if it is a warning because the rest of the code path assumes that SS is set to something. The parser will get back on its feet and continue parsing the rest of the declaration correctly so it is not a problem.
llvm-svn: 130088
2011-04-24 11:24:13 +00:00
Ken Dyck
27337a8800
Convert AccessInfo::AccessAlignment to CharUnits. No change in functionality
...
intended.
llvm-svn: 130087
2011-04-24 10:13:17 +00:00
Jay Foad
dbf81d8ddf
PR9214: Convert the DIBuilder API to use ArrayRef.
...
llvm-svn: 130086
2011-04-24 10:11:03 +00:00
Ken Dyck
f76759c6fa
Convert CGBitFieldInfo::FieldByteOffset to CharUnits. No change in
...
functionality intended.
llvm-svn: 130085
2011-04-24 10:04:59 +00:00
John McCall
617339e692
GCC seems to create address-of expression manglings when passing *any*
...
function as a template argument where a pointer to function is wanted.
Just extend the existing hack.
llvm-svn: 130084
2011-04-24 08:43:07 +00:00
John McCall
6dc0a2b467
Update the mangler for some of the "new" unresolved-name manglings.
...
I've sent off an email requesting clarification on a few things that
I wasn't sure how to handle.
This also necessitated making prefixes and unresolved-prefixes get
mangled separately.
llvm-svn: 130083
2011-04-24 08:23:24 +00:00