]> granicus.if.org Git - clang/log
clang
11 years agoArrayRef'ize Sema::BuildCallToObjectOfClassType
Dmitri Gribenko [Thu, 9 May 2013 23:32:58 +0000 (23:32 +0000)]
ArrayRef'ize Sema::BuildCallToObjectOfClassType

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

11 years agoDebug Info: Fix a problem that resulted in missing DW_AT_specifications
Adrian Prantl [Thu, 9 May 2013 23:16:27 +0000 (23:16 +0000)]
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

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

11 years agoRemove dependence on system headers from this test, to try to make the Windows bots...
Richard Smith [Thu, 9 May 2013 22:45:27 +0000 (22:45 +0000)]
Remove dependence on system headers from this test, to try to make the Windows bots happier.

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

11 years agoDebug Info: include address-of ('&') operator and qualified names in template argumen...
David Blaikie [Thu, 9 May 2013 22:43:45 +0000 (22:43 +0000)]
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)

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

11 years agoFix some test cases I broke in r181552
David Blaikie [Thu, 9 May 2013 22:11:34 +0000 (22:11 +0000)]
Fix some test cases I broke in r181552

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

11 years agoC++1y n3648: parse and reject init-captures for now.
Richard Smith [Thu, 9 May 2013 21:36:41 +0000 (21:36 +0000)]
C++1y n3648: parse and reject init-captures for now.

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

11 years agoDebugInfo: Simply & constrain test(s) for PR9600/PR9608
David Blaikie [Thu, 9 May 2013 21:32:04 +0000 (21:32 +0000)]
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)

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

11 years agoDocumentation warning: \param, not \parm
Dmitri Gribenko [Thu, 9 May 2013 21:15:22 +0000 (21:15 +0000)]
Documentation warning: \param, not \parm

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

11 years agoAdd pragma-comment.c test case for r181426 that I forgot to add
Reid Kleckner [Thu, 9 May 2013 21:10:06 +0000 (21:10 +0000)]
Add pragma-comment.c test case for r181426 that I forgot to add

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

11 years agoArrayRef'ize some SemaOverload methods
Dmitri Gribenko [Thu, 9 May 2013 21:02:07 +0000 (21:02 +0000)]
ArrayRef'ize some SemaOverload methods

Patch by Robert Wilhelm.

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

11 years ago[ms-cxxabi] Implement member pointer conversions
Reid Kleckner [Thu, 9 May 2013 21:01:17 +0000 (21:01 +0000)]
[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

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

11 years agoDebug Info: Remove unnecessary check for dependent array types
David Blaikie [Thu, 9 May 2013 20:48:12 +0000 (20:48 +0000)]
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.

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

11 years agoFix captured statements codegen test on ARM
Ben Langmuir [Thu, 9 May 2013 20:42:43 +0000 (20:42 +0000)]
Fix captured statements codegen test on ARM

The return type of the destructor may vary between platforms, so stop
inadvertently testing it.

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

11 years agoCodeGen for CapturedStmts
Ben Langmuir [Thu, 9 May 2013 19:17:11 +0000 (19:17 +0000)]
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

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

11 years agoSwitch C++1y paper links back to the canonical location at open-std.org now that...
Richard Smith [Thu, 9 May 2013 18:53:17 +0000 (18:53 +0000)]
Switch C++1y paper links back to the canonical location at open-std.org now that the post-Bristol mailing has shipped.

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

11 years agoAdd testcase missed from r181527.
Richard Smith [Thu, 9 May 2013 18:33:50 +0000 (18:33 +0000)]
Add testcase missed from r181527.

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

11 years agoFix the return type of the complex creal functions. Patch by YunZhong Gao, modified...
Richard Smith [Thu, 9 May 2013 17:41:19 +0000 (17:41 +0000)]
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.

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

11 years agoRemove trailing whitespace
David Blaikie [Thu, 9 May 2013 17:29:54 +0000 (17:29 +0000)]
Remove trailing whitespace

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

11 years ago[doc parsing]: make single character command impostures
Fariborz Jahanian [Thu, 9 May 2013 17:18:52 +0000 (17:18 +0000)]
[doc parsing]: make single character command impostures
warn in pedantic mode.

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

11 years agoAdding isConst() ASTMatcher for CXXMethodDecl nodes
Edwin Vane [Thu, 9 May 2013 17:00:17 +0000 (17:00 +0000)]
Adding isConst() ASTMatcher for CXXMethodDecl nodes

Updated reference and unit tests.

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

11 years ago[doc parsing]: So, in this patch, single character
Fariborz Jahanian [Thu, 9 May 2013 16:44:02 +0000 (16:44 +0000)]
[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

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

11 years agoUpdating LibASTMatchersReference to include namespaceDecl()
Edwin Vane [Thu, 9 May 2013 16:42:37 +0000 (16:42 +0000)]
Updating LibASTMatchersReference to include namespaceDecl()

The namespaceDecl() ASTMatcher was added in r179027.

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

11 years ago[doc parsing]: don't attempt to fix single character
Fariborz Jahanian [Thu, 9 May 2013 16:22:31 +0000 (16:22 +0000)]
[doc parsing]: don't attempt to fix single character
commands (\t \n are common). \\ rdar://12381408

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

11 years agoxopintrin.h: Add wrappers for all flavors of _mm_com.
Benjamin Kramer [Thu, 9 May 2013 15:07:46 +0000 (15:07 +0000)]
xopintrin.h: Add wrappers for all flavors of _mm_com.

GCC defines only the wrappers, MSVC defines both, we define both now too.
PR15844.

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

11 years agoAdd include guards to prfchwintrin.h.
Benjamin Kramer [Thu, 9 May 2013 15:07:39 +0000 (15:07 +0000)]
Add include guards to prfchwintrin.h.

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

11 years agoImplement C++1y constant initializer rules: in a constant initializer for an
Richard Smith [Thu, 9 May 2013 07:14:00 +0000 (07:14 +0000)]
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.

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

11 years ago[analyzer; alternate arrows] for "loop back" edges add back the extra edge to the...
Ted Kremenek [Thu, 9 May 2013 06:55:41 +0000 (06:55 +0000)]
[analyzer; alternate arrows] for "loop back" edges add back the extra edge to the closing '}'

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

11 years ago[analyzer;alternate arrows] adapt 'for' loop aesthetic cleanup to 'while' loops.
Ted Kremenek [Thu, 9 May 2013 06:55:35 +0000 (06:55 +0000)]
[analyzer;alternate arrows] adapt 'for' loop aesthetic cleanup to 'while' loops.

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

11 years agoPut some diagnostics in DiagnosticCommonKinds.td in a category, mirroring what they...
Ted Kremenek [Thu, 9 May 2013 00:07:27 +0000 (00:07 +0000)]
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.

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

11 years agoObjective-C: Correctly encode 'retain' and 'copy' for readonly properties.
Nico Weber [Wed, 8 May 2013 23:47:40 +0000 (23:47 +0000)]
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.

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

11 years ago[PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.
Argyrios Kyrtzidis [Wed, 8 May 2013 23:46:55 +0000 (23:46 +0000)]
[PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.

This made sense in pre-module era, before merging of HeaderFileInfos was introduced.

Final part of rdar://13840148.

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

11 years ago[modules] When building a module, make sure we don't serialize out HeaderFileInfo...
Argyrios Kyrtzidis [Wed, 8 May 2013 23:46:46 +0000 (23:46 +0000)]
[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

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

11 years agoput noisy "unknown command tag name" warning
Fariborz Jahanian [Wed, 8 May 2013 23:38:56 +0000 (23:38 +0000)]
put noisy "unknown command tag name"  warning
under -Wdocumentation-unknown-command and off by default.
patch by Dmitri Gribenko.

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

11 years agotypo
Adrian Prantl [Wed, 8 May 2013 23:37:22 +0000 (23:37 +0000)]
typo

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

11 years agoComment: use \code...\endcode for code examples
Dmitri Gribenko [Wed, 8 May 2013 23:09:44 +0000 (23:09 +0000)]
Comment: use \code...\endcode for code examples

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

11 years agoAll -Wdocumentation warnings are DefaultIgnore
Dmitri Gribenko [Wed, 8 May 2013 22:54:41 +0000 (22:54 +0000)]
All -Wdocumentation warnings are DefaultIgnore

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

11 years agounbreak buildbot.
Fariborz Jahanian [Wed, 8 May 2013 22:52:20 +0000 (22:52 +0000)]
unbreak buildbot.

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

11 years ago[doc parsing]: Also do typo correction for
Fariborz Jahanian [Wed, 8 May 2013 22:14:28 +0000 (22:14 +0000)]
[doc parsing]: Also do typo correction for
dynamically registered commands.
// rdar://12381408

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

11 years agoFix test in two ways: remove incorrect comment (the intrinsic generated now
Eli Bendersky [Wed, 8 May 2013 20:58:01 +0000 (20:58 +0000)]
Fix test in two ways: remove incorrect comment (the intrinsic generated now
is of the llvm.sjlj.* flavore) and convert grep->FileCheck

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

11 years agoAdd missing triple to unit test.
Richard Smith [Wed, 8 May 2013 20:32:14 +0000 (20:32 +0000)]
Add missing triple to unit test.

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

11 years agoTurn off a warning caused by my last patch.
Fariborz Jahanian [Wed, 8 May 2013 20:29:57 +0000 (20:29 +0000)]
Turn off a warning caused by my last patch.

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

11 years agodocumentation parsing. Patch to do typo correction for
Fariborz Jahanian [Wed, 8 May 2013 19:21:00 +0000 (19:21 +0000)]
documentation parsing. Patch to do typo correction for
documentation commands. Patch was reviewed, along with
great suggestions for improvement, by Doug.
// rdar://12381408

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

11 years agoFurther fix to pointer to member formatting.
Daniel Jasper [Wed, 8 May 2013 15:06:58 +0000 (15:06 +0000)]
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;

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

11 years agoFix formatting of pointers to members.
Daniel Jasper [Wed, 8 May 2013 14:58:20 +0000 (14:58 +0000)]
Fix formatting of pointers to members.

Before: int(S::*func)(void *);
After:  int (S::*func)(void *);

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

11 years agoDocument Clang's support for #pragma comment(lib/linker) with -fms-extensions
Reid Kleckner [Wed, 8 May 2013 14:40:51 +0000 (14:40 +0000)]
Document Clang's support for #pragma comment(lib/linker) with -fms-extensions

As suggested by Dmitri Gribenko.

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

11 years agoImprove line breaking in binary expressions.
Daniel Jasper [Wed, 8 May 2013 14:12:04 +0000 (14:12 +0000)]
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;

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

11 years agoForward #pragma comment(lib/linker) through as flags metadata
Reid Kleckner [Wed, 8 May 2013 13:44:39 +0000 (13:44 +0000)]
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

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

11 years agoChange indentation of multi-line nested name specifiers.
Daniel Jasper [Wed, 8 May 2013 10:00:18 +0000 (10:00 +0000)]
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

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

11 years agoFix one FIXME in VTableBuilder
Timur Iskhodzhanov [Wed, 8 May 2013 08:09:21 +0000 (08:09 +0000)]
Fix one FIXME in VTableBuilder

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

11 years agoDebug Info: Using declarations/DW_TAG_imported_declaration of variables, types, and...
David Blaikie [Wed, 8 May 2013 06:01:46 +0000 (06:01 +0000)]
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).

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

11 years agoIn block enum-return inference, don't die on loads of enum lvalues.
John McCall [Wed, 8 May 2013 03:34:22 +0000 (03:34 +0000)]
In block enum-return inference, don't die on loads of enum lvalues.

More of rdar://13200889.

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

11 years agoAdd test forgotten in r181388.
Richard Smith [Wed, 8 May 2013 02:38:36 +0000 (02:38 +0000)]
Add test forgotten in r181388.

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

11 years agoC++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
Richard Smith [Wed, 8 May 2013 02:12:03 +0000 (02:12 +0000)]
C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.

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

11 years ago[analyzer; alternate edges] insert an extra edge for 'for' statements to conditions.
Ted Kremenek [Wed, 8 May 2013 01:15:24 +0000 (01:15 +0000)]
[analyzer; alternate edges] insert an extra edge for 'for' statements to conditions.

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

11 years ago[analyzer;alternate edges] edges from subexpressions of "?:" are important to retain
Ted Kremenek [Wed, 8 May 2013 01:15:20 +0000 (01:15 +0000)]
[analyzer;alternate edges] edges from subexpressions of "?:" are important to retain

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

11 years agoC++1y constant expression evaluation: compound assignment support for floating-point...
Richard Smith [Tue, 7 May 2013 23:34:45 +0000 (23:34 +0000)]
C++1y constant expression evaluation: compound assignment support for floating-point and pointer types.

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

11 years agoThe style guide prefers preincrement expressions :-)
Adrian Prantl [Tue, 7 May 2013 22:41:09 +0000 (22:41 +0000)]
The style guide prefers preincrement expressions :-)

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

11 years agoremove commented out code.
Adrian Prantl [Tue, 7 May 2013 22:26:03 +0000 (22:26 +0000)]
remove commented out code.

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

11 years agoWhen typo correction produces an overloaded result when looking up a member,
Nick Lewycky [Tue, 7 May 2013 22:14:37 +0000 (22:14 +0000)]
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.

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

11 years agoDon't crash in IRGen if a conditional with 'throw' in one of its branches is
Richard Smith [Tue, 7 May 2013 21:53:22 +0000 (21:53 +0000)]
Don't crash in IRGen if a conditional with 'throw' in one of its branches is
used as a branch condition.

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

11 years agoFix crash on invalid in template type diffing.
Richard Trieu [Tue, 7 May 2013 21:36:24 +0000 (21:36 +0000)]
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.

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

11 years ago[analyzer;alternate arrows] Fix inconsistencies in recorded location context when...
Ted Kremenek [Tue, 7 May 2013 21:12:06 +0000 (21:12 +0000)]
[analyzer;alternate arrows] Fix inconsistencies in recorded location context when handling interprocedural paths.

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

11 years ago[analyzer; alternate arrows] add back recording whether we visited the first edge.
Ted Kremenek [Tue, 7 May 2013 21:12:03 +0000 (21:12 +0000)]
[analyzer; alternate arrows] add back recording whether we visited the first edge.

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

11 years ago[analyzer; alternate arrows] remove pruning of loop diagnostics.
Ted Kremenek [Tue, 7 May 2013 21:12:00 +0000 (21:12 +0000)]
[analyzer; alternate arrows] remove pruning of loop diagnostics.

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

11 years ago[analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.
Ted Kremenek [Tue, 7 May 2013 21:11:57 +0000 (21:11 +0000)]
[analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.

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

11 years ago[analyzer; alternate arrows] include an edge from the "break" or "continue"
Ted Kremenek [Tue, 7 May 2013 21:11:54 +0000 (21:11 +0000)]
[analyzer; alternate arrows] include an edge from the "break" or "continue"

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

11 years ago[analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no...
Ted Kremenek [Tue, 7 May 2013 21:11:52 +0000 (21:11 +0000)]
[analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no value.

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

11 years ago[analyzer; alternate arrows] the initializer of a ForStmt isn't interesting either.
Ted Kremenek [Tue, 7 May 2013 21:11:49 +0000 (21:11 +0000)]
[analyzer; alternate arrows] the initializer of a ForStmt isn't interesting either.

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

11 years ago[libclang] Add a null check in CursorVisitor::visitPreprocessedEntities.
Argyrios Kyrtzidis [Tue, 7 May 2013 20:37:17 +0000 (20:37 +0000)]
[libclang] Add a null check in CursorVisitor::visitPreprocessedEntities.

rdar://13680583

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

11 years agoWe're in 3.4 land now.
Bill Wendling [Tue, 7 May 2013 20:31:37 +0000 (20:31 +0000)]
We're in 3.4 land now.

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

11 years agoTry to recognise hidden tag type names in potential declarations, in ObjC code as...
Argyrios Kyrtzidis [Tue, 7 May 2013 19:54:28 +0000 (19:54 +0000)]
Try to recognise hidden tag type names in potential declarations, in ObjC code as well.

rdar://13829073

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

11 years agoC++1y: Update __cplusplus to temporary value 201305L to allow detection of provisiona...
Richard Smith [Tue, 7 May 2013 19:32:56 +0000 (19:32 +0000)]
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.

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

11 years ago[analyzer] Fix a crash triggered by printing a note on a default argument
Anna Zaks [Tue, 7 May 2013 17:42:42 +0000 (17:42 +0000)]
[analyzer] Fix a crash triggered by printing a note on a default argument

Instead, use the location of the call to print the note.

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

11 years ago[analyzer; alternate arrows] The ForStmt increment is not a critical anchor for arrows.
Ted Kremenek [Tue, 7 May 2013 17:02:41 +0000 (17:02 +0000)]
[analyzer; alternate arrows] The ForStmt increment is not a critical anchor for arrows.

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

11 years agoTest commit
Serge Pavlov [Tue, 7 May 2013 16:56:03 +0000 (16:56 +0000)]
Test commit

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

11 years agoPrevent crashes from hasCanonicalType matcher
Edwin Vane [Tue, 7 May 2013 15:53:23 +0000 (15:53 +0000)]
Prevent crashes from hasCanonicalType matcher

Adding an QualType::isNull() check.

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

11 years agoConfig file support for clang-format, part 1.
Alexander Kornienko [Tue, 7 May 2013 15:32:14 +0000 (15:32 +0000)]
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

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

11 years agoCorrectly recognize dereference after 'delete'.
Daniel Jasper [Tue, 7 May 2013 14:17:18 +0000 (14:17 +0000)]
Correctly recognize dereference after 'delete'.

With certain styles:
Before: delete* x;
After:  delete *x;

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

11 years agoFurther fix to clang-format emacs integration.
Daniel Jasper [Tue, 7 May 2013 10:04:47 +0000 (10:04 +0000)]
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.

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

11 years agoFix clang-format emacs integration in last line.
Daniel Jasper [Tue, 7 May 2013 09:25:29 +0000 (09:25 +0000)]
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.

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

11 years ago[analyzer; alternate edges] simplify optimization rules to look at control-flow condi...
Ted Kremenek [Tue, 7 May 2013 07:30:07 +0000 (07:30 +0000)]
[analyzer; alternate edges] simplify optimization rules to look at control-flow conditions to prune edges.

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

11 years ago[analyzer; alternate arrows] use the terminator condition as the location for 'enteri...
Ted Kremenek [Tue, 7 May 2013 07:30:00 +0000 (07:30 +0000)]
[analyzer; alternate arrows] use the terminator condition as the location for 'entering loop body'

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

11 years agoWeaken an assertion in memcpyization to account for
John McCall [Tue, 7 May 2013 05:20:46 +0000 (05:20 +0000)]
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

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

11 years agoC++1y constant expression evaluation: support for compound assignments on integers.
Richard Smith [Tue, 7 May 2013 04:50:00 +0000 (04:50 +0000)]
C++1y constant expression evaluation: support for compound assignments on integers.

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

11 years agoHave SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.
Argyrios Kyrtzidis [Tue, 7 May 2013 04:29:22 +0000 (04:29 +0000)]
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

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

11 years agoC++1y: an assignment operator is implicitly 'constexpr' if it would only call 'conste...
Richard Smith [Tue, 7 May 2013 03:19:20 +0000 (03:19 +0000)]
C++1y: an assignment operator is implicitly 'constexpr' if it would only call 'constexpr' assignment operators for a literal class type.

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

11 years agoC++ status:
Richard Smith [Tue, 7 May 2013 02:55:48 +0000 (02:55 +0000)]
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

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

11 years ago[analyzer; alternate arrows] provide a diagnostic for entering a loop for the first...
Ted Kremenek [Tue, 7 May 2013 01:18:10 +0000 (01:18 +0000)]
[analyzer; alternate arrows] provide a diagnostic for entering a loop for the first time.

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

11 years agoDebugInfo: Support imported modules (using directives) within lexical blocks.
David Blaikie [Mon, 6 May 2013 23:33:13 +0000 (23:33 +0000)]
DebugInfo: Support imported modules (using directives) within lexical blocks.

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

11 years ago[analyzer; alternate arrows] don't increment the path iterator when we just deleted...
Ted Kremenek [Mon, 6 May 2013 21:59:37 +0000 (21:59 +0000)]
[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.

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

11 years agoGrab-bag of bit-field fixes:
John McCall [Mon, 6 May 2013 21:39:12 +0000 (21:39 +0000)]
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.

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

11 years agoAdd missing initialization for Sema::CurScope. This is important for AST consumers...
Richard Smith [Mon, 6 May 2013 21:35:35 +0000 (21:35 +0000)]
Add missing initialization for Sema::CurScope. This is important for AST consumers which don't create a Parser. Pointed out by Tom Honermann.

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

11 years agoMove PragmaCommentHandler to lib/Parse in preparation for calling Sema
Reid Kleckner [Mon, 6 May 2013 21:02:12 +0000 (21:02 +0000)]
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

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

11 years agoModify ASTReaderListener to allow visiting the input files of an AST file.
Argyrios Kyrtzidis [Mon, 6 May 2013 19:23:40 +0000 (19:23 +0000)]
Modify ASTReaderListener to allow visiting the input files of an AST file.

We can pass such an input-file-visiting ASTReaderListener to ASTReader::readASTFileControlBlock.

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

11 years agoHave the RecursiveASTVisitor traverse the type source info of an objc class message.
Argyrios Kyrtzidis [Mon, 6 May 2013 19:08:57 +0000 (19:08 +0000)]
Have the RecursiveASTVisitor traverse the type source info of an objc class message.

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

11 years ago[analyzer] Remove now-unused bindCompoundLiteral helper function.
Jordan Rose [Mon, 6 May 2013 16:48:26 +0000 (16:48 +0000)]
[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.

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

11 years ago[analyzer] Handle CXXTemporaryObjectExprs in compound literals.
Jordan Rose [Mon, 6 May 2013 16:48:20 +0000 (16:48 +0000)]
[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>

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

11 years agoFix representation of compound literals for C++ objects with destructors.
Jordan Rose [Mon, 6 May 2013 16:48:12 +0000 (16:48 +0000)]
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

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

11 years agoAdd SystemZ support
Ulrich Weigand [Mon, 6 May 2013 16:26:41 +0000 (16:26 +0000)]
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.

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

11 years agoAllow targets to define minimum alignment for global variables
Ulrich Weigand [Mon, 6 May 2013 16:23:57 +0000 (16:23 +0000)]
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.

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