]> granicus.if.org Git - clang/log
clang
13 years agoEliminates an assert in the strncpy/strncat checker caused by not validating a cast...
Lenny Maiorani [Thu, 28 Apr 2011 18:59:43 +0000 (18:59 +0000)]
Eliminates an assert in the strncpy/strncat checker caused by not validating a cast was successful. If the value of an argument was unknown, the cast would result in a NULL pointer which was later being dereferenced.

This fixes Bugzilla #9806.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130422 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen value-initializing the elements of an array not not included in the initializer...
Argyrios Kyrtzidis [Thu, 28 Apr 2011 18:53:58 +0000 (18:53 +0000)]
When value-initializing the elements of an array not not included in the initializer make sure
that a non-trivial C++ constructor gets called.

Fixes rdar://9347552 & http://llvm.org/PR9801

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130421 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't waste memory if the initializer expression is empty.
Argyrios Kyrtzidis [Thu, 28 Apr 2011 18:53:55 +0000 (18:53 +0000)]
Don't waste memory if the initializer expression is empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130420 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReplace SmallVector with an array, as suggested by Frits van Bommel. rdar://problem...
Stuart Hastings [Thu, 28 Apr 2011 18:16:06 +0000 (18:16 +0000)]
Replace SmallVector with an array, as suggested by Frits van Bommel.  rdar://problem/7662569

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130417 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen determining whether two types are reference-compatible, check
Douglas Gregor [Thu, 28 Apr 2011 17:56:11 +0000 (17:56 +0000)]
When determining whether two types are reference-compatible, check
non-CVR qualifiers as well as CVR qualifiers. For example, don't allow
a reference to an integer in address space 1 to bind to an integer in
address space 2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130411 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixes ArrayTypeTraitExpr (-Wnon-virtual-dtor).
Manuel Klimek [Thu, 28 Apr 2011 17:03:03 +0000 (17:03 +0000)]
Fixes ArrayTypeTraitExpr (-Wnon-virtual-dtor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130407 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOnly call the MacroExpands callback when we're actually going to
Douglas Gregor [Thu, 28 Apr 2011 16:36:13 +0000 (16:36 +0000)]
Only call the MacroExpands callback when we're actually going to
expand the macro, based on a patch by Ori Avtalion. Fixes PR9799.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130402 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agolibstdc++ 4.4 uses __is_signed as an identifier, while Clang treats it
Douglas Gregor [Thu, 28 Apr 2011 15:48:45 +0000 (15:48 +0000)]
libstdc++ 4.4 uses __is_signed as an identifier, while Clang treats it
as a keyword for the __is_signed type trait. Cope with this conflict
via some hackish recovery: if we see a declaration of the form

 static const bool __is_signed

then we stop treating __is_signed as a keyword and instead treat it as
an identifier. It's ugly, but it's better than making the __is_signed
type trait conditional on some language flag. Fixes PR9804.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130399 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplements strcasecmp() checker in Static Analyzer.
Lenny Maiorani [Thu, 28 Apr 2011 15:09:11 +0000 (15:09 +0000)]
Implements strcasecmp() checker in Static Analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130398 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSilence more -Wnon-pod-memset given its current implementation. I may be
Chandler Carruth [Thu, 28 Apr 2011 08:19:45 +0000 (08:19 +0000)]
Silence more -Wnon-pod-memset given its current implementation. I may be
able to revert these based on a patch I'm working on, but no reason for
people to be spammed with warnings in the interim.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130394 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd comment to CFGBlock suggested by Jiri Slaby.
Ted Kremenek [Thu, 28 Apr 2011 06:19:35 +0000 (06:19 +0000)]
Add comment to CFGBlock suggested by Jiri Slaby.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130387 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate r130381 to check for UO_AddrOf.
Francois Pichet [Thu, 28 Apr 2011 05:12:34 +0000 (05:12 +0000)]
Update r130381 to check for UO_AddrOf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130384 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance clang_getCXTUResourceUsage() to report the amount of memory used by ASTContex...
Ted Kremenek [Thu, 28 Apr 2011 04:53:38 +0000 (04:53 +0000)]
Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ASTContext's side tables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130383 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSupport &__uuidof(type) as a non type template argument.
Francois Pichet [Thu, 28 Apr 2011 04:39:50 +0000 (04:39 +0000)]
Support &__uuidof(type) as a non type template argument.
This idiom is used everywhere in MFC/COM code and as such this patch removes hundreds of errors when parsing MFC code with clang.

Example:
template <class T, const GUID* g = &__uuidof(T)>
class ComTemplate  { };

typedef ComTemplate<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE;

Of course this is just parsing support. Trying to use this in CodeGen will generate:
error: cannot yet mangle expression type CXXUuidofExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130381 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance clang_getCXTUResourceUsage() to report the amount of memory used by SourceMan...
Ted Kremenek [Thu, 28 Apr 2011 04:10:31 +0000 (04:10 +0000)]
Enhance clang_getCXTUResourceUsage() to report the amount of memory used by SourceManager's content cache allocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130380 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSEH was crashing under -fms-extensions.
Francois Pichet [Thu, 28 Apr 2011 03:14:31 +0000 (03:14 +0000)]
SEH was crashing under -fms-extensions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130377 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the mangling for non-ADL call expressions that we just
John McCall [Thu, 28 Apr 2011 02:52:03 +0000 (02:52 +0000)]
Implement the mangling for non-ADL call expressions that we just
worked out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130376 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen block-capturing a variable with a non-trivial destructor,
John McCall [Thu, 28 Apr 2011 02:15:35 +0000 (02:15 +0000)]
When block-capturing a variable with a non-trivial destructor,
make sure to mark the destructor.  This normally isn't required,
because the destructor should have been marked as part of the
declaration of the local, but it's necessary when the variable
is a parameter because it's the call sites that are responsible
for those destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130372 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoA few corrections to type traits that missed the last checkin
John Wiegley [Thu, 28 Apr 2011 02:06:46 +0000 (02:06 +0000)]
A few corrections to type traits that missed the last checkin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130371 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBecause of r130359 this test no longer fail on Windows.
Francois Pichet [Thu, 28 Apr 2011 02:01:57 +0000 (02:01 +0000)]
Because of r130359 this test no longer fail on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130370 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines...
Francois Pichet [Thu, 28 Apr 2011 01:59:37 +0000 (01:59 +0000)]
Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines to real types.

Otherwise statements like:
  __int64 var = __int64(0);

would be expanded to:
  long long var = long long(0);

and fail to compile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130369 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoConvert assertion in memset checking to a runtime check (because real code may provid...
Ted Kremenek [Thu, 28 Apr 2011 01:38:02 +0000 (01:38 +0000)]
Convert assertion in memset checking to a runtime check (because real code may provide a deviant definition of memset).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130368 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemoved test that depended on ast-test
John Wiegley [Thu, 28 Apr 2011 01:09:13 +0000 (01:09 +0000)]
Removed test that depended on ast-test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130367 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoParsing/AST support for Structured Exception Handling
John Wiegley [Thu, 28 Apr 2011 01:08:34 +0000 (01:08 +0000)]
Parsing/AST support for Structured Exception Handling

Patch authored by Sohail Somani.

Provide parsing and AST support for Windows structured exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130366 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore cleanup of template argument deduction and its handling of
Douglas Gregor [Thu, 28 Apr 2011 00:56:09 +0000 (00:56 +0000)]
More cleanup of template argument deduction and its handling of
non-CVR qualifiers. We can now properly match address-space--qualified
references during template argument deduction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130365 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix modified-header-crash.c for read-only source trees
Matt Beaumont-Gay [Thu, 28 Apr 2011 00:23:49 +0000 (00:23 +0000)]
Fix modified-header-crash.c for read-only source trees

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130359 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplementation of Embarcadero array type traits
John Wiegley [Thu, 28 Apr 2011 00:16:57 +0000 (00:16 +0000)]
Implementation of Embarcadero array type traits

Patch authored by John Wiegley.

These are array type traits used for parsing code that employs certain
features of the Embarcadero C++ compiler: __array_rank(T) and
__array_extent(T, Dim).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130351 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate regex in scan-build for parsing statistics.
Ted Kremenek [Wed, 27 Apr 2011 23:43:27 +0000 (23:43 +0000)]
Update regex in scan-build for parsing statistics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130347 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up the handling of non-CVR qualifiers in template argument
Douglas Gregor [Wed, 27 Apr 2011 23:34:22 +0000 (23:34 +0000)]
Clean up the handling of non-CVR qualifiers in template argument
deduction. The good news is that address spaces are a lot less broken
in this regard than I'd expected.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130346 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agot/clang/type-traits
John Wiegley [Wed, 27 Apr 2011 23:09:49 +0000 (23:09 +0000)]
t/clang/type-traits

Patch authored by John Wiegley.

These type traits are used for parsing code that employs certain features of
the Embarcadero C++ compiler.  Several of these constructs are also desired by
libc++, according to its project pages (such as __is_standard_layout).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130342 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove unused method CFGBlock::hasBinaryBranchTerminator().
Ted Kremenek [Wed, 27 Apr 2011 22:16:58 +0000 (22:16 +0000)]
Remove unused method CFGBlock::hasBinaryBranchTerminator().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130336 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't print fixits for format specifiers in cases where the fixit does not actually...
Eli Friedman [Wed, 27 Apr 2011 22:06:20 +0000 (22:06 +0000)]
Don't print fixits for format specifiers in cases where the fixit does not actually fix the warning. PR8781.

I'm not sure what the preferred way to write a test for whether a fixit is emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130335 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate scan-build to '-analyzer-checker debug.Stats' instead of the old '-analyzer...
Ted Kremenek [Wed, 27 Apr 2011 18:53:08 +0000 (18:53 +0000)]
Update scan-build to '-analyzer-checker debug.Stats' instead of the old '-analyzer-stats' -cc1 argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130320 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHeh, funny thing, 'void' isn't a POD type. Nice of us to suggest it to
Chandler Carruth [Wed, 27 Apr 2011 18:48:59 +0000 (18:48 +0000)]
Heh, funny thing, 'void' isn't a POD type. Nice of us to suggest it to
silence this warning. ;]

Fixed that obvious bug and added a bit more testing as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130318 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRe-enable byval for ARM in clang. rdar://problem/7662569
Stuart Hastings [Wed, 27 Apr 2011 17:24:02 +0000 (17:24 +0000)]
Re-enable byval for ARM in clang.  rdar://problem/7662569

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130312 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSome refactoring of my ms_struct patch.
Fariborz Jahanian [Wed, 27 Apr 2011 17:14:21 +0000 (17:14 +0000)]
Some refactoring of my ms_struct patch.
// rdar://8823265 related.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130311 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen printing a base-specifier, print the ellipsis ("...") if it is a
Douglas Gregor [Wed, 27 Apr 2011 17:07:55 +0000 (17:07 +0000)]
When printing a base-specifier, print the ellipsis ("...") if it is a
pack expansion. Fixes PR9452.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130310 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoASTImporter support for NestedNameSpecifier, from Olaf Krzikalla
Douglas Gregor [Wed, 27 Apr 2011 16:48:40 +0000 (16:48 +0000)]
ASTImporter support for NestedNameSpecifier, from Olaf Krzikalla

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130307 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis is the next step in building the standalone tools infrastructure:
Manuel Klimek [Wed, 27 Apr 2011 16:39:14 +0000 (16:39 +0000)]
This is the next step in building the standalone tools infrastructure:
This patch simplifies writing of standalone Clang tools. As an
example, we add clang-check, a tool that runs a syntax only frontend
action over a .cc file. When you integrate this into your favorite
editor, you get much faster feedback on your compilation errors, thus
reducing your feedback cycle especially when writing new code.

The tool depends on integration of an outstanding patch to CMake to
work which allows you to always have a current compile command
database in your cmake output directory when you set
CMAKE_EXPORT_COMPILE_COMMANDS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130306 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore accurately model realloc() when the size argument is 0. realloc() with a size...
Lenny Maiorani [Wed, 27 Apr 2011 14:49:29 +0000 (14:49 +0000)]
More accurately model realloc() when the size argument is 0. realloc() with a size of 0 is equivalent to free(). The memory region should be marked as free and not used again.

Unit tests f2_realloc_0(), f6_realloc(), and f7_realloc() contributed by Marshall Clow <mclow.lists@gmail.com>. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130303 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a warning (-Wnon-pod-memset) for calls to memset() with
Chandler Carruth [Wed, 27 Apr 2011 07:05:31 +0000 (07:05 +0000)]
Add a warning (-Wnon-pod-memset) for calls to memset() with
a destination pointer that points to a non-POD type. This can flag such
horrible bugs as overwriting vptrs when a previously POD structure is
suddenly given a virtual method, or creating objects that crash on
practically any use by zero-ing out a member when its changed from
a const char* to a std::string, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130299 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose attempts to implicitly instantiate a template before it is
John McCall [Wed, 27 Apr 2011 06:46:31 +0000 (06:46 +0000)]
Diagnose attempts to implicitly instantiate a template before it is
fully defined.  Somehow this escaped notice for a very long time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130298 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a new parser annotation token for primary expressions. When
Douglas Gregor [Wed, 27 Apr 2011 06:18:01 +0000 (06:18 +0000)]
Introduce a new parser annotation token for primary expressions. When
ClassifyName() builds a primary expression, generate one of these
annotation tokens rather than jumping into the parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130297 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove this assert, I don't think it's being helpful and people have
Eric Christopher [Wed, 27 Apr 2011 05:48:06 +0000 (05:48 +0000)]
Remove this assert, I don't think it's being helpful and people have
been running into it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130296 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean out some cruft I introduced when adding Sema::ClassifyName()
Douglas Gregor [Wed, 27 Apr 2011 05:44:51 +0000 (05:44 +0000)]
Clean out some cruft I introduced when adding Sema::ClassifyName()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130295 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify the parser's handling of Sema::ClassifyName() for types, by
Douglas Gregor [Wed, 27 Apr 2011 05:41:15 +0000 (05:41 +0000)]
Simplify the parser's handling of Sema::ClassifyName() for types, by
creating a type-annotation token rather than jumping into the
declaration parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130293 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAllow 'Environment::getSVal()' to allow an optional way for checkers to do a direct...
Ted Kremenek [Wed, 27 Apr 2011 05:34:09 +0000 (05:34 +0000)]
Allow 'Environment::getSVal()' to allow an optional way for checkers to do a direct lookup to values bound to expressions, without
resulting to lazy logic.  This is critical for the OSAtomicChecker that does a simulated load on any arbitrary expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130292 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd the test that I intended to submit with r130055, but forgot to add.
Chandler Carruth [Wed, 27 Apr 2011 05:25:42 +0000 (05:25 +0000)]
Add the test that I intended to submit with r130055, but forgot to add.
Apologies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130291 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for Microsoft __interface keyword. An __interface class is basically...
Francois Pichet [Wed, 27 Apr 2011 05:07:51 +0000 (05:07 +0000)]
Add support for Microsoft __interface keyword. An __interface class is basically a normal class containing just pure virtual functions. No urgency to enforce that restriction in clang for now, so make __interface an "class" alias.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130290 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIf a null statement was preceded by an empty macro keep its instantiation source...
Argyrios Kyrtzidis [Wed, 27 Apr 2011 05:04:02 +0000 (05:04 +0000)]
If a null statement was preceded by an empty macro keep its instantiation source location
in NullStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130289 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExtend Sema::ClassifyName() to support C++, ironing out a few issues
Douglas Gregor [Wed, 27 Apr 2011 04:48:22 +0000 (04:48 +0000)]
Extend Sema::ClassifyName() to support C++, ironing out a few issues
in the classification of template names and using declarations. We now
properly typo-correct the leading identifiers in statements to types,
templates, values, etc. As an added bonus, this reduces the number of
lookups required for disambiguation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130288 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen compiling with -fno-threadsafe-statics, guard variables for globals with interna...
Anders Carlsson [Wed, 27 Apr 2011 04:37:08 +0000 (04:37 +0000)]
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

13 years agoFix test
Douglas Gregor [Wed, 27 Apr 2011 04:02:56 +0000 (04:02 +0000)]
Fix test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130285 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImprove diagnostics for typo correction via Sema::ClassifyName(), by
Douglas Gregor [Wed, 27 Apr 2011 03:47:06 +0000 (03:47 +0000)]
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

13 years agoAdd triple in the hope of unbreaking the bubuildbot
Douglas Gregor [Wed, 27 Apr 2011 03:24:57 +0000 (03:24 +0000)]
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

13 years agoFixOverloadedFunctionReference needs to rebuild member accesses of
John McCall [Wed, 27 Apr 2011 00:36:17 +0000 (00:36 +0000)]
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

13 years agoWhen comparing Objective-C pointers during overload resolution to
Douglas Gregor [Wed, 27 Apr 2011 00:01:52 +0000 (00:01 +0000)]
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

13 years agoWith ms_struct attribut, Zero-length bitfields following
Fariborz Jahanian [Tue, 26 Apr 2011 23:52:16 +0000 (23:52 +0000)]
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

13 years agoWhen computing Objective-C pointer conversions in C++, retain
Douglas Gregor [Tue, 26 Apr 2011 23:16:46 +0000 (23:16 +0000)]
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

13 years agoTo be able to replay compilations we need to accurately remodel how
Manuel Klimek [Tue, 26 Apr 2011 21:50:03 +0000 (21:50 +0000)]
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

13 years agoWe need pointer size in bits here.
Devang Patel [Tue, 26 Apr 2011 21:16:49 +0000 (21:16 +0000)]
We need pointer size in bits here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130244 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGcc pads the size of an array using the alignment of its elements.
Argyrios Kyrtzidis [Tue, 26 Apr 2011 21:05:39 +0000 (21:05 +0000)]
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

13 years agoMake yet another placeholder type, this one marking that an expression is a bound
John McCall [Tue, 26 Apr 2011 20:42:42 +0000 (20:42 +0000)]
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

13 years agoIRgen/Darwin: Fix refacto introduced in Triple changes.
Daniel Dunbar [Tue, 26 Apr 2011 19:43:00 +0000 (19:43 +0000)]
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

13 years agoAdd ms_struct attribute on record typee
Fariborz Jahanian [Tue, 26 Apr 2011 17:54:40 +0000 (17:54 +0000)]
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

13 years agoEmit a -Wnull-dereference warning for "*null" not just "*null = something". Addresses...
Argyrios Kyrtzidis [Tue, 26 Apr 2011 17:41:22 +0000 (17:41 +0000)]
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

13 years agoDisable a test that fails on windows; for some reason we don't detect that the header...
Argyrios Kyrtzidis [Tue, 26 Apr 2011 16:49:25 +0000 (16:49 +0000)]
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

13 years agoinclude/clang/AST/StmtIterator.h: std::pair should be provided by <utility>. libcxx...
NAKAMURA Takumi [Tue, 26 Apr 2011 03:17:13 +0000 (03:17 +0000)]
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

13 years agoTemporarily revert r130176, it appears to have broken a few tests.
Eric Christopher [Tue, 26 Apr 2011 01:02:04 +0000 (01:02 +0000)]
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

13 years agoEmit intrinsic at current insert point, not at the end of current block.
Devang Patel [Mon, 25 Apr 2011 23:52:27 +0000 (23:52 +0000)]
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

13 years agoTurn on byval parameters in Clang for ARM APCS. rdar://problem/7662569
Stuart Hastings [Mon, 25 Apr 2011 23:48:12 +0000 (23:48 +0000)]
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

13 years agoSimplify. There is no need to have a method to just call another method.
Devang Patel [Mon, 25 Apr 2011 23:43:36 +0000 (23:43 +0000)]
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

13 years agoGeneralize case for built-in expressions having
Fariborz Jahanian [Mon, 25 Apr 2011 23:10:07 +0000 (23:10 +0000)]
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

13 years agoFor the warnings related to -Wparentheses, display first the note about how to silenc...
Argyrios Kyrtzidis [Mon, 25 Apr 2011 23:01:29 +0000 (23:01 +0000)]
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

13 years agoRe-enable disable free optimization where the FrontendAction is not freed when -disab...
Ted Kremenek [Mon, 25 Apr 2011 22:57:55 +0000 (22:57 +0000)]
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

13 years agoWhen generating printf fixits, preserve the original formating for unsigned integers...
Ted Kremenek [Mon, 25 Apr 2011 22:32:59 +0000 (22:32 +0000)]
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

13 years agoIr-gen the side-effect(s) when __builtin_expect is
Fariborz Jahanian [Mon, 25 Apr 2011 22:30:02 +0000 (22:30 +0000)]
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

13 years agoFix a crash when ASTReader emits diagnostic when another one is in flight. Fixes...
Argyrios Kyrtzidis [Mon, 25 Apr 2011 22:23:56 +0000 (22:23 +0000)]
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

13 years agoImplements the strncmp() checker just like the strcmp() checker, but with bounds...
Lenny Maiorani [Mon, 25 Apr 2011 22:21:00 +0000 (22:21 +0000)]
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

13 years ago'extern' variables in functions don't shadow externs in global scope. Fixes rdar...
Argyrios Kyrtzidis [Mon, 25 Apr 2011 21:39:50 +0000 (21:39 +0000)]
'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

13 years agoAdd libstdc++ search paths for GCC 4.6.0 on Arch Linux. Patch by Jakub Wieczorek.
Nico Weber [Mon, 25 Apr 2011 20:59:30 +0000 (20:59 +0000)]
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

13 years agoDriver: When compilation fails, don't try to remove output files we don't have
Daniel Dunbar [Mon, 25 Apr 2011 20:43:05 +0000 (20:43 +0000)]
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

13 years agodon't use compound literals in MM macros, since they will be instantiated
Chris Lattner [Mon, 25 Apr 2011 20:42:40 +0000 (20:42 +0000)]
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

13 years agofix PR9474, a crash with -fshort-enum and C++ templates: when instantiating
Chris Lattner [Mon, 25 Apr 2011 20:37:58 +0000 (20:37 +0000)]
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

13 years agoRecognize gcc's ms_struct pragma (and ignore for now).
Fariborz Jahanian [Mon, 25 Apr 2011 18:49:15 +0000 (18:49 +0000)]
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

13 years agoMinor tweak to avoid having to dig through canonical types multiple times when checki...
Douglas Gregor [Mon, 25 Apr 2011 18:40:17 +0000 (18:40 +0000)]
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

13 years agoAdd Windows SEH keywords.
Francois Pichet [Mon, 25 Apr 2011 17:23:15 +0000 (17:23 +0000)]
Add Windows SEH keywords.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130132 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen Sema::ClassifyName() finds an invalid ivar reference, return an
Douglas Gregor [Mon, 25 Apr 2011 15:05:41 +0000 (15:05 +0000)]
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

13 years agoRemove some more hard CR-LF lines. These were particularly weird as they were
Chandler Carruth [Mon, 25 Apr 2011 07:09:43 +0000 (07:09 +0000)]
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

13 years agoSet the native EOL property on this now that I've fixed it. Fixing some other
Chandler Carruth [Mon, 25 Apr 2011 06:55:34 +0000 (06:55 +0000)]
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

13 years agot/clang/expr-traits
John Wiegley [Mon, 25 Apr 2011 06:54:41 +0000 (06:54 +0000)]
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

13 years agoRemove hard coded dos line endings, let subversion translate them on
Chandler Carruth [Mon, 25 Apr 2011 06:34:35 +0000 (06:34 +0000)]
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

13 years agoLet clang detect gcc triple on Ubuntu Natty. Patch by Thomas Jablin.
Nico Weber [Mon, 25 Apr 2011 03:17:35 +0000 (03:17 +0000)]
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

13 years agoMissing bit of r130117.
Eli Friedman [Sun, 24 Apr 2011 22:31:41 +0000 (22:31 +0000)]
Missing bit of r130117.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130118 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPR4304: Add warning for designators in strict c89 mode.
Eli Friedman [Sun, 24 Apr 2011 22:14:22 +0000 (22:14 +0000)]
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

13 years agoUse template magic to make dumping of vectors slightly less fragile.
Benjamin Kramer [Sun, 24 Apr 2011 17:44:50 +0000 (17:44 +0000)]
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

13 years agoConvert size and alignment variables to CharUnits in EmitAggregateCopy(). No
Ken Dyck [Sun, 24 Apr 2011 17:37:26 +0000 (17:37 +0000)]
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

13 years agoConvert type size and alignment to CharUnits in CheckAggExprForMemSetUse().
Ken Dyck [Sun, 24 Apr 2011 17:25:32 +0000 (17:25 +0000)]
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

13 years agoConvert the return type of GetNumNonZeroBytesInInit() to CharUnits. No
Ken Dyck [Sun, 24 Apr 2011 17:17:56 +0000 (17:17 +0000)]
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

13 years agoEliminate some literal 8s by converting size variables in EmitGCMove() and
Ken Dyck [Sun, 24 Apr 2011 17:08:00 +0000 (17:08 +0000)]
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