]> granicus.if.org Git - clang/log
clang
12 years agoNicer display of unprintable source, and fix caret display for non-ascii text
Seth Cantrell [Wed, 18 Apr 2012 02:44:46 +0000 (02:44 +0000)]
Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

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

12 years agoCalling setVisibility directly only makes (some) sense when the visibility is
Rafael Espindola [Wed, 18 Apr 2012 00:14:58 +0000 (00:14 +0000)]
Calling setVisibility directly only makes (some) sense when the visibility is
explicit.

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

12 years agoPR12569: Instantiate exception specifications of explicit instantiations
Richard Smith [Tue, 17 Apr 2012 22:30:01 +0000 (22:30 +0000)]
PR12569: Instantiate exception specifications of explicit instantiations
and explicit specializations of function templates appropriately.

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

12 years agoRevert "Nicer display of unprintable source, and fix caret display for non-ascii...
Seth Cantrell [Tue, 17 Apr 2012 20:59:59 +0000 (20:59 +0000)]
Revert "Nicer display of unprintable source, and fix caret display for non-ascii text"

This reverts commit e9a3b76ba589a8a884e978273beaed0d97cf9861.

Revert "fix display of source lines with null characters"

This reverts commit 70712b276e40bbe11e5063dfc7e82ce3209929cd.

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

12 years agoadd missing parameter index to diag
Matt Beaumont-Gay [Tue, 17 Apr 2012 20:36:24 +0000 (20:36 +0000)]
add missing parameter index to diag

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

12 years agofix display of source lines with null characters
Seth Cantrell [Tue, 17 Apr 2012 20:06:06 +0000 (20:06 +0000)]
fix display of source lines with null characters

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

12 years agoNicer display of unprintable source, and fix caret display for non-ascii text
Seth Cantrell [Tue, 17 Apr 2012 20:06:03 +0000 (20:06 +0000)]
Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

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

12 years agoSimplify calls to mergeVisibility* by passing in the LinkageInfo. No
Rafael Espindola [Tue, 17 Apr 2012 18:47:20 +0000 (18:47 +0000)]
Simplify calls to mergeVisibility* by passing in the LinkageInfo. No
functionality change.

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

12 years agoobjective-c modern translation. Correct rewriting of
Fariborz Jahanian [Tue, 17 Apr 2012 18:40:53 +0000 (18:40 +0000)]
objective-c modern translation. Correct rewriting of
block meta-data of block literals declared inside
of extern "C" functions.
// rdar://1131490

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

12 years agoTypo fix.
Sirish Pande [Tue, 17 Apr 2012 18:22:48 +0000 (18:22 +0000)]
Typo fix.

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

12 years agoSwitches the JSONCompilationDatabase to use the YAML parser.
Manuel Klimek [Tue, 17 Apr 2012 16:54:26 +0000 (16:54 +0000)]
Switches the JSONCompilationDatabase to use the YAML parser.
This will allow us to delete the JSON parser from llvm.

The biggest change is a general change of strategy - instead
of storing StringRef's to the values for the command line and
directory in the input buffer, we store ScalarNode*'s. The
reason is that the YAML parser's getRawValue on ScalarNodes
returns a string that includes the quotes in case of double
quoted strings.

For the same reason we're removing the JSON parsing part of
the command line parsing - this means an extra copy for a
command line when it is requested (and only when it is requested).

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

12 years agoFix to avoid warning. Also add header, and lincense information.
Sirish Pande [Tue, 17 Apr 2012 16:39:11 +0000 (16:39 +0000)]
Fix to avoid warning. Also add header, and lincense information.

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

12 years agoEmulate a MSVC bug where the creation of pointer-to-member to protected member of...
Francois Pichet [Tue, 17 Apr 2012 12:35:05 +0000 (12:35 +0000)]
Emulate a MSVC bug where the creation of pointer-to-member to protected member of base class is allowed but only from a static function.

This fixes a regression when parsing MFC code with clang.

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

12 years agofix a typo
Gabor Greif [Tue, 17 Apr 2012 11:16:26 +0000 (11:16 +0000)]
fix a typo

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

12 years agoConvert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. Unfortuna...
Craig Topper [Tue, 17 Apr 2012 05:16:56 +0000 (05:16 +0000)]
Convert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. Unfortunately, these instructions have behavior that can't be modeled with shuffle vector.

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

12 years agoAttempt to fix test.
Eli Friedman [Tue, 17 Apr 2012 01:57:28 +0000 (01:57 +0000)]
Attempt to fix test.

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

12 years agoChange ExprEngine::shouldInlineDecl() to be defensive in checking if the CFG of the...
Ted Kremenek [Tue, 17 Apr 2012 01:36:03 +0000 (01:36 +0000)]
Change ExprEngine::shouldInlineDecl() to be defensive in checking if the CFG of the callee is valid.  Fixes <rdar://problem/11257631>.

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

12 years agoFix case where the alignment is overaligned, per Eli's suggestion.
Chad Rosier [Tue, 17 Apr 2012 01:14:29 +0000 (01:14 +0000)]
Fix case where the alignment is overaligned, per Eli's suggestion.
rdar://11220251

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

12 years agoLink to a tiny patch to libstdc++-4.7 to work around the <chrono> issues
Richard Smith [Tue, 17 Apr 2012 01:04:22 +0000 (01:04 +0000)]
Link to a tiny patch to libstdc++-4.7 to work around the <chrono> issues
from the C++ status page.

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

12 years agoImplement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.
Richard Smith [Tue, 17 Apr 2012 00:58:00 +0000 (00:58 +0000)]
Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.

We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.

When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.

Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.

Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.

This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.

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

12 years agoMake sure EmitMoveFromReturnSlot is passing the correct alignment to
Chad Rosier [Tue, 17 Apr 2012 00:35:38 +0000 (00:35 +0000)]
Make sure EmitMoveFromReturnSlot is passing the correct alignment to
EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment).
rdar://11220251

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

12 years agoTypo.
Eric Christopher [Mon, 16 Apr 2012 23:55:04 +0000 (23:55 +0000)]
Typo.

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

12 years agoModern objective-c translator:'self' used inside
Fariborz Jahanian [Mon, 16 Apr 2012 23:00:57 +0000 (23:00 +0000)]
Modern objective-c translator:'self' used inside
block literal is imported. // rdar://11259664

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

12 years ago[libclang] Make sure that when we have multiple @class references in the same line,
Argyrios Kyrtzidis [Mon, 16 Apr 2012 22:42:01 +0000 (22:42 +0000)]
[libclang] Make sure that when we have multiple @class references in the same line,
that later ones do not override the previous ones.

If we have:
   @class Foo, Bar;
source ranges for both start at '@', so 'Bar' will end up overriding
'Foo' even though the cursor location was at 'Foo'.

rdar://11257578

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

12 years agomodern objective-c translator: translation of implicit
Fariborz Jahanian [Mon, 16 Apr 2012 22:14:01 +0000 (22:14 +0000)]
modern objective-c translator: translation of implicit
cast to/from block pointer types. // rdar://11202764
Also, many more modern translator tests.

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

12 years ago[analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).
Anna Zaks [Mon, 16 Apr 2012 21:51:09 +0000 (21:51 +0000)]
[analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).
Along with it, fix a couple of other corner cases and add more tests.

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

12 years ago[analyzer] +comments
Anna Zaks [Mon, 16 Apr 2012 21:51:06 +0000 (21:51 +0000)]
[analyzer] +comments

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

12 years ago[analyzer] Fixup for a test case.
Anna Zaks [Mon, 16 Apr 2012 21:51:03 +0000 (21:51 +0000)]
[analyzer] Fixup for a test case.

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

12 years agoobjective-c modern translator: buildit objc bool
Fariborz Jahanian [Mon, 16 Apr 2012 21:03:30 +0000 (21:03 +0000)]
objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426.

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

12 years ago[libclang] Spelling range for a objc category should the category name range, not...
Argyrios Kyrtzidis [Mon, 16 Apr 2012 20:01:28 +0000 (20:01 +0000)]
[libclang] Spelling range for a objc category should the category name range, not the class one.

rdar://11249386

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

12 years agoRemove support for -fast-math metadata for the moment.
Duncan Sands [Mon, 16 Apr 2012 19:40:49 +0000 (19:40 +0000)]
Remove support for -fast-math metadata for the moment.

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

12 years agoPer Richard's comments on r154794, add the checks necessary to handle constant-foldin...
Eli Friedman [Mon, 16 Apr 2012 19:23:57 +0000 (19:23 +0000)]
Per Richard's comments on r154794, add the checks necessary to handle constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent.

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

12 years agoRevert r154749 for now at John McCall's request.
Rafael Espindola [Mon, 16 Apr 2012 18:46:26 +0000 (18:46 +0000)]
Revert r154749 for now at John McCall's request.

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

12 years agoImplement the last part of C++ [class.mem]p2, delaying the parsing of
Douglas Gregor [Mon, 16 Apr 2012 18:27:27 +0000 (18:27 +0000)]
Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.

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

12 years agoUse ordering and the explicit visibility bit instead of modifying
Rafael Espindola [Mon, 16 Apr 2012 18:25:01 +0000 (18:25 +0000)]
Use ordering and the explicit visibility bit instead of modifying
ConsiderGlobalVisibility. No functionality change.

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

12 years agoReadd lost "undef BUILTIN" to fix the build.
David Blaikie [Mon, 16 Apr 2012 17:57:39 +0000 (17:57 +0000)]
Readd lost "undef BUILTIN" to fix the build.

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

12 years agoGenerate fpmath metadata when -ffast-math. Note that no optimizations are hooked
Duncan Sands [Mon, 16 Apr 2012 17:24:31 +0000 (17:24 +0000)]
Generate fpmath metadata when -ffast-math. Note that no optimizations are hooked
up to this yet.

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

12 years agoHexagon V5(Floating Point) support.
Sirish Pande [Mon, 16 Apr 2012 17:04:05 +0000 (17:04 +0000)]
Hexagon V5(Floating Point) support.

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

12 years agoRemove unused method.
Rafael Espindola [Mon, 16 Apr 2012 16:41:02 +0000 (16:41 +0000)]
Remove unused method.

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

12 years agoAdjust for LLVM name tweaks requested by Chandler.
Duncan Sands [Mon, 16 Apr 2012 16:29:47 +0000 (16:29 +0000)]
Adjust for LLVM name tweaks requested by Chandler.

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

12 years agoAdd another constructor to LVFlags and use it to simplify the code a bit.
Rafael Espindola [Mon, 16 Apr 2012 13:44:41 +0000 (13:44 +0000)]
Add another constructor to LVFlags and use it to simplify the code a bit.

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

12 years agoImplement C++11 [expr.prim.general]p3, which permits the use of 'this'
Douglas Gregor [Mon, 16 Apr 2012 07:05:22 +0000 (07:05 +0000)]
Implement C++11 [expr.prim.general]p3, which permits the use of 'this'
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type.

The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.

Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.

Fixes PR10036 and PR12450.

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

12 years agoAdd note to hacking.html that running the test harness directly from the command...
Eli Friedman [Mon, 16 Apr 2012 05:04:45 +0000 (05:04 +0000)]
Add note to hacking.html that running the test harness directly from the command-line requires making sure the relevant files are generated first.  Patch by Matt Fowles, with some minor modifications.

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

12 years agoMake constant evaluation for pointer comparisons work correctly for some uncommon...
Eli Friedman [Mon, 16 Apr 2012 04:30:08 +0000 (04:30 +0000)]
Make constant evaluation for pointer comparisons work correctly for some uncommon cases.  <rdar://problem/10962435>.

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

12 years agouse DEFAULT_SYSROOT
Sebastian Pop [Mon, 16 Apr 2012 04:16:43 +0000 (04:16 +0000)]
use DEFAULT_SYSROOT

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

12 years agoThe result of the Microsoft __uuidof operator must be considered a global lvalue...
Francois Pichet [Mon, 16 Apr 2012 04:08:35 +0000 (04:08 +0000)]
The result of the Microsoft __uuidof operator must be considered a global lvalue during constant expression evaluation.
Otherwise we would get this error in C++11 mode (because of a recent change):
   error: non-type template argument of type 'const _GUID *' is not a constant expression

For code like:
template <const GUID* g = &__uuidof(struct_with_uuid)>
class COM_CLASS { };

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

12 years agoPropagate alignment on lvalues through EmitLValueForField. PR12395.
Eli Friedman [Mon, 16 Apr 2012 03:54:45 +0000 (03:54 +0000)]
Propagate alignment on lvalues through EmitLValueForField.  PR12395.

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

12 years agoAdd 'env' in hopes of making this test pass on Windows.
Nick Lewycky [Mon, 16 Apr 2012 03:22:35 +0000 (03:22 +0000)]
Add 'env' in hopes of making this test pass on Windows.

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

12 years agoImplement the all_lookups_iterator for PCH as a follow-up to r153970. This
Nick Lewycky [Mon, 16 Apr 2012 02:51:46 +0000 (02:51 +0000)]
Implement the all_lookups_iterator for PCH as a follow-up to r153970. This
includes a patch from Matthias Kleine with a regression testcase!

Adds a new iterator 'data_iterator' to OnDiskHashTable which doesn't try to
reconstruct the external_key from the internal_key, which is useful for traits
that don't store enough information to do that mapping in their key. Also
deletes the 'item_iterator' from OnDiskHashTable as dead code.

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

12 years agoLike for LLVM / shlib, we also provide a SONAME to libclang.so
Sylvestre Ledru [Sun, 15 Apr 2012 23:17:25 +0000 (23:17 +0000)]
Like for LLVM / shlib, we also provide a SONAME to libclang.so

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

12 years agoChange _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use builtin_shufflevecto...
Craig Topper [Sun, 15 Apr 2012 22:18:10 +0000 (22:18 +0000)]
Change _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use builtin_shufflevector instead of specific builtins. Old builtins will be removed from llvm now that vpermq/vpermpd are supported by shuffle lowering code.

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

12 years agoFix tests that weren't actually verifying anything.
David Blaikie [Sun, 15 Apr 2012 22:09:44 +0000 (22:09 +0000)]
Fix tests that weren't actually verifying anything.

Passing -verify to clang without -cc1 or -Xclang silently passes (with a
printed warning, but lit doesn't care about that). This change adds -cc1 or,
as is necessary in one case, -Xclang to fix this so that these tests are
actually verifying as intended.

I'd like to change the driver so this kind of mistake could not be made, but
I'm not entirely sure how. Further, since the driver only warns about unknown
flags in general, we could have similar bugs with a misspellings of arguments
that would be nice to find.

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

12 years agoCorrect indentation
David Blaikie [Sun, 15 Apr 2012 21:22:10 +0000 (21:22 +0000)]
Correct indentation

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

12 years ago[clang.py] Implement TypeKind.spelling
Gregory Szorc [Sun, 15 Apr 2012 18:51:10 +0000 (18:51 +0000)]
[clang.py] Implement TypeKind.spelling

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

12 years agoUse MDBuilder to help with metadata creation.
Duncan Sands [Sun, 15 Apr 2012 18:04:54 +0000 (18:04 +0000)]
Use MDBuilder to help with metadata creation.

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

12 years agoUse forward declarations for ASTDeclContextNameLookupTable and add a missing delete.
Benjamin Kramer [Sun, 15 Apr 2012 12:36:49 +0000 (12:36 +0000)]
Use forward declarations for ASTDeclContextNameLookupTable and add a missing delete.

It would be nice to use OwningPtr here, but DeclContextInfo is stored in a DenseMap.

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

12 years agoActually, this tree isn't necessarily binary.
Benjamin Kramer [Sun, 15 Apr 2012 11:35:18 +0000 (11:35 +0000)]
Actually, this tree isn't necessarily binary.

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

12 years agoRecursively delete rewrite rope nodes when tearing down the tree.
Benjamin Kramer [Sun, 15 Apr 2012 11:09:40 +0000 (11:09 +0000)]
Recursively delete rewrite rope nodes when tearing down the tree.

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

12 years ago%clang -cc1 -> %clang_cc1
Seth Cantrell [Sun, 15 Apr 2012 04:41:49 +0000 (04:41 +0000)]
%clang -cc1 -> %clang_cc1

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

12 years agoPR12226: don't generate wrong code if a braced string literal is used to
Richard Smith [Sun, 15 Apr 2012 02:50:59 +0000 (02:50 +0000)]
PR12226: don't generate wrong code if a braced string literal is used to
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like  i8 ptrtoint ([n x i8]* @str to i8).

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

12 years agoobjective-c modern translator: Make metadata
Fariborz Jahanian [Sat, 14 Apr 2012 17:13:08 +0000 (17:13 +0000)]
objective-c modern translator: Make metadata
definition for protocols static. // rdar://11248048

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

12 years ago[analyzer] Add .cxx and .txx as known file extensions to ccc-analyzer.
Anna Zaks [Sat, 14 Apr 2012 16:30:00 +0000 (16:30 +0000)]
[analyzer]  Add .cxx and .txx as known file extensions to ccc-analyzer.

A patch by Sean McBride.

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

12 years agoConsider visibility attributes last, so that they take precedence.
Rafael Espindola [Sat, 14 Apr 2012 15:21:19 +0000 (15:21 +0000)]
Consider visibility attributes last, so that they take precedence.
I am working on a cleaner fix, but this gets the case in PR12552 passing.

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

12 years agoReplace manual delete[] with OwningArrayPtr.
Benjamin Kramer [Sat, 14 Apr 2012 14:13:43 +0000 (14:13 +0000)]
Replace manual delete[] with OwningArrayPtr.

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

12 years agoDon't leak vtable thunks.
Benjamin Kramer [Sat, 14 Apr 2012 13:21:23 +0000 (13:21 +0000)]
Don't leak vtable thunks.

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

12 years agoDelete late parsed attributes instead of leaking them.
Benjamin Kramer [Sat, 14 Apr 2012 12:44:47 +0000 (12:44 +0000)]
Delete late parsed attributes instead of leaking them.

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

12 years agoRename "fpaccuracy" metadata to the more generic "fpmath". That's because I'm
Duncan Sands [Sat, 14 Apr 2012 12:37:26 +0000 (12:37 +0000)]
Rename "fpaccuracy" metadata to the more generic "fpmath".  That's because I'm
thinking of generalizing it to be able to specify other freedoms beyond accuracy
(such as that NaN's don't have to be respected).  I'd like the 3.1 release (the
first one with this metadata) to have the more generic name already rather than
having to auto-upgrade it in 3.2.

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

12 years agoParser: Don't manage TemplateAnnotationIds in a delayed cleanup pool.
Benjamin Kramer [Sat, 14 Apr 2012 12:14:03 +0000 (12:14 +0000)]
Parser: Don't manage TemplateAnnotationIds in a delayed cleanup pool.

Instead, make it the allocation function's responsibility to add them
to a list and clear it when a top-level decl is finished.

This plugs leakage of TemplateAnnotationIds. DelayedCleanupPool is
ugly and unused, remove it.

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

12 years agoASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.
Benjamin Kramer [Sat, 14 Apr 2012 09:11:56 +0000 (09:11 +0000)]
ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.

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

12 years agoc-index-test: dispose spelling string after use.
Benjamin Kramer [Sat, 14 Apr 2012 09:11:51 +0000 (09:11 +0000)]
c-index-test: dispose spelling string after use.

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

12 years agoDirectly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of manual...
Benjamin Kramer [Sat, 14 Apr 2012 08:26:28 +0000 (08:26 +0000)]
Directly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of manual deletion.

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

12 years agoAdd an AttributedStmt type to represent a statement with C++11 attributes
Richard Smith [Sat, 14 Apr 2012 00:33:13 +0000 (00:33 +0000)]
Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!

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

12 years agoDelete the TypoResultsMap when erasing the pointer to it.
Benjamin Kramer [Fri, 13 Apr 2012 23:09:10 +0000 (23:09 +0000)]
Delete the TypoResultsMap when erasing the pointer to it.

This manual deleting is error-prone, but we can't just put an OwningPtr in a
std::map :(

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

12 years agoDon't enter cleanups for unreachable variables. It's impossible to
John McCall [Fri, 13 Apr 2012 18:44:05 +0000 (18:44 +0000)]
Don't enter cleanups for unreachable variables.  It's impossible to
jump into these scopes, and the cleanup-entering code sometimes wants
to do some operations first (e.g. a GEP), which can leave us with
unparented IR.

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

12 years agomodern objective-c translator: Fixes translation of
Fariborz Jahanian [Fri, 13 Apr 2012 18:00:54 +0000 (18:00 +0000)]
modern objective-c translator: Fixes translation of
__typeof which is a regression by reverting
r154360. // rdar://11233924

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

12 years agoAvoid string thrashing when we can concatenate them in the final buffer.
Benjamin Kramer [Fri, 13 Apr 2012 18:00:37 +0000 (18:00 +0000)]
Avoid string thrashing when we can concatenate them in the final buffer.

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

12 years agoSerialize and deserialize some missing bits from BlockDecl.
John McCall [Fri, 13 Apr 2012 17:33:29 +0000 (17:33 +0000)]
Serialize and deserialize some missing bits from BlockDecl.

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

12 years agoKill the last vestiges of clangIndex
Douglas Gregor [Fri, 13 Apr 2012 17:26:32 +0000 (17:26 +0000)]
Kill the last vestiges of clangIndex

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

12 years agoRemove clangIndex reference from clang-interpreter CMake build
Douglas Gregor [Fri, 13 Apr 2012 17:22:46 +0000 (17:22 +0000)]
Remove clangIndex reference from clang-interpreter CMake build

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

12 years agoRemove the unused, unmaintained, incomplete 'Index' library.
Douglas Gregor [Fri, 13 Apr 2012 16:31:46 +0000 (16:31 +0000)]
Remove the unused, unmaintained, incomplete 'Index' library.

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

12 years agomodern objective-c translator: When translating
Fariborz Jahanian [Fri, 13 Apr 2012 16:20:05 +0000 (16:20 +0000)]
modern objective-c translator: When translating
call to 'super' use __rw_objc_super as type of the
'super' meta-data instead of objc_super.
// rdar://11239894

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

12 years agoMake control flow more explicit for rebuilding property reference expressions without...
Douglas Gregor [Fri, 13 Apr 2012 16:05:42 +0000 (16:05 +0000)]
Make control flow more explicit for rebuilding property reference expressions without their OpaqueValueExprs

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

12 years agoRemove the -cc1-level option "-pubnames-dump". Such things should stay
Douglas Gregor [Fri, 13 Apr 2012 16:03:00 +0000 (16:03 +0000)]
Remove the -cc1-level option "-pubnames-dump". Such things should stay
out of the tree and use the tooling infrastructure.

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

12 years agosuper and class property reference expressions don't need to be
Douglas Gregor [Fri, 13 Apr 2012 15:53:08 +0000 (15:53 +0000)]
super and class property reference expressions don't need to be
rebuilt. Fixes <rdar://problem/11052352>.

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

12 years agoFirst set of tests for ARM homogenous aggregates. C only. C++ will follow.
Anton Korobeynikov [Fri, 13 Apr 2012 11:23:39 +0000 (11:23 +0000)]
First set of tests for ARM homogenous aggregates. C only. C++ will follow.

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

12 years agoStep forward with supporting of ARM homogenous aggregates:
Anton Korobeynikov [Fri, 13 Apr 2012 11:22:00 +0000 (11:22 +0000)]
Step forward with supporting of ARM homogenous aggregates:
  - Handle unions
  - Handle C++ classes

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

12 years agoImplement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
Richard Smith [Fri, 13 Apr 2012 06:31:38 +0000 (06:31 +0000)]
Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
GNU __atomic builtins.

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

12 years agoPR12500: Improve the wording of the diagnostic for a redefinition of a name
Richard Smith [Fri, 13 Apr 2012 04:07:40 +0000 (04:07 +0000)]
PR12500: Improve the wording of the diagnostic for a redefinition of a name
in the wrong namespace scope. Patch by Jonathan Sauer!

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

12 years agoSupport -Wc++98-compat-pedantic as requested:
Seth Cantrell [Fri, 13 Apr 2012 03:43:23 +0000 (03:43 +0000)]
Support -Wc++98-compat-pedantic as requested:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120409/056126.html

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

12 years agoall-std-headers.cpp: Include the C++11 headers when building with clang
Richard Smith [Fri, 13 Apr 2012 03:39:16 +0000 (03:39 +0000)]
all-std-headers.cpp: Include the C++11 headers when building with clang
in -std=gnu++11 mode.

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

12 years agoFix a trivial oversight with apple-kext static local destructors
John McCall [Fri, 13 Apr 2012 02:53:27 +0000 (02:53 +0000)]
Fix a trivial oversight with apple-kext static local destructors
and add a test case.

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

12 years agoMention atomics support in the release notes.
Richard Smith [Fri, 13 Apr 2012 01:24:35 +0000 (01:24 +0000)]
Mention atomics support in the release notes.
Thanks to Nico Weber for the suggestion.

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

12 years agoWhen we're flagging a protected scope to prevent jumps into the
John McCall [Fri, 13 Apr 2012 01:08:17 +0000 (01:08 +0000)]
When we're flagging a protected scope to prevent jumps into the
shadow of a block expression with non-trivial destructed cleanups,
we should flag that in the enclosing function, not in the block
that we're about to pop.

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

12 years agoNow that we provide sufficient support for three C11/C++11 atomics
Richard Smith [Fri, 13 Apr 2012 01:02:19 +0000 (01:02 +0000)]
Now that we provide sufficient support for three C11/C++11 atomics
implementations, mark the atomics-related parts of the C++11 status page
as done. I've not marked 'Strong Compare and Exchange' done, since although
we implement supporting builtins, we don't yet produce different code for
the weak and strong forms.

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

12 years agoC++11 no longer requires files to end with a newline
Seth Cantrell [Fri, 13 Apr 2012 01:00:34 +0000 (01:00 +0000)]
C++11 no longer requires files to end with a newline

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

12 years agoImplement the missing pieces needed to support libstdc++4.7's <atomic>:
Richard Smith [Fri, 13 Apr 2012 00:45:38 +0000 (00:45 +0000)]
Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.

Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.

Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.

Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.

With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.

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

12 years agoobjective-c modern translator: beautify rewrite of
Fariborz Jahanian [Thu, 12 Apr 2012 23:52:52 +0000 (23:52 +0000)]
objective-c modern translator: beautify rewrite of
struct __rw_objc_super; no functionality change.

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

12 years agoConfig.h: Add another definition which the Darwin build (sometimes) uses.
Daniel Dunbar [Thu, 12 Apr 2012 23:19:46 +0000 (23:19 +0000)]
Config.h: Add another definition which the Darwin build (sometimes) uses.

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

12 years agoWarn on 64-to-32 for source value of x bits where 64 >= x > 32.
David Blaikie [Thu, 12 Apr 2012 22:40:54 +0000 (22:40 +0000)]
Warn on 64-to-32 for source value of x bits where 64 >= x > 32.

The codepath already only works for source bits > target bits, it's just that
it was testing for the source expr bits to be exactly 64. This meant simple
cases (int i = x_long / 2) were missed & ended up under the general
-Wconversion warning, which a user might not have enabled.

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

12 years ago[analyzer] PCH deserialization optimization.
Anna Zaks [Thu, 12 Apr 2012 22:36:48 +0000 (22:36 +0000)]
[analyzer] PCH deserialization optimization.

We should not deserialize unused declarations from the PCH file. Achieve
this by storing the top level declarations during parsing
(HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call
graph only for those.

Tested the patch on a sample ObjC file that uses PCH. With the patch,
 the analyzes is 17.5% faster and clang consumes 40% less memory.
Got about 10% overall build/analyzes time decrease on a large Objective
C project.

A bit of CallGraph refactoring/cleanup as well..

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