Commit Graph

45563 Commits

Author SHA1 Message Date
Richard Smith 496ddcfba9 C++1y: support for 'switch' statements in constexpr functions. This is somewhat
inefficient; we perform a linear scan of switch labels to find the one matching
the condition, and then walk the body looking for that label. Both parts should
be straightforward to optimize.

llvm-svn: 181671
2013-05-12 17:32:42 +00:00
Richard Smith 9155be1e54 C++1y: provide full 'auto' return type deduction for lambda expressions. This
completes the implementation of N3638.

llvm-svn: 181669
2013-05-12 03:09:35 +00:00
Benjamin Kramer 2960dbddbb CodeGen: Refactor SetLLVMFunctionAttributesForDefinition to use an AttrBuilder.
Adding attributes to a uniqued set has become expensive, don't do it more often
than necessary. No functionality change.

llvm-svn: 181662
2013-05-11 12:45:37 +00:00
Simon Atanasyan c580b3248c [Mips] Add -mldc1-sdc1 / -mno-ldc1-sdc1 command line options.
llvm-svn: 181660
2013-05-11 06:33:44 +00:00
Richard Smith 1fa5d64b76 C++1y deduced return types: when we deduce a return type for a function which
we loaded from PCH, if we're building another PCH, create an update record to
patch the return type of the earlier declaration.

llvm-svn: 181659
2013-05-11 05:45:24 +00:00
David Blaikie 2b93c54c4a Debug Info: correct comment
Eric's code review feedback to r181644

llvm-svn: 181650
2013-05-10 23:36:06 +00:00
David Blaikie 7e4c8b0642 Debug Info: Silently accept template argument packs
We could support the GCC extension DW_TAG_GNU_template_parameter_pack if
we're feeling adventurous, at some point - but I don't think GDB's doing
anything useful with it yet anyway.

llvm-svn: 181644
2013-05-10 22:53:25 +00:00
Douglas Gregor 64a1fa5cda [Modules] Make r180934 more efficient by only loading top-level module maps in system header directories.
llvm-svn: 181643
2013-05-10 22:52:27 +00:00
Douglas Gregor 940e80502e [Modules] When things go horribly wrong when reading a module, point at the module cache.
Sometimes people hack on their system headers. In such cases, they'll
need to delete their module cache, but may not know where it is. Add a
note to show them where it is.

llvm-svn: 181638
2013-05-10 22:15:13 +00:00
Douglas Gregor d7193795bd [Modules] Extend Darwin hack to include the modification time of SystemVersion.plist.
Fixes <rdar://problem/13856838>.

llvm-svn: 181635
2013-05-10 21:54:08 +00:00
David Blaikie 38079fd26f PR14992: Debug Info: Support more non-type template parameters
* Provide DW_TAG_template_value_parameter for pointers, function
  pointers, member pointers, and member function pointers (still missing
  support for template template parameters which GCC encodes as a
  DW_TAG_GNU_template_template_param)
* Provide values for all but the (member & non-member) function pointer case.
  Simple constant integer values for member pointers (offset within the
  object) and address for the value pointer case. GCC doesn't provide a
  value for the member function pointer case so I'm not sure how, if at
  all, GDB supports encoding that. & non-member function pointers should
  follow shortly in a subsequent patch.
* Null pointer value encodings of all of these types, including
  correctly encoding null data member pointers as -1.

llvm-svn: 181634
2013-05-10 21:53:14 +00:00
Adrian Prantl 7bec903850 ObjC debug info: Substitute the class type for methods that return
a related type (e.g., if they use the instancetype keyword).

rdar://problem/13359718

llvm-svn: 181629
2013-05-10 21:08:31 +00:00
Enea Zaffanella 28f36ba693 Avoid patching storage class for block scope thread_local variables.
llvm-svn: 181627
2013-05-10 20:34:44 +00:00
Richard Smith b8a98241fc PR15966: don't get confused by a complex integer -> complex integer conversion
and misclassify it as a complex-real conversion.

llvm-svn: 181626
2013-05-10 20:29:50 +00:00
Alexander Kornienko 88a0d939de Reformat clang-format help strings, filter out irrelevant options.
Summary: +updated ClangFormat.rst

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D780

llvm-svn: 181617
2013-05-10 18:12:00 +00:00
Anna Zaks 4063fa1cdc [analyzer] Assume [NSNull null] does not return nil.
llvm-svn: 181616
2013-05-10 18:04:46 +00:00
Anna Zaks 3feb2cd5bb [analyzer] Do not check if sys/queue.h file is a system header.
In most cases it is, by just looking at the name. Also, this check prevents the heuristic from working in strange user settings.
radar://13839692

llvm-svn: 181615
2013-05-10 18:04:43 +00:00
Dmitri Gribenko 48d6daf856 Allocate memory for the new number of subexpressions. Fixup for r181572
llvm-svn: 181611
2013-05-10 17:30:13 +00:00
Jordan Rose 757fbb0b14 [analyzer] Indirect invalidation counts as an escape for leak checkers.
Consider this example:

  char *p = malloc(sizeof(char));
  systemFunction(&p);
  free(p);

In this case, when we call systemFunction, we know (because it's a system
function) that it won't free 'p'. However, we /don't/ know whether or not
it will /change/ 'p', so the analyzer is forced to invalidate 'p', wiping
out any bindings it contains. But now the malloc'd region looks like a
leak, since there are no more bindings pointing to it, and we'll get a
spurious leak warning.

The fix for this is to notice when something is becoming inaccessible due
to invalidation (i.e. an imperfect model, as opposed to being explicitly
overwritten) and stop tracking it at that point. Currently, the best way
to determine this for a call is the "indirect escape" pointer-escape kind.

In practice, all the patch does is take the "system functions don't free
memory" special case and limit it to direct parameters, i.e. just the
arguments to a call and not other regions accessible to them. This is a
conservative change that should only cause us to escape regions more
eagerly, which means fewer leak warnings.

This isn't perfect for several reasons, the main one being that this
example is treated the same as the one above:

  char **p = malloc(sizeof(char *));
  systemFunction(p + 1);
  // leak

Currently, "addresses accessible by offsets of the starting region" and
"addresses accessible through bindings of the starting region" are both
considered "indirect" regions, hence this uniform treatment.

Another issue is our longstanding problem of not distinguishing const and
non-const bindings; if in the first example systemFunction's parameter were
a char * const *, we should know that the function will not overwrite 'p',
and thus we can safely report the leak.

<rdar://problem/13758386>

llvm-svn: 181607
2013-05-10 17:07:16 +00:00
Wei Pan 655d3fa3c1 Codegen tests for captured statements with templates
Differential-revision: llvm-reviews.chandlerc.com/D778
llvm-svn: 181598
2013-05-10 14:15:18 +00:00
Daniel Jasper 66e4f83c07 When breaking at function calls, indent from function name.
Otherwise (when indenting from the wrapped -> or .), this looks
like a confusing indent.

Before:
aaaaaaa        //
    .aaaaaaa( //
        aaaaaaa);
After:
aaaaaaa        //
    .aaaaaaa( //
         aaaaaaa);

llvm-svn: 181595
2013-05-10 13:37:16 +00:00
Dmitri Gribenko be0221067d ArrayRef'ize Sema::FindAllocationFunctions
Patch by Robert Wilhelm.

llvm-svn: 181594
2013-05-10 13:22:23 +00:00
Alexander Kornienko 70f6b3b631 Updated clang-format help messages for -offset and -length
llvm-svn: 181593
2013-05-10 13:18:17 +00:00
Dmitri Gribenko 8236037d47 ArrayRef'ize GenericSelectionExpr
llvm-svn: 181592
2013-05-10 13:06:58 +00:00
Alexander Kornienko fa94cbb70f Minor clarifications in help messages and a comment.
llvm-svn: 181591
2013-05-10 13:04:20 +00:00
Daniel Jasper 1cb530f1e0 Always format entire macro definitions.
Thereby, the macro is consistently formatted (including the trailing
escaped newlines) even if clang-format is invoked only on single lines
of the macro.

llvm-svn: 181590
2013-05-10 13:00:49 +00:00
Alexander Kornienko 49149677d9 Config file support for clang-format, part 2.
Summary:
Adds actual config file reading to the clang-format utility.
Configuration file name is .clang-format. It is looked up for each input file
in its parent directories starting from immediate one. First found .clang-format
file is used. When using standard input, .clang-format is searched starting from
the current directory.
Added -dump-config option to easily create configuration files.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, jordan_rose, kimgr

Differential Revision: http://llvm-reviews.chandlerc.com/D758

llvm-svn: 181589
2013-05-10 11:56:10 +00:00
Peter Collingbourne 3154a10bcb Add caseStmt(), defaultStmt(), eachCase() and hasCaseConstant() matchers.
Differential Revision: http://llvm-reviews.chandlerc.com/D744

llvm-svn: 181588
2013-05-10 11:52:02 +00:00
Hans Wennborg 0d81e01916 Add support for __wchar_t in -fms-extensions mode.
MSVC provides __wchar_t. This is the same as the built-in wchar_t type
from C++, but it is also available with -fno-wchar and in C.

The commit changes ASTContext to have two different types for this:

  - WCharTy is the built-in type used for wchar_t in C++ and __wchar_t.

  - WideCharTy is the type of a wide character literal. In C++ this is
    the same as WCharTy, and in C  it is an integer type compatible with
    the type in <stddef.h>.

This fixes PR15815.

llvm-svn: 181587
2013-05-10 10:08:40 +00:00
Daniel Jasper 8f9624b3bc Fix bug when formatting overloaded operators.
Before, the actual operator of an overloaded operator declaration was
handled as a binary operator an thus, clang-format could not find valid
formattings for many examples, e.g.:

template <typename AAAAAAA, typename BBBBBBB>
AAAAAAA operator/(const AAAAAAA &a, BBBBBBB &b);

llvm-svn: 181585
2013-05-10 07:59:58 +00:00
Richard Smith 7500ab2464 C++1y auto return type: when a function contains no 'return' statements at all,
substitute 'void' into the return type rather than replacing it with 'void', so
that we maintain the 'auto' type sugar.

llvm-svn: 181584
2013-05-10 04:31:10 +00:00
Richard Smith 0f7f6f1abc Typo and misc comment fix.
llvm-svn: 181583
2013-05-10 02:36:35 +00:00
Argyrios Kyrtzidis 1c7455f42f [libclang] When parsing with CXTranslationUnit_ForSerialization, make sure to install the ASTWriter that we create as an ASTMutationListener.
Fixes rdar://13833268

llvm-svn: 181575
2013-05-10 01:28:51 +00:00
Dmitri Gribenko ea2d5f818b Remove redundant variable
llvm-svn: 181574
2013-05-10 01:14:26 +00:00
Dmitri Gribenko 674eaa2c88 ArrayRef'ize ShuffleVectorExpr::setExprs
But ShuffleVectorExpr should be tail-allocating the storage for expressions.

llvm-svn: 181572
2013-05-10 00:43:44 +00:00
Dmitri Gribenko 2a40f0848e ArrayRef'ize Sema::CheckMessageArgumentTypes
llvm-svn: 181571
2013-05-10 00:27:15 +00:00
Dmitri Gribenko 08c8668dbd ArrayRef'ize Sema::FindAllocationOverload
Now tests should pass.  The previous error was caused by a misplaced backing
array for MutableArrayRef that I introduced.

llvm-svn: 181570
2013-05-10 00:20:06 +00:00
Dmitri Gribenko d95656e0b5 Revert my r181563, breaks tests on buildbots
llvm-svn: 181568
2013-05-10 00:11:18 +00:00
Dmitri Gribenko 139474d498 ArrayRef'ize Sema::ActOnMemInitializer
llvm-svn: 181565
2013-05-09 23:51:52 +00:00
Dmitri Gribenko 85378316bf ArrayRef'ize Sema::FindAllocationOverload
llvm-svn: 181563
2013-05-09 23:45:53 +00:00
Dmitri Gribenko d3b75560aa ArrayRef'ize Sema::BuildCallToObjectOfClassType
llvm-svn: 181562
2013-05-09 23:32:58 +00:00
Adrian Prantl ffcf4ba947 Debug Info: Fix a problem that resulted in missing DW_AT_specifications
for C++ constructors.

If the DIType for a class was generated by
CGDebugInfo::createContextChain(), the cache contains only a
limited DIType wihtout any declarations. Since EmitFunctionStart()
needs to find the canonical declaration for each method, we
construct the complete type before emitting any method.

rdar://problem/13116508

llvm-svn: 181561
2013-05-09 23:16:27 +00:00
Richard Smith 2edd9709c6 Remove dependence on system headers from this test, to try to make the Windows bots happier.
llvm-svn: 181558
2013-05-09 22:45:27 +00:00
David Blaikie b8f6a8ab07 Debug Info: include address-of ('&') operator and qualified names in template argument lists
This fixes several (7 out of 16) cases of PR14492 in the GDB 7.5 test
suite. It seems GDB was bailing out whenever it had even the slightest
problem with the template argument list (& I assume it didn't like
seeing template value parameters that were just simple names - perhaps
assuming that lone names must be types, not values)

llvm-svn: 181556
2013-05-09 22:43:45 +00:00
David Blaikie 37f25ae3cf Fix some test cases I broke in r181552
llvm-svn: 181554
2013-05-09 22:11:34 +00:00
Richard Smith 21b3ab43e1 C++1y n3648: parse and reject init-captures for now.
llvm-svn: 181553
2013-05-09 21:36:41 +00:00
David Blaikie 8039fdf48c DebugInfo: Simply & constrain test(s) for PR9600/PR9608
Both these tests were ultimately fixed by the check for
"isIncompleteType" & neither test case was really reduced to a minimal
form. On doing so it becomes apparent that the problem wasn't specific
to templates at all, so I've moved the test case to a more appropriate
test file and added FileCheck verification to it (to show the forward
declaration of the array element type as well as the array alignment and
size being 0 since it cannot be computed). That's about as far down this
rabbithole as I'm willing to go today, so the rest of the un-FileChecked
tests in test/CodeGenCXX/debug-info.cpp will have to go another day
without actually testing anything other than the fact that they don't
crash.

& improve the actually interesting test case in
test/CodeGenCXX/debug-info-templates.cpp which was my original goal (in
preparation for expanding it/fixing some related bugs in non-type
template parameters)

llvm-svn: 181552
2013-05-09 21:32:04 +00:00
Dmitri Gribenko f4d5bee616 Documentation warning: \param, not \parm
llvm-svn: 181550
2013-05-09 21:15:22 +00:00
Reid Kleckner b0f459e8ae Add pragma-comment.c test case for r181426 that I forgot to add
llvm-svn: 181546
2013-05-09 21:10:06 +00:00
Dmitri Gribenko 9c785c217b ArrayRef'ize some SemaOverload methods
Patch by Robert Wilhelm.

llvm-svn: 181544
2013-05-09 21:02:07 +00:00
Reid Kleckner 452abac4b3 [ms-cxxabi] Implement member pointer conversions
Summary:
This only supports converting along non-virtual inheritance paths by
changing the field offset or the non-virtual base adjustment.

This implements three kinds of conversions:
- codegen for Value conversions
- Constant emission for APValue
- Constant folding for CastExprs

In almost all constant initialization settings
EmitMemberPointer(APValue) is called, except when the expression
contains a reinterpret cast.

reinterpret casts end up being a big corner case because the null value
changes between different kinds of member pointers.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D741

llvm-svn: 181543
2013-05-09 21:01:17 +00:00
David Blaikie f03b2e8385 Debug Info: Remove unnecessary check for dependent array types
This was added, untested (though the relevant crash was tested), in
r128725/PR9600. Removing it doesn't cause failures & nothing I can
imagine could cause this check to ever return 'true' (we should never be
dealing with dependent types here). The subsequent change to check
"isIncompleteType" (r128855/PR9608) makes a lot more sense.

llvm-svn: 181542
2013-05-09 20:48:12 +00:00
Ben Langmuir 0698787d19 Fix captured statements codegen test on ARM
The return type of the destructor may vary between platforms, so stop
inadvertently testing it.

llvm-svn: 181541
2013-05-09 20:42:43 +00:00
Ben Langmuir 3b4c30b7e7 CodeGen for CapturedStmts
EmitCapturedStmt creates a captured struct containing all of the captured
variables, and then emits a call to the outlined function.  This is similar in
principle to EmitBlockLiteral.

GenerateCapturedFunction actually produces the outlined function.  It is based
on GenerateBlockFunction, but is much simpler.  The function type is determined
by the parameters that are in the CapturedDecl.

Some changes have been added to this patch that were reviewed as part of the
serialization patch and moving the parameters to the captured decl.

Differential Revision: http://llvm-reviews.chandlerc.com/D640

llvm-svn: 181536
2013-05-09 19:17:11 +00:00
Richard Smith f2f6e114fd Switch C++1y paper links back to the canonical location at open-std.org now that the post-Bristol mailing has shipped.
llvm-svn: 181533
2013-05-09 18:53:17 +00:00
Richard Smith 8797d39fd9 Add testcase missed from r181527.
llvm-svn: 181531
2013-05-09 18:33:50 +00:00
Richard Smith 0646c86dcb Fix the return type of the complex creal functions. Patch by YunZhong Gao, modified to use _Static_assert and to check __STDC_HOSTED__ by me.
llvm-svn: 181527
2013-05-09 17:41:19 +00:00
David Blaikie e4a5588bcb Remove trailing whitespace
llvm-svn: 181525
2013-05-09 17:29:54 +00:00
Fariborz Jahanian 0321b8ffd6 [doc parsing]: make single character command impostures
warn in pedantic mode.

llvm-svn: 181523
2013-05-09 17:18:52 +00:00
Edwin Vane fc4f7dc0a6 Adding isConst() ASTMatcher for CXXMethodDecl nodes
Updated reference and unit tests.

llvm-svn: 181522
2013-05-09 17:00:17 +00:00
Fariborz Jahanian 395a6d4878 [doc parsing]: So, in this patch, single character
'commands' will not go through typo fixit logic,
preserving the old behavior (no typo, no diagnostics).
// rdar://12381408

llvm-svn: 181521
2013-05-09 16:44:02 +00:00
Edwin Vane c50e730d6e Updating LibASTMatchersReference to include namespaceDecl()
The namespaceDecl() ASTMatcher was added in r179027.

llvm-svn: 181519
2013-05-09 16:42:37 +00:00
Fariborz Jahanian e46dd48e9f [doc parsing]: don't attempt to fix single character
commands (\t \n are common). \\ rdar://12381408 

llvm-svn: 181517
2013-05-09 16:22:31 +00:00
Benjamin Kramer 4baf67a61b xopintrin.h: Add wrappers for all flavors of _mm_com.
GCC defines only the wrappers, MSVC defines both, we define both now too.
PR15844.

llvm-svn: 181514
2013-05-09 15:07:46 +00:00
Benjamin Kramer fd57b195a3 Add include guards to prfchwintrin.h.
llvm-svn: 181513
2013-05-09 15:07:39 +00:00
Richard Smith 7525ff67f1 Implement C++1y constant initializer rules: in a constant initializer for an
object x, x's subobjects can be constructed by constexpr constructor even if
they are of non-literal type, and can be read and written even though they're
not members of a constexpr object or temporary.

llvm-svn: 181506
2013-05-09 07:14:00 +00:00
Ted Kremenek 399980acf5 [analyzer; alternate arrows] for "loop back" edges add back the extra edge to the closing '}'
llvm-svn: 181505
2013-05-09 06:55:41 +00:00
Ted Kremenek b5999f6321 [analyzer;alternate arrows] adapt 'for' loop aesthetic cleanup to 'while' loops.
llvm-svn: 181504
2013-05-09 06:55:35 +00:00
Ted Kremenek b613dfadcb Put some diagnostics in DiagnosticCommonKinds.td in a category, mirroring what they are in other .td files.
I really dislike the copy-pasting of the category strings.  If there is a better
way to do this with TableGen, please advise.

llvm-svn: 181494
2013-05-09 00:07:27 +00:00
Nico Weber 4e8626f708 Objective-C: Correctly encode 'retain' and 'copy' for readonly properties.
clang would omit 'C' for 'copy' properties and '&' for 'retain' properties if
the property was also 'readonly'. Fix this, which makes clang match gcc4.2's
behavior.

Fixes PR15928.

llvm-svn: 181491
2013-05-08 23:47:40 +00:00
Argyrios Kyrtzidis 1054bbf08d [PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.
This made sense in pre-module era, before merging of HeaderFileInfos was introduced.

Final part of rdar://13840148.

llvm-svn: 181490
2013-05-08 23:46:55 +00:00
Argyrios Kyrtzidis 6f722b4eb9 [modules] When building a module, make sure we don't serialize out HeaderFileInfo for headers not belonging to the module.
After r180934 we may initiate module map parsing for modules not related to the module what we are building,
make sure we ignore the header file info of headers from such modules.

First part of rdar://13840148

llvm-svn: 181489
2013-05-08 23:46:46 +00:00
Fariborz Jahanian d3d3d27003 put noisy "unknown command tag name" warning
under -Wdocumentation-unknown-command and off by default.
patch by Dmitri Gribenko.

llvm-svn: 181487
2013-05-08 23:38:56 +00:00
Adrian Prantl c20237d21f typo
llvm-svn: 181485
2013-05-08 23:37:22 +00:00
Dmitri Gribenko 6c96ba2dc0 Comment: use \code...\endcode for code examples
llvm-svn: 181481
2013-05-08 23:09:44 +00:00
Dmitri Gribenko 352e81ffb5 All -Wdocumentation warnings are DefaultIgnore
llvm-svn: 181480
2013-05-08 22:54:41 +00:00
Fariborz Jahanian 7e548f70e8 unbreak buildbot.
llvm-svn: 181479
2013-05-08 22:52:20 +00:00
Fariborz Jahanian aa9b280c79 [doc parsing]: Also do typo correction for
dynamically registered commands. 
// rdar://12381408

llvm-svn: 181477
2013-05-08 22:14:28 +00:00
Eli Bendersky d142ce7068 Fix test in two ways: remove incorrect comment (the intrinsic generated now
is of the llvm.sjlj.* flavore) and convert grep->FileCheck

llvm-svn: 181468
2013-05-08 20:58:01 +00:00
Richard Smith 469a74772a Add missing triple to unit test.
llvm-svn: 181465
2013-05-08 20:32:14 +00:00
Fariborz Jahanian ebb262f79c Turn off a warning caused by my last patch.
llvm-svn: 181464
2013-05-08 20:29:57 +00:00
Fariborz Jahanian 6c7a16666d documentation parsing. Patch to do typo correction for
documentation commands. Patch was reviewed, along with
great suggestions for improvement, by Doug. 
// rdar://12381408

llvm-svn: 181458
2013-05-08 19:21:00 +00:00
Daniel Jasper 2f34cacc3b Further fix to pointer to member formatting.
With style where the *s go with the type:
Before: typedef bool* (Class:: *Member)() const;
After:  typedef bool* (Class::*Member)() const;

llvm-svn: 181439
2013-05-08 15:06:58 +00:00
Daniel Jasper cfda517ea8 Fix formatting of pointers to members.
Before: int(S::*func)(void *);
After:  int (S::*func)(void *);
llvm-svn: 181438
2013-05-08 14:58:20 +00:00
Reid Kleckner 78fb10f194 Document Clang's support for #pragma comment(lib/linker) with -fms-extensions
As suggested by Dmitri Gribenko.

llvm-svn: 181433
2013-05-08 14:40:51 +00:00
Daniel Jasper d69fc77b9e Improve line breaking in binary expressions.
If the LHS of a binary expression is broken, clang-format should also
break after the operator as otherwise:
- The RHS can be easy to miss
- It can look as if clang-format doesn't understand operator precedence

Before:
bool aaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !=
                                 bbbbbbbbbbbbbbbbbb && ccccccccc == ddddddddddd;
After:
bool aaaaaaaaaaaaaaaaaaaaa =
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbb &&
    ccccccccc == ddddddddddd;

As an additional note, clang-format would also be ok with the following
formatting, it just has a higher penalty (IMO correctly so).
bool aaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !=
                                 bbbbbbbbbbbbbbbbbb &&
                             ccccccccc == ddddddddddd;

llvm-svn: 181430
2013-05-08 14:12:04 +00:00
Reid Kleckner e43f0fea15 Forward #pragma comment(lib/linker) through as flags metadata
Summary:
Most of this change is wiring the pragma all the way through from the
lexer, parser, and sema to codegen.  I considered adding a Decl AST node
for this, but it seemed too heavyweight.

Mach-O already uses a metadata flag called "Linker Options" to do this
kind of auto-linking.  This change follows that pattern.

LLVM knows how to forward the "Linker Options" metadata into the COFF
.drectve section where these flags belong.  ELF support is not
implemented, but possible.

This is related to auto-linking, which is http://llvm.org/PR13016.

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D723

llvm-svn: 181426
2013-05-08 13:44:39 +00:00
Daniel Jasper 0f0234e16e Change indentation of multi-line nested name specifiers.
Before:
aaaaaaaa::
    aaaaaaaa::
    aaaaaaaa();
After:
aaaaaaaa::
    aaaaaaaa::
        aaaaaaaa();

The reason for the change is that:
a) we are not sure which is better
b) it is a really rare edge case
c) it simplifies the code
d) it currently causes problems with memoization

llvm-svn: 181421
2013-05-08 10:00:18 +00:00
Timur Iskhodzhanov bb5a17e8fa Fix one FIXME in VTableBuilder
llvm-svn: 181396
2013-05-08 08:09:21 +00:00
David Blaikie b0b645cad1 Debug Info: Using declarations/DW_TAG_imported_declaration of variables, types, and functions.
Basic support is implemented here - it still doesn't account for
declared-but-not-defined variables or functions. It cannot handle out of
order (declared, 'using', then defined) cases for variables, but can
handle that for functions (& can handle declared, 'using'd, and not
defined at all cases for types).

llvm-svn: 181393
2013-05-08 06:01:46 +00:00
John McCall 1b4259b53b In block enum-return inference, don't die on loads of enum lvalues.
More of rdar://13200889.

llvm-svn: 181390
2013-05-08 03:34:22 +00:00
Richard Smith 220dd33446 Add test forgotten in r181388.
llvm-svn: 181389
2013-05-08 02:38:36 +00:00
Richard Smith a3d3bd215b C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
llvm-svn: 181388
2013-05-08 02:12:03 +00:00
Ted Kremenek cba4a0c593 [analyzer; alternate edges] insert an extra edge for 'for' statements to conditions.
llvm-svn: 181385
2013-05-08 01:15:24 +00:00
Ted Kremenek 0e84ac83eb [analyzer;alternate edges] edges from subexpressions of "?:" are important to retain
llvm-svn: 181384
2013-05-08 01:15:20 +00:00
Richard Smith 861b5b5aed C++1y constant expression evaluation: compound assignment support for floating-point and pointer types.
llvm-svn: 181376
2013-05-07 23:34:45 +00:00
Adrian Prantl 8f1fb6f03d The style guide prefers preincrement expressions :-)
llvm-svn: 181373
2013-05-07 22:41:09 +00:00
Adrian Prantl 95652c7ccb remove commented out code.
llvm-svn: 181372
2013-05-07 22:26:03 +00:00
Nick Lewycky d1b0df46f5 When typo correction produces an overloaded result when looking up a member,
return all the overloads instead of just picking the first possible declaration.
This removes an invalid note (and on occasion other invalid diagnostics) and
also makes clang's parsing recovery behave as if the text from its fixit were
applied.

llvm-svn: 181370
2013-05-07 22:14:37 +00:00
Richard Smith ea85232c40 Don't crash in IRGen if a conditional with 'throw' in one of its branches is
used as a branch condition.

llvm-svn: 181368
2013-05-07 21:53:22 +00:00
Richard Trieu 091872c5df Fix crash on invalid in template type diffing.
This is a fix for PR15895, where Clang will crash when trying to print a
template diff and the template uses an address of operator.  This resulted
from expecting a DeclRefExpr when the Expr could have also been
UnaryOperator->DeclRefExpr.

llvm-svn: 181365
2013-05-07 21:36:24 +00:00
Ted Kremenek 68a60451b3 [analyzer;alternate arrows] Fix inconsistencies in recorded location context when handling interprocedural paths.
llvm-svn: 181362
2013-05-07 21:12:06 +00:00
Ted Kremenek 1c382b2936 [analyzer; alternate arrows] add back recording whether we visited the first edge.
llvm-svn: 181361
2013-05-07 21:12:03 +00:00
Ted Kremenek abf617c27e [analyzer; alternate arrows] remove pruning of loop diagnostics.
llvm-svn: 181360
2013-05-07 21:12:00 +00:00
Ted Kremenek b48f5d9d56 [analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.
llvm-svn: 181359
2013-05-07 21:11:57 +00:00
Ted Kremenek 3a865221c7 [analyzer; alternate arrows] include an edge from the "break" or "continue"
llvm-svn: 181358
2013-05-07 21:11:54 +00:00
Ted Kremenek f3510071f3 [analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no value.
llvm-svn: 181357
2013-05-07 21:11:52 +00:00
Ted Kremenek 2f2a3042e1 [analyzer; alternate arrows] the initializer of a ForStmt isn't interesting either.
llvm-svn: 181356
2013-05-07 21:11:49 +00:00
Argyrios Kyrtzidis 1030f26261 [libclang] Add a null check in CursorVisitor::visitPreprocessedEntities.
rdar://13680583

llvm-svn: 181352
2013-05-07 20:37:17 +00:00
Bill Wendling 3067ec8777 We're in 3.4 land now.
llvm-svn: 181351
2013-05-07 20:31:37 +00:00
Argyrios Kyrtzidis c64c029f85 Try to recognise hidden tag type names in potential declarations, in ObjC code as well.
rdar://13829073

llvm-svn: 181345
2013-05-07 19:54:28 +00:00
Richard Smith 0a715429b9 C++1y: Update __cplusplus to temporary value 201305L to allow detection of provisional C++1y support.
Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from
the C++ features study group), and update documentation to match.

llvm-svn: 181342
2013-05-07 19:32:56 +00:00
Anna Zaks e5e416c6de [analyzer] Fix a crash triggered by printing a note on a default argument
Instead, use the location of the call to print the note.

llvm-svn: 181337
2013-05-07 17:42:42 +00:00
Ted Kremenek ae7c38ddc7 [analyzer; alternate arrows] The ForStmt increment is not a critical anchor for arrows.
llvm-svn: 181333
2013-05-07 17:02:41 +00:00
Serge Pavlov 64bc7038a2 Test commit
llvm-svn: 181332
2013-05-07 16:56:03 +00:00
Edwin Vane 3e40f214a4 Prevent crashes from hasCanonicalType matcher
Adding an QualType::isNull() check.

llvm-svn: 181329
2013-05-07 15:53:23 +00:00
Alexander Kornienko d6538338fd Config file support for clang-format, part 1.
Summary:
Added parseConfiguration method, which reads FormatStyle from YAML
string. This supports all FormatStyle fields and an additional BasedOnStyle
field, which can be used to specify base style.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D754

llvm-svn: 181326
2013-05-07 15:32:14 +00:00
Daniel Jasper 990ff9729b Correctly recognize dereference after 'delete'.
With certain styles:
Before: delete* x;
After:  delete *x;

llvm-svn: 181318
2013-05-07 14:17:18 +00:00
Daniel Jasper ee48c856e2 Further fix to clang-format emacs integration.
This is just a slight improvement for the fix in r181299, which fixes
formatting the very last line of a file.

llvm-svn: 181303
2013-05-07 10:04:47 +00:00
Daniel Jasper f7bec9b4ed Fix clang-format emacs integration in last line.
Emacs seems to have a line that is just past the last character of the
buffers content. This needs to be handled specially so that clang-format
is not called with an invalid -offset.

llvm-svn: 181299
2013-05-07 09:25:29 +00:00
Ted Kremenek 75b8cdee19 [analyzer; alternate edges] simplify optimization rules to look at control-flow conditions to prune edges.
llvm-svn: 181292
2013-05-07 07:30:07 +00:00
Ted Kremenek 868b55336e [analyzer; alternate arrows] use the terminator condition as the location for 'entering loop body'
llvm-svn: 181291
2013-05-07 07:30:00 +00:00
John McCall 6054d5aa7b Weaken an assertion in memcpyization to account for
unnamed bitfields.

Unnamed bitfields won't have an explicit copy operation
in the AST, which breaks the strong form of the invariant.

rdar://13816940

llvm-svn: 181289
2013-05-07 05:20:46 +00:00
Richard Smith 43e77733c2 C++1y constant expression evaluation: support for compound assignments on integers.
llvm-svn: 181287
2013-05-07 04:50:00 +00:00
Argyrios Kyrtzidis d391046930 Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.
This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location
when the the FileID is for an empty file.

rdar://13803893

llvm-svn: 181285
2013-05-07 04:29:22 +00:00
Richard Smith 99005e65cd C++1y: an assignment operator is implicitly 'constexpr' if it would only call 'constexpr' assignment operators for a literal class type.
llvm-svn: 181284
2013-05-07 03:19:20 +00:00
Richard Smith badcd986bb C++ status:
- fix paper links to point to isocpp.org, where most of the papers are already up
 - update "SVN" features to "Clang 3.3" to distinguish them from features which we
   complete after the branch
 - document use of -std=c++1y to enable c++1y support

llvm-svn: 181283
2013-05-07 02:55:48 +00:00
Ted Kremenek fe516f8924 [analyzer; alternate arrows] provide a diagnostic for entering a loop for the first time.
llvm-svn: 181282
2013-05-07 01:18:10 +00:00
David Blaikie fd5aa13549 DebugInfo: Support imported modules (using directives) within lexical blocks.
llvm-svn: 181272
2013-05-06 23:33:13 +00:00
Ted Kremenek 9af6baaaa3 [analyzer; alternate arrows] don't increment the path iterator when we just deleted the next iterator.
This is an optimization.  It is possible that by deleting the next
edge we will pattern match again at the current spot.

llvm-svn: 181256
2013-05-06 21:59:37 +00:00
John McCall d25db7ed0f Grab-bag of bit-field fixes:
- References to ObjC bit-field ivars are bit-field lvalues;
    fixes rdar://13794269, which got me started down this.
  - Introduce Expr::refersToBitField, switch a couple users to
    it where semantically important, and comment the difference
    between this and the existing API.
  - Discourage Expr::getBitField by making it a bit longer and
    less general-sounding.
  - Lock down on const_casts of bit-field gl-values until we
    hear back from the committee as to whether they're allowed.

llvm-svn: 181252
2013-05-06 21:39:12 +00:00
Richard Smith 252a0acce2 Add missing initialization for Sema::CurScope. This is important for AST consumers which don't create a Parser. Pointed out by Tom Honermann.
llvm-svn: 181251
2013-05-06 21:35:35 +00:00
Reid Kleckner 002562a8c1 Move PragmaCommentHandler to lib/Parse in preparation for calling Sema
Summary:
No functionality change.  The existing tests for this pragma only verify
that we can preprocess it.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D751

llvm-svn: 181246
2013-05-06 21:02:12 +00:00
Argyrios Kyrtzidis c4cd2c4dbc Modify ASTReaderListener to allow visiting the input files of an AST file.
We can pass such an input-file-visiting ASTReaderListener to ASTReader::readASTFileControlBlock.

llvm-svn: 181238
2013-05-06 19:23:40 +00:00
Argyrios Kyrtzidis fe6a01253e Have the RecursiveASTVisitor traverse the type source info of an objc class message.
llvm-svn: 181237
2013-05-06 19:08:57 +00:00
Jordan Rose 50e5db8a6b [analyzer] Remove now-unused bindCompoundLiteral helper function.
The one user has been changed to use getLValue on the compound literal
expression and then use the normal bindLoc to assign a value. No need
to special case this in the StoreManager.

llvm-svn: 181214
2013-05-06 16:48:26 +00:00
Jordan Rose 5d2abefb62 [analyzer] Handle CXXTemporaryObjectExprs in compound literals.
This occurs because in C++11 the compound literal syntax can trigger a
constructor call via list-initialization. That is, "Point{x, y}" and
"(Point){x, y}" end up being equivalent. If this occurs, the inner
CXXConstructExpr will have already handled the object construction; the
CompoundLiteralExpr just needs to propagate that value forwards.

<rdar://problem/13804098>

llvm-svn: 181213
2013-05-06 16:48:20 +00:00
Jordan Rose 6c0505e4eb Fix representation of compound literals for C++ objects with destructors.
Previously, this compound literal expression (a GNU extension in C++):

  (AggregateWithDtor){1, 2}

resulted in this AST:

 `-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
   `-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
     `-CXXBindTemporaryExpr [...] 'struct AggregateWithDtor' (CXXTemporary [...])
       `-InitListExpr [...] 'struct AggregateWithDtor'
         |-IntegerLiteral [...] 'int' 1
         `-IntegerLiteral [...] 'int' 2

Note the two CXXBindTemporaryExprs. The InitListExpr is really part of the
CompoundLiteralExpr, not an object in its own right. By introducing a new
entity initialization kind in Sema specifically for compound literals, we
avoid the treatment of the inner InitListExpr as a temporary.

 `-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
   `-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
     `-InitListExpr [...] 'struct AggregateWithDtor'
       |-IntegerLiteral [...] 'int' 1
       `-IntegerLiteral [...] 'int' 2

llvm-svn: 181212
2013-05-06 16:48:12 +00:00
Ulrich Weigand 47445073f8 Add SystemZ support
This patch then adds all the usual platform-specific pieces for SystemZ:
driver support, basic target info, register names and constraints,
ABI info and vararg support.  It also adds new tests to verify pre-defined
macros and inline asm, and updates a test for the minimum alignment change.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall.  Thanks to all reviewers!

Patch by Richard Sandiford.

llvm-svn: 181211
2013-05-06 16:26:41 +00:00
Ulrich Weigand fa80642205 Allow targets to define minimum alignment for global variables
This patch adds a new common code feature that allows platform code to
request minimum alignment of global symbols.  The background for this is
that on SystemZ, the most efficient way to load addresses of global symbol
is the LOAD ADDRESS RELATIVE LONG (LARL) instruction.  This instruction
provides PC-relative addressing, but only to *even* addresses.  For this
reason, existing compilers will guarantee that global symbols are always
aligned to at least 2.  [ Since symbols would otherwise already use a
default alignment based on their type, this will usually only affect global
objects of character type or character arrays. ]  GCC also allows creating
symbols without that extra alignment by using explicit "aligned" attributes
(which then need to be used on both definition and each use of the symbol).

To enable support for this with Clang, this patch adds a
TargetInfo::MinGlobalAlign variable that provides a global minimum for the
alignment of every global object (unless overridden via explicit alignment
attribute), and adds code to respect this setting.  Within this patch, no
platform actually sets the value to anything but the default 1, resulting
in no change in behaviour on any existing target.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall.  Thanks to all reviewers!

Patch by Richard Sandiford.

llvm-svn: 181210
2013-05-06 16:23:57 +00:00
Tom Stellard b38600c4a9 R600: Update GPU variants in -mcpu option
We've added the RS880 variant in the LLVM backend to represent an R600
GPU with no vertex cache, so we need to update the GPU mappings for
-mcpu.

llvm-svn: 181202
2013-05-06 16:12:05 +00:00
Douglas Gregor cf8ea44a83 Remove forward slashes from check; should unbreak Windows buildbots.
llvm-svn: 181199
2013-05-06 15:42:15 +00:00
Hans Wennborg 9242bd1b06 Add llvm_unreachable at end of fully covered switch
To pacify GCC warning about control reaching end of non-void function.

llvm-svn: 181197
2013-05-06 15:13:34 +00:00
Alexander Kornienko c860266e0f Added Mozilla style, cleaned get*Style methods.
Summary: Patch based on a patch by Ehsan Akhgari.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D750

llvm-svn: 181196
2013-05-06 14:11:27 +00:00
Daniel Jasper 4a4be01818 Don't break comments after includes.
LLVM/Clang basically don't use such comments and for Google-style,
include-lines are explicitly exempt from the column limit. Also, for
most cases, where the column limit is violated, the "better" solution
would be to move the comment to before the include, which clang-format
cannot do (yet).

llvm-svn: 181191
2013-05-06 10:24:51 +00:00
Daniel Jasper 8e35769b24 Change indentation when breaking after a type.
clang-format did not indent any declarations/definitions when breaking
after the type. With this change, it indents for all declarations but
does not indent for function definitions, i.e.:

Before:
const SomeLongTypeName&
some_long_variable_name;
typedef SomeLongTypeName
SomeLongTypeAlias;
const SomeLongReturnType*
SomeLongFunctionName();
const SomeLongReturnType*
SomeLongFunctionName() { ... }

After:
const SomeLongTypeName&
    some_long_variable_name;
typedef SomeLongTypeName
    SomeLongTypeAlias;
const SomeLongReturnType*
    SomeLongFunctionName();
const SomeLongReturnType*
SomeLongFunctionName() { ... }

While it might seem inconsistent to indent function declarations, but
not definitions, there are two reasons for that:
- Function declarations are very similar to declarations of function
type variables, so there is another side to consistency to consider.
- There can be many function declarations on subsequent lines and not
indenting can make them harder to identify. Function definitions
are already separated by their body and not indenting
makes the function name slighly easier to find.

llvm-svn: 181187
2013-05-06 08:27:33 +00:00
John McCall 768439eb2e Require the containing type to be complete when we see
__alignof__ of a field.

This problem can only happen in C++11.

Also do some petty optimizations.

rdar://13784901

llvm-svn: 181185
2013-05-06 07:40:34 +00:00
Richard Smith 896e0d7568 C++1y: support range-based for loops in constant expressions.
llvm-svn: 181184
2013-05-06 06:51:17 +00:00
Daniel Jasper a61aefb367 Break the class-inheritance ":" to the new line.
This seems to be more common in LLVM, Google and Chromium.

Before:
class AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA :
    public BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
    public CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC {
};

After:
class AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    : public BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
      public CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC {
};

llvm-svn: 181183
2013-05-06 06:45:09 +00:00
Daniel Jasper 10cd581f95 Don't put a space before ellipsis.
Before: template <class ... Ts> void Foo(Ts ... ts) { Foo(ts ...); }
After:  template <class... Ts> void Foo(Ts... ts) { Foo(ts...); }
llvm-svn: 181182
2013-05-06 06:35:44 +00:00
Richard Smith 4e18ca5200 C++1y: support 'for', 'while', and 'do ... while' in constant expressions.
llvm-svn: 181181
2013-05-06 05:56:11 +00:00
Richard Smith d74b1606a6 Fix assert if __extension__ or _Generic is used when initializing a char array from a string literal.
llvm-svn: 181174
2013-05-06 00:35:47 +00:00
Richard Smith 243ef9077a C++1y: support for increment and decrement in constant expression evaluation.
llvm-svn: 181173
2013-05-05 23:31:59 +00:00
Richard Smith 3229b744a5 Factor out duplication between lvalue-to-rvalue conversions and variable
assignments in constant expressions. No significant functionality changes
(slight improvement to potential constant expression checking). 

llvm-svn: 181170
2013-05-05 21:17:10 +00:00
Dmitri Gribenko 78852e91c8 Replace 'MultiExprArg()' with 'None'
llvm-svn: 181166
2013-05-05 20:40:26 +00:00
Rafael Espindola 593537a979 Make all 'is in extern "C"' tests use the lexical context.
I was not able to find a case (other than the fix in r181163) where this
makes a difference, but it is a more obviously correct API to have.

llvm-svn: 181165
2013-05-05 20:15:21 +00:00
Dmitri Gribenko 1debc468fa ArrayRef'ize Sema::CheckObjCMethodCall
Patch by Robert Wilhelm.

llvm-svn: 181164
2013-05-05 19:42:09 +00:00
Rafael Espindola a5d5220497 Use lexical contexts when checking for conflicting language linkages.
This fixes pr14958. I will audit other calls to isExternCContext to see
if there are any similar bugs left.

llvm-svn: 181163
2013-05-05 18:24:05 +00:00
Richard Smith 430c23bb42 Handle parens properly when initializing a char array from a string literal.
llvm-svn: 181159
2013-05-05 16:40:13 +00:00
Richard Smith e54c307bb4 ArrayRef'ization of some methods in SemaOverload. Patch by Robert Wilhelm!
llvm-svn: 181158
2013-05-05 15:51:06 +00:00
Benjamin Kramer 1ce5d80066 Use remove_if to erase parts of a vector. Avoids O(n^2) worst cases.
llvm-svn: 181150
2013-05-05 12:39:28 +00:00
Dmitri Gribenko 010316ce34 ArrayRef<T>() -> None cleanup
llvm-svn: 181140
2013-05-05 01:03:47 +00:00
Dmitri Gribenko 44ebbd5436 Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None
Patch by Robert Wilhelm.

llvm-svn: 181139
2013-05-05 00:41:58 +00:00
Aaron Ballman 444eb6e23c Properly parsing __declspec(safebuffers), though there is no semantic hookup. For more information about safebuffers, see MSDN: http://msdn.microsoft.com/en-us/library/dd778695(v=vs.110).aspx
llvm-svn: 181123
2013-05-04 16:58:37 +00:00
Aaron Ballman d428ff46fe Reverting r181004 since it has broken test/Sema/wchar.c.
llvm-svn: 181122
2013-05-04 16:56:22 +00:00
Enea Zaffanella b2d998f356 Moved pretty printer test for thread local storage in its own file
and specified the triple.

llvm-svn: 181115
2013-05-04 11:26:59 +00:00
Benjamin Kramer c2f5f29b8d Lex: Fix quadratic behavior when unescaping _Pragma strings.
No functionality change.

llvm-svn: 181114
2013-05-04 10:37:20 +00:00
Enea Zaffanella acb8ecd664 In VarDecl nodes, store the thread storage class specifier as written.
llvm-svn: 181113
2013-05-04 08:27:07 +00:00
Tim Northover 8ec8c4bf89 AArch64: teach Clang about __clear_cache intrinsic
libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.

llvm-svn: 181111
2013-05-04 07:15:13 +00:00
Richard Smith fa7a7b4f36 Tweaks to C++ status: add a link to Faisal's generic lambdas implementation,
and mark "clarifying memory allocation" as done, since it turns out that our
optimizations here (such as they are) already conform to the new rules.

llvm-svn: 181110
2013-05-04 07:12:37 +00:00
Richard Smith 452d6b0331 More colours for C++ status page, and mark relaxed constexpr as partially complete.
llvm-svn: 181109
2013-05-04 07:02:10 +00:00
Richard Smith 2a7d481faf Implement most of N3638 (return type deduction for normal functions).
Missing (somewhat ironically) is support for the new deduction rules
in lambda functions, plus PCH support for return type patching.

llvm-svn: 181108
2013-05-04 07:00:32 +00:00
Richard Smith 22262abd78 Don't build a call expression referring to a function which we're not allowed
to use. This makes very little difference right now (other than suppressing
follow-on errors in some cases), but will matter more once we support deduced
return types (we don't want expressions with undeduced return types in the
AST).

llvm-svn: 181107
2013-05-04 06:44:46 +00:00
Richard Smith 489e4e0369 Say 'decltype(auto)' not 'auto' as appropriate in mismatched-deduction diagnostic.
llvm-svn: 181103
2013-05-04 04:19:27 +00:00
Wei Pan 17fbf6edc2 Implement template support for CapturedStmt
- Sema tests added and CodeGen tests are pending

Differential Revision: http://llvm-reviews.chandlerc.com/D728

llvm-svn: 181101
2013-05-04 03:59:06 +00:00
Sean Callanan 0325fb8576 Added a function to check whether a Decl is in
the list of Decls for a given DeclContext.  This
is useful for LLDB's implementation of
FindExternalLexicalDecls.

llvm-svn: 181093
2013-05-04 02:04:27 +00:00
Richard Smith b875c43307 Simplify slightly.
llvm-svn: 181092
2013-05-04 01:51:08 +00:00
Richard Smith 01518fa77a Separate out and special-case the diagnostic for 'auto' in a
conversion-type-id, in preparation for this becoming valid in c++1y mode.
No functionality change; small diagnostic improvement.

llvm-svn: 181089
2013-05-04 01:26:46 +00:00
Ted Kremenek 7b9b5a2c48 [analyzer;alternate edges] start experimenting with control flow "barriers" to prevent an edge being optimized away.
llvm-svn: 181088
2013-05-04 01:13:22 +00:00
Ted Kremenek 992b3112ce [analyzer;alternate edges] ignore parentheses when determining edge levels.
llvm-svn: 181087
2013-05-04 01:13:12 +00:00
Ted Kremenek bcd6b0d891 [analyzer; alternate edges] - eliminate unnecessary edges where between parents and subexpressions.
llvm-svn: 181086
2013-05-04 01:13:08 +00:00
Ted Kremenek ccb6d1ea0c [analyzer; alternate edges] - merge control edges where we descend to a subexpression and pop back out.
llvm-svn: 181085
2013-05-04 01:13:05 +00:00
Ted Kremenek 6cf3c97c55 [analyzer; alternate edges] prune edges whose end/begin locations have the same statement parents.
This change required some minor changes to LocationContextMap to have it map
from PathPieces to LocationContexts instead of PathDiagnosticCallPieces to
LocationContexts.  These changes are in the other diagnostic
generation logic as well, but are functionally equivalent.

Interestingly, this optimize requires delaying "cleanUpLocation()" until
later; possibly after all edges have been optimized.  This is because
we need PathDiagnosticLocations to refer to the semantic entity (e.g. a statement)
as long as possible.  Raw source locations tell us nothing about
the semantic relationship between two locations in a path.

llvm-svn: 181084
2013-05-04 01:13:01 +00:00
Ted Kremenek 74c0d388e8 [analyzer;alternate edges] - add in events (loop iterations, etc)
These were being dropped due a transcription mistake from the original
algorithm.

llvm-svn: 181083
2013-05-04 01:12:55 +00:00
Fariborz Jahanian 6738e430a9 [doc parsing]: Make warning about unknown command
tags off by default for now. Move diagnostic code
to DiagnosticCommentKinds.td. // rdar://12381408

llvm-svn: 181081
2013-05-04 00:47:28 +00:00
Richard Smith 47752e489e ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!
llvm-svn: 181077
2013-05-03 23:46:09 +00:00
Douglas Gregor b4eadc34e1 <rdar://problem/13806270> A template argument list is a constant-evaluated context.
llvm-svn: 181076
2013-05-03 23:44:54 +00:00
Argyrios Kyrtzidis 56c56d218d Revert r177218.
Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag.

llvm-svn: 181073
2013-05-03 23:20:27 +00:00
Fariborz Jahanian 5b637078e1 [Doc parsing] Provide diagnostics for unknown documentation
commands. // rdar://12381408

llvm-svn: 181071
2013-05-03 23:15:20 +00:00
Douglas Gregor 30071cead9 Remove DiagnosticConsumer::clone(), a bad idea that is now unused.
llvm-svn: 181070
2013-05-03 23:07:45 +00:00
Douglas Gregor 6b930967e8 When building a module, forward diagnostics to the outer diagnostic consumer.
Previously, we would clone the current diagnostic consumer to produce
a new diagnostic consumer to use when building a module. The problem
here is that we end up losing diagnostics for important diagnostic
consumers, such as serialized diagnostics (where we'd end up with two
diagnostic consumers writing the same output file). With forwarding,
the diagnostics from all of the different modules being built get
forwarded to the one serialized-diagnostic consumer and are emitted in
a sane way.

Fixes <rdar://problem/13663996>.

llvm-svn: 181067
2013-05-03 22:58:43 +00:00
Argyrios Kyrtzidis 37e48ff547 [Preprocessor] For the MacroExpands preprocessor callback, also pass the MacroArgs object that provides information about
the argument tokens for a function macro.

llvm-svn: 181065
2013-05-03 22:31:32 +00:00
Argyrios Kyrtzidis 5d2ce840c1 Rename ObjCImplementationDecl::getSuperLoc() -> getSuperClassLoc() for consistency with ObjCInterfaceDecl::getSuperClassLoc()
llvm-svn: 181064
2013-05-03 22:31:26 +00:00
Wei Pan c4c76d1b4f Test commit
llvm-svn: 181057
2013-05-03 21:07:45 +00:00
Adrian Prantl 52bf3c4c3f Reapply r180982 with repaired logic and an additional testcase.
Un-break the gdb buildbot.
- Use the debug location of the return expression for the cleanup code
  if the return expression is trivially evaluatable, regardless of the
  number of stop points in the function.
- Ensure that any EH code in the cleanup still gets the line number of
  the closing } of the lexical scope.
- Added a testcase with EH in the cleanup.

rdar://problem/13442648

llvm-svn: 181056
2013-05-03 20:11:48 +00:00
Ben Langmuir ce914fc84b Serialization for captured statements
Add serialization for captured statements and captured decls.  Also add
a const_capture_iterator to CapturedStmt.

Test contributed by Wei Pan

Differential Revision: http://llvm-reviews.chandlerc.com/D727

llvm-svn: 181048
2013-05-03 19:20:19 +00:00
Richard Smith fa11fd669f PR15906: The body of a lambda is not an evaluated subexpression; don't visit it when visiting such subexpressions.
llvm-svn: 181046
2013-05-03 19:16:22 +00:00
Ben Langmuir 37943a7af8 Move CapturedStmt parameters to CapturedDecl
Move the creation of CapturedStmt parameters out of CodeGen and into
Sema, making it easier to customize the outlined function. The
ImplicitParamDecls are stored in the CapturedDecl using an
ASTContext-allocated array.

Differential Revision: http://llvm-reviews.chandlerc.com/D722

llvm-svn: 181043
2013-05-03 19:00:33 +00:00
Douglas Gregor 231ca1c929 Restore Richard's belief in me.
llvm-svn: 181042
2013-05-03 18:51:59 +00:00
Ted Kremenek acf99a1a51 [analyzer] Start hacking up alternate control-flow edge generation. WIP. Not guaranteed to do anything useful yet.
llvm-svn: 181040
2013-05-03 18:25:33 +00:00
Argyrios Kyrtzidis fac3162022 Keep track of an @implementation's super class name location, if one was provided.
llvm-svn: 181039
2013-05-03 18:05:44 +00:00
John McCall 55c0ceecac Micro-optimization: check the overloaded operator kind before
checking for a lambda.

Thanks to Jordan for the pointer.

llvm-svn: 181031
2013-05-03 17:11:14 +00:00
Dmitri Gribenko 8f8930fc01 ArrayRef'ize InitializationSequence constructor and InitializationSequence::Diagnose()
Patch by Robert Wilhelm.

llvm-svn: 181022
2013-05-03 15:05:50 +00:00
Rafael Espindola aabf533656 Initialize WarnOnSpellCheck.
Clang always calls setWarnOnSpellCheck, but we shouldn't require every client to
do so.

Issue noticed by Enea Zaffanella.

llvm-svn: 181021
2013-05-03 15:01:36 +00:00
Daniel Jasper 72463d32e0 Add space between ; and (.
Before: for (int i = 0;(i < 10); ++i) {}
After:  for (int i = 0; (i < 10); ++i) {}
llvm-svn: 181020
2013-05-03 14:50:50 +00:00
Daniel Jasper c37de30219 Fix expression recognition in for-loops.
Before: for (; a&& b;) {}
After:  for (; a && b;) {}
llvm-svn: 181017
2013-05-03 14:41:24 +00:00
Dmitri Gribenko 5267fdfb7f Add const qualifier to Sema::getTypeName's parameter `II`
Patch by Ismail Pazarbasi.

llvm-svn: 181011
2013-05-03 13:12:11 +00:00
Benjamin Kramer 914d7e06b6 Add support for -march=btver2.
llvm-svn: 181006
2013-05-03 10:47:15 +00:00
Hans Wennborg cadd77c05b Support __wchar_t in -fms-extensions and -fms-compatibility modes.
MSVC provides __wchar_t, either as an alias for the built-in wchar_t
type, or as a separate type depending on language (C vs C++) and flags
(-fno-wchar).

In -fms-extensions, Clang will simply accept __wchar_t as an alias for
whatever type is used for wide character literals. In -fms-compatibility, we
try to mimic MSVC's behavior by always making __wchar_t a builtin type.

This fixes PR15815.

llvm-svn: 181004
2013-05-03 09:10:16 +00:00
John McCall dec348f7db Correctly emit certain implicit references to 'self' even within
a lambda.

Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation
functions.  Fix that by generally improving getNonClosureContext
to look through lambdas and captured statements but only report
code contexts, which is generally what's wanted.  Audit uses of
CurFuncDecl and getNonClosureAncestor for correctness.

Bug #2 is that lambdas weren't specially mapping 'self' when inside
an ObjC method.  Fix that by removing the requirement for that
and using the normal EmitDeclRefLValue path in LoadObjCSelf.

rdar://13800041

llvm-svn: 181000
2013-05-03 07:33:41 +00:00
Jordan Rose 320fbf057c [analyzer] Check the stack frame when looking for a var's initialization.
FindLastStoreBRVisitor is responsible for finding where a particular region
gets its value; if the region is a VarRegion, it's possible that value was
assigned at initialization, i.e. at its DeclStmt. However, if a function is
called recursively, the same DeclStmt may be evaluated multiple times in
multiple stack frames. FindLastStoreBRVisitor was not taking this into
account and just picking the first one it saw.

<rdar://problem/13787723>

llvm-svn: 180997
2013-05-03 05:47:31 +00:00
Jordan Rose cea47b78fc [analyzer] Fix trackNullOrUndef when tracking args that have nil receivers.
There were actually two bugs here:
- if we decided to look for an interesting lvalue or call expression, we
  wouldn't go find its node if we also knew we were at a (different) call.
- if we looked through one message send with a  nil receiver, we thought we
  were still looking at an argument to the original call.

Put together, this kept us from being able to track the right values, which
means sub-par diagnostics and worse false-positive suppression.

Noticed by inspection.

llvm-svn: 180996
2013-05-03 05:47:24 +00:00
Adrian Prantl 857f92371a Revert "Attempt to un-break the gdb buildbot."
This reverts commit 180982.

llvm-svn: 180990
2013-05-03 01:42:35 +00:00
Ted Kremenek 57f745ec96 Make cleanUpLocation() a self-contained function.
llvm-svn: 180986
2013-05-03 01:16:26 +00:00
Reid Kleckner 7d0efb57d3 [ms-cxxabi] Emit non-virtual member function pointers
Without any conversion, this is pretty straightforward.  Most of the
fields can be zeros.  The order is:

- field offset or pointer
- nonvirtual adjustment (for MI functions)
- vbptr offset (for unspecified)
- virtual adjustment offset (for virtual inheritance)

Differential Revision: http://llvm-reviews.chandlerc.com/D699

llvm-svn: 180985
2013-05-03 01:15:11 +00:00
Adrian Prantl 44f38013e2 Attempt to un-break the gdb buildbot.
- Use the debug location of the return expression for the cleanup code
  if the return expression is trivially evaluatable, regardless of the
  number of stop points in the function.
- Ensure that any EH code in the cleanup still gets the line number of
  the closing } of the lexical scope.
- Added a testcase with EH in the cleanup.

rdar://problem/13442648

llvm-svn: 180982
2013-05-03 00:44:13 +00:00
Ted Kremenek f12d9d93fe Re-apply 180974 with the build error fixed. This was the result
of a weird merge error with git.

llvm-svn: 180981
2013-05-03 00:32:44 +00:00
Rafael Espindola c73756b178 Revert "Change LocationContextMap to be a temporary instead of shared variable in BugReporter."
This reverts commit 180974. It broke the build.

llvm-svn: 180979
2013-05-03 00:22:49 +00:00
John McCall f413f5ed44 Move parsing of identifiers in MS-style inline assembly into
the actual parser and support arbitrary id-expressions.

We're actually basically set up to do arbitrary expressions here
if we wanted to.

Assembly operands permit things like A::x to be written regardless
of language mode, which forces us to embellish the evaluation
context logic somewhat.  The logic here under template instantiation
is incorrect;  we need to preserve the fact that an expression was
unevaluated.  Of course, template instantiation in general is fishy
here because we have no way of delaying semantic analysis in the
MC parser.  It's all just fishy.

I've also fixed the serialization of MS asm statements.

This commit depends on an LLVM commit.

llvm-svn: 180976
2013-05-03 00:10:13 +00:00
Ted Kremenek 48bd5fddf3 Change LocationContextMap to be a temporary instead of shared variable in BugReporter.
BugReporter is used to process ALL bug reports.  By using a shared map,
we are having mappings from different PathDiagnosticPieces to LocationContexts
well beyond the point where we are processing a given report.  This
state is inherently error prone, and is analogous to using a global
variable.  Instead, just create a temporary map, one per report,
and when we are done with it we throw it away.  No extra state.

llvm-svn: 180974
2013-05-02 23:56:33 +00:00
Douglas Gregor d2472d4cdb Use attribute argument information to determine when to parse attribute arguments as expressions.
This change partly addresses a heinous problem we have with the
parsing of attribute arguments that are a lone identifier. Previously,
we would end up parsing the 'align' attribute of this as an expression
"(Align)":

 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align((Align)))) char storage[Size];
 };

while this would parse as a "parameter name" 'Align':

 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align(Align))) char storage[Size];
 };

The code that handles the alignment attribute would completely ignore
the parameter name, so the while the first of these would do what's
expected, the second would silently be equivalent to

 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align)) char storage[Size];
 };

i.e., use the maximal alignment rather than the specified alignment.

Address this by sniffing the "Args" provided in the TableGen
description of attributes. If the first argument is "obviously"
something that should be treated as an expression (rather than an
identifier to be matched later), parse it as an expression.

Fixes <rdar://problem/13700933>.

llvm-svn: 180973
2013-05-02 23:25:32 +00:00
Douglas Gregor 33ebfe36e5 Revert r180970; it's causing breakage.
llvm-svn: 180972
2013-05-02 23:15:45 +00:00
Douglas Gregor 44dff3f2dc Use attribute argument information to determine when to parse attribute arguments as expressions.
This change partly addresses a heinous problem we have with the
parsing of attribute arguments that are a lone identifier. Previously,
we would end up parsing the 'align' attribute of this as an expression
"(Align)":

  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align((Align)))) char storage[Size];
  };

while this would parse as a "parameter name" 'Align':

  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align(Align))) char storage[Size];
  };

The code that handles the alignment attribute would completely ignore
the parameter name, so the while the first of these would do what's
expected, the second would silently be equivalent to

  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align)) char storage[Size];
  };

i.e., use the maximal alignment rather than the specified alignment.

Address this by sniffing the "Args" provided in the TableGen
description of attributes. If the first argument is "obviously"
something that should be treated as an expression (rather than an
identifier to be matched later), parse it as an expression.

Fixes <rdar://problem/13700933>.

llvm-svn: 180970
2013-05-02 23:08:12 +00:00
Bill Wendling 952e8dfa8c Remove redundant flag.
llvm-svn: 180968
2013-05-02 22:53:00 +00:00
Bill Wendling 3dfc28782f We don't want FP elimination when doing an Apple-style build.
llvm-svn: 180950
2013-05-02 21:09:11 +00:00
Jordan Rose c76d7e3d96 [analyzer] Don't try to evaluate MaterializeTemporaryExpr as a constant.
...and don't consider '0' to be a null pointer constant if it's the
initializer for a float!

Apparently null pointer constant evaluation looks through both
MaterializeTemporaryExpr and ImplicitCastExpr, so we have to be more
careful about types in the callers. For RegionStore this just means giving
up a little more; for ExprEngine this means handling the
MaterializeTemporaryExpr case explicitly.

Follow-up to r180894.

llvm-svn: 180944
2013-05-02 19:51:20 +00:00
Bill Wendling 95cae88bcf Use the Itanium ABI for thread_local on Darwin.
After some discussion, it was decided to use the Itanium ABI for thread_local on
Darwin OS X platforms. This involved a couple of changes. First, we use
"_tlv_atexit" instead of "__cxa_thread_atexit". Secondly, the global variables
are marked with 'internal' linkage, because we want all access to be calls to
the Itanium-specific entry point, which has normal linkage.
<rdar://problem/13733006>

llvm-svn: 180941
2013-05-02 19:18:03 +00:00
Douglas Gregor 39aaeef545 Fix crasher when the range in a C++ range-for loop has an ill-formed initializer.
Fixes <rdar://problem/13712739>.

llvm-svn: 180937
2013-05-02 18:35:56 +00:00
Douglas Gregor 34d52749e4 When looking for the module associated with one of our magical builtin headers, speculatively load module maps.
The "magical" builtin headers are the headers we provide as part of
the C standard library, which typically comes from /usr/include. We
essentially merge our headers into that location (due to cyclic
dependencies). This change makes sure that, when header search finds
one of our builtin headers, we figure out which module it actually
lives in. This case is fairly rare; one ends up having to include one
of the few built-in C headers we provide before including anything
from /usr/include to trigger it. Fixes <rdar://problem/13787184>.

llvm-svn: 180934
2013-05-02 17:58:30 +00:00
Daniel Jasper 5f99742632 Basic clang-format integration for BBEdit.
Thanks to Avi Drissman!

llvm-svn: 180933
2013-05-02 17:37:36 +00:00
Adrian Prantl 3be10542af Ensure that the line table for functions with cleanups is sequential.
If there is cleanup code, the cleanup code gets the debug location of
the closing '}'. The subsequent ret IR-instruction does not get a
debug location. The return _expression_ will get the debug location
of the return statement.

If the function contains only a single, simple return statement,
the cleanup code may become the first breakpoint in the function.
In this case we set the debug location for the cleanup code
to the location of the return statement.

rdar://problem/13442648

llvm-svn: 180932
2013-05-02 17:30:20 +00:00
Adrian Prantl f1b28a5dbc Use a more idiomatic way to disable debug locations.
llvm-svn: 180931
2013-05-02 17:30:16 +00:00
Douglas Gregor 709499b250 Use a triple ensure that __has_feature(c_thread_local) is 1 in C11 mode.
llvm-svn: 180925
2013-05-02 16:22:34 +00:00
Fariborz Jahanian 6384fbb28f [document parsing]: support c++11 type aliases
with no comment of their own to inherit the
comment of their aliased type. // rdar://13752382

llvm-svn: 180924
2013-05-02 15:44:16 +00:00
Hans Wennborg 4c02be3b83 Make sure we define wchar_t related macros correctly in -fms-extensions mode.
This adds a test to make sure we define _WCHAR_T_DEFINED and
_NATIVE_WCHAR_T_DEFINED correctly in the preprocessor, and updates
stddef.h to set it when typedeffing wchar_t.

llvm-svn: 180918
2013-05-02 13:12:32 +00:00
Hans Wennborg b2175b25a7 Fix typo in a stddef.h comment: s/risze_t/rsize_t/
llvm-svn: 180916
2013-05-02 10:36:31 +00:00
Douglas Gregor a7130bfed6 Only evaluate __has_feature(c_thread_local) and __has_feature(cxx_thread_local) true when the target supports thread-local storage.
llvm-svn: 180909
2013-05-02 05:28:32 +00:00
Anton Yartsev 604518ccd4 [analyzer] Finally make c++-analyzer 'executable' again.
llvm-svn: 180905
2013-05-02 01:57:58 +00:00
Jordan Rose b147918252 [analyzer] RetainCountChecker: don't track through xpc_connection_set_context.
It is unfortunate that we have to mark these exceptions in multiple places.
This was already in CallEvent. I suppose it does let us be more precise
about saying /which/ arguments have their retain counts invalidated -- the
connection's is still valid even though the context object's isn't -- but
we're not tracking the retain count of XPC objects anyway.

<rdar://problem/13783514>

llvm-svn: 180904
2013-05-02 01:51:40 +00:00
Anton Yartsev 10f9d08c70 [analyzer] Recreated as a file.
llvm-svn: 180903
2013-05-02 01:41:51 +00:00
Anton Yartsev 2320d295af [analyzer] Temporary remove c++analyzer to recreate it as a separate file, not a symlink.
llvm-svn: 180902
2013-05-02 01:36:41 +00:00
Anton Yartsev 19993e8441 [analyzer] Added 'executable' property to c++analyzer.
llvm-svn: 180901
2013-05-02 01:18:17 +00:00
Anton Yartsev caaaf2ee28 [analyzer] scan-build for Windows
The patch allows Windows users to launch scan-build without any additional preparations in the same way as it described in http://clang-analyzer.llvm.org/scan-build.html. The only thing that should be done to make scan-build work from an arbitrary location is to add scan-build folder to the PATH environment variable.

llvm-svn: 180900
2013-05-02 00:52:46 +00:00
Jordan Rose 89bbd1fb64 [analyzer] Consolidate constant evaluation logic in SValBuilder.
Previously, this was scattered across Environment (literal expressions),
ExprEngine (default arguments), and RegionStore (global constants). The
former special-cased several kinds of simple constant expressions, while
the latter two deferred to the AST's constant evaluator.

Now, these are all unified as SValBuilder::getConstantVal(). To keep
Environment fast, the special cases for simple constant expressions have
been left in, but the main benefits are that (a) unusual constants like
ObjCStringLiterals now work as default arguments and global constant
initializers, and (b) we're not duplicating code between ExprEngine and
RegionStore.

This actually caught a bug in our test suite, which is awesome: we stop
tracking allocated memory if it's passed as an argument along with some
kind of callback, but not if the callback is 0. We were testing this in
a case where the callback parameter had a default value, but that value
was 0. After this change, the analyzer now (correctly) flags that as a
leak!

<rdar://problem/13773117>

llvm-svn: 180894
2013-05-01 23:10:44 +00:00
Jordan Rose 7023a90378 [analyzer] Don't inline the [cd]tors of C++ iterators.
This goes with r178516, which instructed the analyzer not to inline the
constructors and destructors of C++ container classes. This goes a step
further and does the same thing for iterators, so that the analyzer won't
falsely decide we're trying to construct an iterator pointing to a
nonexistent element.

The heuristic for determining whether something is an iterator is the
presence of an 'iterator_category' member. This is controlled under the
same -analyzer-config option as container constructor/destructor inlining:
'c++-container-inlining'.

<rdar://problem/13770187>

llvm-svn: 180890
2013-05-01 22:39:31 +00:00
Fariborz Jahanian b5f34681a6 [documenting declaration]: Remove arc liftime qualifiers
when doccumenting declrations in comments.
// rdar://13757500

llvm-svn: 180880
2013-05-01 20:53:21 +00:00
Chad Rosier bc668b0642 Fix typo in FileCheck.
llvm-svn: 180877
2013-05-01 20:10:14 +00:00
Chad Rosier 368ec9eafc [inline asm] Add a test case for r180873. Test case needs to be on the clang
side because we need an inline asm diagnostics handler in place.  Unfortunately,
we emit a .s file because we need to build the SelectionDAG to hit the backend
issue.
rdar://13446483

llvm-svn: 180874
2013-05-01 19:50:45 +00:00
Richard Smith df6bee8081 Fix spurious trailing comma when printing some of the __c11_atomic_* builtins. Patch by Joe Sprowes!
llvm-svn: 180867
2013-05-01 19:02:43 +00:00
Richard Smith 9f8400eca4 PR15884: In the 'taking the address of a temporary' extension, materialize the
temporary to an lvalue before taking its address. This removes a weird special
case from the AST representation, and allows the constant expression evaluator
to deal with it without (broken) hacks.

llvm-svn: 180866
2013-05-01 19:00:39 +00:00