]> granicus.if.org Git - clang/log
clang
11 years agoBetter support for multiline string literals (including C++11 raw string literals).
Alexander Kornienko [Thu, 29 Aug 2013 17:32:57 +0000 (17:32 +0000)]
Better support for multiline string literals (including C++11 raw string literals).

Summary:
Calculate characters in the first and the last line correctly so that
we only break before the literal when needed.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1544

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

11 years agoConsumed analysis: improve handling of conditionals.
DeLesley Hutchins [Thu, 29 Aug 2013 17:26:57 +0000 (17:26 +0000)]
Consumed analysis: improve handling of conditionals.
Patch by chris.wailes@gmail.com.

* The TestedVarsVisitor was folded into the ConsumedStmtVisitor.
* The VarTestResult class was updated to allow these changes.
* The PropagationInfo class was updated for the same reasons.
* Correctly handle short-circuiting of Boolean operations.
* Blocks are now marked as unreachable when we can statically prove we will
  never branch to them.
* Unreachable blocks are skipped by the analysis.

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

11 years agoObjectiveC migrator: remove dead code.
Fariborz Jahanian [Thu, 29 Aug 2013 16:22:26 +0000 (16:22 +0000)]
ObjectiveC migrator: remove dead code.

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

11 years agoclang/test/Frontend/rewrite-includes.c: Tweak expressions for r'\\', not r'\', on...
NAKAMURA Takumi [Thu, 29 Aug 2013 16:11:17 +0000 (16:11 +0000)]
clang/test/Frontend/rewrite-includes.c: Tweak expressions for r'\\', not r'\', on win32.

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

11 years ago[analyzer] Fix handling of "empty" structs with base classes
Pavel Labath [Thu, 29 Aug 2013 16:06:04 +0000 (16:06 +0000)]
[analyzer] Fix handling of "empty" structs with base classes

Summary:
RegionStoreManager had an optimization which replaces references to empty
structs with UnknownVal. Unfortunately, this check didn't take into account
possible field members in base classes.

To address this, I changed this test to "is empty and has no base classes". I
don't consider it worth the trouble to go through base classes and check if all
of them are empty.

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1547

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

11 years agoFix tests to be more specific.
Samuel Benzaquen [Thu, 29 Aug 2013 15:39:26 +0000 (15:39 +0000)]
Fix tests to be more specific.
The environments can inject some declaration in every translation unit,
which can match very generic matchers, thus failing the tests.

Summary:
Fix tests to be more specific.
The environments can inject some declaration in every translation unit,
which can match very generic matchers, thus failing the tests.

Reviewers: aaron.ballman

CC: klimek, cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1541

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

11 years agoFixes various problems with accounting for tabs in the original code.
Manuel Klimek [Thu, 29 Aug 2013 15:21:40 +0000 (15:21 +0000)]
Fixes various problems with accounting for tabs in the original code.

We now count the original token's column directly when lexing the
tokens, where we already have all knowledge about where lines start.

Before this patch, formatting:
 void f() {
 \tg();
 \th();
 }
would incorrectly count the \t's as 1 character if only the line
containing h() was reformatted, and thus indent h() at offset 1.

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

11 years agoUse new UnicodeCharSet interface.
Alexander Kornienko [Thu, 29 Aug 2013 12:12:31 +0000 (12:12 +0000)]
Use new UnicodeCharSet interface.

Summary: This is a Clang part of http://llvm-reviews.chandlerc.com/D1534

Reviewers: jordan_rose, klimek, rsmith

Reviewed By: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1535

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

11 years agoRemoved useless default branch of switch statement.
Serge Pavlov [Thu, 29 Aug 2013 08:20:07 +0000 (08:20 +0000)]
Removed useless default branch of switch statement.
The problem was caught by sanitizer build.

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

11 years ago mangle aarch64 Neon ACLE scalar instrinsic name with BHSD suffix.
Kevin Qin [Thu, 29 Aug 2013 07:55:15 +0000 (07:55 +0000)]
 mangle aarch64 Neon ACLE scalar instrinsic name with BHSD suffix.

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

11 years agoChange return type of Sema::DiagnoseAmbiguousLookup from bool to void.
Serge Pavlov [Thu, 29 Aug 2013 07:23:24 +0000 (07:23 +0000)]
Change return type of Sema::DiagnoseAmbiguousLookup from bool to void.
The function always returned true value, which was never used.

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

11 years agoMake getDiagnosticsInGroup helper method a static function in the cpp file and move...
Craig Topper [Thu, 29 Aug 2013 06:06:18 +0000 (06:06 +0000)]
Make getDiagnosticsInGroup helper method a static function in the cpp file and move the WarningOption struct into an anonymous namespace instead of clang namespace since it no longer needs to be forward declared in the header.

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

11 years agoMove individual group name strings from the OptionTable into one big char array....
Craig Topper [Thu, 29 Aug 2013 05:18:04 +0000 (05:18 +0000)]
Move individual group name strings from the OptionTable into one big char array. Then only store offsets into it in the OptionTable. Saves about 4K from the clang binary and removes 400 relocation entries from DiagnosticIDs.o.

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

11 years ago[tests] Use 'printf' instead of 'echo -e', which is not part of BSD echo.
Daniel Dunbar [Thu, 29 Aug 2013 03:02:39 +0000 (03:02 +0000)]
[tests] Use 'printf' instead of 'echo -e', which is not part of BSD echo.

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

11 years agoTwo more definitions required by libsupc++ (_sleb128_t and _uleb128_t)
Peter Collingbourne [Thu, 29 Aug 2013 01:56:22 +0000 (01:56 +0000)]
Two more definitions required by libsupc++ (_sleb128_t and _uleb128_t)

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

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

11 years agoProperly escape filenames in line directives.
Eli Friedman [Thu, 29 Aug 2013 01:42:42 +0000 (01:42 +0000)]
Properly escape filenames in line directives.

Fixes PR17018.  Only partial test coverage because I don't want
to try to write a test which generates a file whose name contains a newline.

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

11 years agoRemove Inheritable/NonInheritable flags from ProcessDeclAttributes. They don't
Richard Smith [Thu, 29 Aug 2013 00:47:48 +0000 (00:47 +0000)]
Remove Inheritable/NonInheritable flags from ProcessDeclAttributes. They don't
do anything useful.

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

11 years agouse the last passed -munaligned-access / -mno-unaligned-access
Renato Golin [Wed, 28 Aug 2013 23:56:07 +0000 (23:56 +0000)]
use the last passed -munaligned-access / -mno-unaligned-access

Passing inconsistent munaligned-access / mno-unaligned-access
flags, intentionally resulted in a warning and the flag
no-unaligned-access being used.

Gcc does, at least in practice, use the last flag in such a
case. This patch updates clang behaviour accordingly; use the
last flag or base alignment behaviour on the target (which
llvm will do if no flag is explicitly passed)

Patch by Jeroen Hofstee.

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

11 years agoSema: Subst type default template args earlier
David Majnemer [Wed, 28 Aug 2013 23:48:32 +0000 (23:48 +0000)]
Sema: Subst type default template args earlier

Summary:
We would not perform substitution at an appropriate point, allowing strange
results to appear. We would accepts things that we shouldn't or mangle things incorrectly.  Note that this hasn't fixed the other cases like
template-template parameters or non-type template parameters.

Reviewers: doug.gregor, rjmccall, rsmith

Reviewed By: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1507

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

11 years ago80 cols.
Peter Collingbourne [Wed, 28 Aug 2013 23:32:22 +0000 (23:32 +0000)]
80 cols.

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

11 years agoObjectiveC migrator. This patch infers readonly properties for no-parameter
Fariborz Jahanian [Wed, 28 Aug 2013 23:22:46 +0000 (23:22 +0000)]
ObjectiveC migrator. This patch infers readonly properties for no-parameter
instance methods returning non-void. This will be quite noisy. So, it is
placed under a new migrator flag -objcmt-migrate-readonly-property.

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

11 years agoLook for libstdc++ first on the clang install directory.
Rafael Espindola [Wed, 28 Aug 2013 23:17:47 +0000 (23:17 +0000)]
Look for libstdc++ first on the clang install directory.

When sysroot is not set, look for libstdc++ first on the clang install
directory. Before this change if clang was installed alongside a gcc with
the same version as the system one we would select the system libstdc++.

Unfortunately this is hard to test as only the non-sysroot case is changed.

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

11 years agoAdd missing definitions to unwind.h.
Peter Collingbourne [Wed, 28 Aug 2013 23:16:49 +0000 (23:16 +0000)]
Add missing definitions to unwind.h.

Original patch by Charles Davis.

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

11 years agoMode is now handled as a non-inheritable attribute, and CUDADevice & CUDAHost are...
Aaron Ballman [Wed, 28 Aug 2013 23:13:26 +0000 (23:13 +0000)]
Mode is now handled as a non-inheritable attribute, and CUDADevice & CUDAHost are now handled as inheritable attributes.  In all three cases, this makes the processing behavior more consistent with the declared behavior in Attr.td.

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

11 years ago80-col.
Eric Christopher [Wed, 28 Aug 2013 23:12:10 +0000 (23:12 +0000)]
80-col.

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

11 years agoDebugInfo: Further fix/improvements to r189494 (and LLVM r189495).
David Blaikie [Wed, 28 Aug 2013 23:06:52 +0000 (23:06 +0000)]
DebugInfo: Further fix/improvements to r189494 (and LLVM r189495).

Selfhosting was crashing with the same type of problem but involving
template specializations.

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

11 years ago[doxygen] Add a few missing variables to the doxygen.cfg.in for external search and...
Michael Gottesman [Wed, 28 Aug 2013 21:55:41 +0000 (21:55 +0000)]
[doxygen] Add a few missing variables to the doxygen.cfg.in for external search and cleaned up external_search_map.

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

11 years agoFormat. Thanks David for pointing it out.
Manman Ren [Wed, 28 Aug 2013 21:46:36 +0000 (21:46 +0000)]
Format. Thanks David for pointing it out.

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

11 years agoObjectiveC migrator: In suggesting 'instancetype' use clang's
Fariborz Jahanian [Wed, 28 Aug 2013 21:23:00 +0000 (21:23 +0000)]
ObjectiveC migrator: In suggesting 'instancetype' use clang's
hasRelatedResultType() as it knows of methods which have
related result type by default. Such methods do not need
a redundant 'instancetype'.

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

11 years agoDebug Info: update interface for CreateEnumType and getOrCreateRecordFwdDecl.
Manman Ren [Wed, 28 Aug 2013 21:20:28 +0000 (21:20 +0000)]
Debug Info: update interface for CreateEnumType and getOrCreateRecordFwdDecl.

Both functions will take a Type pointer instead of a Decl pointer. This helps
with follow-up type uniquing patches, which need the Type pointer to call
CXX mangler to generate unique identifiers.

No functionality change.

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

11 years agoDebug Info testing case: update uuid testing case to check against Itanium.
Manman Ren [Wed, 28 Aug 2013 21:19:31 +0000 (21:19 +0000)]
Debug Info testing case: update uuid testing case to check against Itanium.

Right now, the output for Itanium vs. Microsoft is the same. Once we start
calling mangler to get the unique identifier, this testing case will require
support for uuid mangling.

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

11 years agoMore comments for r189494.
David Blaikie [Wed, 28 Aug 2013 20:58:00 +0000 (20:58 +0000)]
More comments for r189494.

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

11 years agoFix "//" comments with -traditional-cpp in C++.
Eli Friedman [Wed, 28 Aug 2013 20:53:32 +0000 (20:53 +0000)]
Fix "//" comments with -traditional-cpp in C++.

Apparently, gcc's -traditional-cpp behaves slightly differently in C++ mode;
specifically, it discards "//" comments.  Match gcc's behavior.

<rdar://problem/14808126>

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

11 years agoFor methods where clang automatically infers instancetype from the selector
Fariborz Jahanian [Wed, 28 Aug 2013 20:49:58 +0000 (20:49 +0000)]
For methods where clang automatically infers instancetype from the selector
(e.g., all -init* methods), no need to suggest "instancetype" because it
is redundant.

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

11 years agoHandle -D arguments ending in a backslash.
Eli Friedman [Wed, 28 Aug 2013 20:35:38 +0000 (20:35 +0000)]
Handle -D arguments ending in a backslash.

We translate these into #define directives; to preserve gcc-compatible
semantics (where the expanded macro includes the backslash), we add
an extra "\\\n" to the end of the synthesized "#define".

<rdar://problem/14810220>

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

11 years agoImprove error for assignment to incomplete class.
Eli Friedman [Wed, 28 Aug 2013 20:35:35 +0000 (20:35 +0000)]
Improve error for assignment to incomplete class.

PR7681.

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

11 years ago[doxygen] Added support for doxygen external search.
Michael Gottesman [Wed, 28 Aug 2013 20:29:44 +0000 (20:29 +0000)]
[doxygen] Added support for doxygen external search.

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

11 years ago[doxygen] Added code for generating doxygen documentation for clang for cmake.
Michael Gottesman [Wed, 28 Aug 2013 20:29:40 +0000 (20:29 +0000)]
[doxygen] Added code for generating doxygen documentation for clang for cmake.

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

11 years agoComments for r189494
David Blaikie [Wed, 28 Aug 2013 20:24:55 +0000 (20:24 +0000)]
Comments for r189494

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

11 years agoAdd support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.
Samuel Benzaquen [Wed, 28 Aug 2013 18:42:04 +0000 (18:42 +0000)]
Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.

Summary:
Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.
These function require some late binding behavior for the type conversions, thus changes in VariadicValue's MatcherList.
Second try. This time with a fix for C++11 builds.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1536

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

11 years agoDebug Info testing case: move uuid-related testing to a separate file.
Manman Ren [Wed, 28 Aug 2013 18:31:02 +0000 (18:31 +0000)]
Debug Info testing case: move uuid-related testing to a separate file.

Seperate the parts related to uuid from debug-info-template.cpp to
debug-info-uuid.cpp since Itanium mangler does not have support for mangling
uuid yet.

Remove -fms-extensions from RUN line of debug-info-template.cpp.
RUN line of debug-info-uuid.cpp has -fms-extensions and -cxx-abi microsoft.

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

11 years agoclang-cl: Pass -debug to the linker when using -fsanitize=address
Hans Wennborg [Wed, 28 Aug 2013 17:36:07 +0000 (17:36 +0000)]
clang-cl: Pass -debug to the linker when using -fsanitize=address

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

11 years agoPR16995: Failing to associate static members with their enclosing class
David Blaikie [Wed, 28 Aug 2013 17:27:13 +0000 (17:27 +0000)]
PR16995: Failing to associate static members with their enclosing class

In the transition from declaration (with some members) to definition, we
were overwriting the list of members with the empty list when attaching
template parameters.

The fix is in llvm::DICompositeType::addMember (along with asserts that
cause this bug to be covered by existing Clang test cases), including
adding some asserts to catch this sort of issue which found issues fixed
in this commit.

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

11 years ago[analyzer] Add support for testing the presence of weak functions.
Jordan Rose [Wed, 28 Aug 2013 17:07:04 +0000 (17:07 +0000)]
[analyzer] Add support for testing the presence of weak functions.

When casting the address of a FunctionTextRegion to bool, or when adding
constraints to such an address, use a stand-in symbol to represent the
presence or absence of the function if the function is weakly linked.
This is groundwork for possible simple availability testing checks, and
can already catch mistakes involving inverted null checks for
weakly-linked functions.

Currently, the implementation reuses the "extent" symbols, originally created
for tracking the size of a malloc region. Since FunctionTextRegions cannot
be dereferenced, the extent symbol will never be used for anything else.
Still, this probably deserves a refactoring in the future.

This patch does not attempt to support testing the presence of weak
/variables/ (global variables), which would likely require much more of
a change and a generalization of "region structure metadata", like the
current "extents", vs. "region contents metadata", like CStringChecker's
"string length".

Patch by Richard <tarka.t.otter@googlemail.com>!

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

11 years agoclang-format: Improve token breaking behavior.
Daniel Jasper [Wed, 28 Aug 2013 10:03:58 +0000 (10:03 +0000)]
clang-format: Improve token breaking behavior.

Two changes:
* Don't add an extra penalty on breaking the same token multiple times.
  Generally, we should prefer not to break, but once we break, the
  normal line breaking penalties apply.
* Slightly increase the penalty for breaking comments. In general, the
  author has put some thought into how to break the comment and we
  should not overwrite this unnecessarily.

With a 40-column column limit, formatting
  aaaaaa("aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa");

Leads to:
Before:
  aaaaaa(
      "aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa "
      "aaaaaaaaaaaaaaaa");

After:
  aaaaaa("aaaaaaaaaaaaaaaa "
         "aaaaaaaaaaaaaaaa "
         "aaaaaaaaaaaaaaaa");

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

11 years agoARM: comment on why vmull intrinsic has to exist for now.
Tim Northover [Wed, 28 Aug 2013 09:46:40 +0000 (09:46 +0000)]
ARM: comment on why vmull intrinsic has to exist for now.

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

11 years agoARM: Emit normal IR for vaddhn/vsubhn NEON intrinsics
Tim Northover [Wed, 28 Aug 2013 09:46:37 +0000 (09:46 +0000)]
ARM: Emit normal IR for vaddhn/vsubhn NEON intrinsics

These operations "vector add high-half narrow" actually correspond to the
sequence:

    %sum = add <4 x i32> %lhs, %rhs
    %high = lshr <4 x i32> %sum, <i32 16, i32 16, i32 16, i32 16>
    %res = trunc <4 x i32> %high to <4 x i16>

Now that LLVM can spot this, Clang should emit the corresponding LLVM IR.

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

11 years agoARM: use vqdmull and vqadds/vqsubs to implement vqdmlal/vqdmlsl
Tim Northover [Wed, 28 Aug 2013 09:46:34 +0000 (09:46 +0000)]
ARM: use vqdmull and vqadds/vqsubs to implement vqdmlal/vqdmlsl

The NEON intrinsics vqdmlal and vqdmlsl are really just combinations of a
saturating-doubling-multiply (vqdmull) and a saturating add/sub, so now that
LLVM can spot those patterns Clang should emit them instead of specialised
intrinsics.

Feature already tested by existing ARM NEON intrinsics tests.

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

11 years agoclang-format: Fix segfault in 'incomplete' macros.
Daniel Jasper [Wed, 28 Aug 2013 09:17:37 +0000 (09:17 +0000)]
clang-format: Fix segfault in 'incomplete' macros.

The code leading to a segfault was:
  #pragma omp threadprivate(y)), // long comment leading to a line break

This fixes llvm.org/PR16513.

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

11 years agoclang-format: Fix infinite loop in macro special case.
Daniel Jasper [Wed, 28 Aug 2013 09:07:32 +0000 (09:07 +0000)]
clang-format: Fix infinite loop in macro special case.

If escaped newlines are aligned right
(FormatStyle.AlignEscapedNewlinesLeft == false), and a line contained
too many characters to fit into the column limit, this would result in
a (virtually) endless loop creating a negative number of spaces.

Instead, allow the escaped newlines to be pushed past the column limit
in this case.

This fixes llvm.org/PR16515.

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

11 years agoclang-format: Don't insert space in __has_include
Daniel Jasper [Wed, 28 Aug 2013 08:24:04 +0000 (08:24 +0000)]
clang-format: Don't insert space in __has_include

Before:
  #if __has_include( <strstream>)
  #include <strstream>
  #endif

After:
  #if __has_include(<strstream>)
  #include <strstream>
  #endif

This fixes llvm.org/PR16516.

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

11 years agoclang-format: Fix corner case in ObjC interface definitions.
Daniel Jasper [Wed, 28 Aug 2013 08:04:23 +0000 (08:04 +0000)]
clang-format: Fix corner case in ObjC interface definitions.

In
  @implementation ObjcClass
  - (void)method;
  {
  }
  @end
the ObjC compiler seems to accept the superfluous comma after "method",
but clang-format used to assert on the subsequent "{".

This fixes llvm.org/PR16604.

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

11 years ago[analyzer] Assume new returns non-null even under -fno-exceptions
Pavel Labath [Wed, 28 Aug 2013 08:04:08 +0000 (08:04 +0000)]
[analyzer] Assume new returns non-null even under -fno-exceptions

Summary:
-fno-exceptions does not implicitly attach a nothrow specifier to every operator
new. Even in this mode, non-nothrow new must not return a null pointer. Failure
to allocate memory can be signalled by other means, or just by killing the
program. This behaviour is consistent with the compiler - even with
-fno-exceptions, the generated code never tests for null (and would segfault if
the opeator actually happened to return null).

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1528

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

11 years agoclang-format: Improve braced init list detection:
Daniel Jasper [Wed, 28 Aug 2013 07:50:37 +0000 (07:50 +0000)]
clang-format: Improve braced init list detection:

Before:
  std::this_thread::sleep_for(std::chrono::nanoseconds{
    std::chrono::seconds { 1 }
  } /
                              5);

After:
  std::this_thread::sleep_for(
      std::chrono::nanoseconds{ std::chrono::seconds{ 1 } } / 5);

This fixes llvm.org/PR16554.

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

11 years agoclang-format: Fix corner case in overloaded operator definitions.
Daniel Jasper [Wed, 28 Aug 2013 07:27:35 +0000 (07:27 +0000)]
clang-format: Fix corner case in overloaded operator definitions.

Before:
  SomeLoooooooooooooooooooooooooogType operator>
      >(const SomeLooooooooooooooooooooooooogType &other);
  SomeLoooooooooooooooooooooooooogType // break
      operator>>(const SomeLooooooooooooooooooooooooogType &other);

After:
  SomeLoooooooooooooooooooooooooogType
  operator>>(const SomeLooooooooooooooooooooooooogType &other);
  SomeLoooooooooooooooooooooooooogType // break
  operator>>(const SomeLooooooooooooooooooooooooogType &other);

This fixes llvm.org/PR16328.

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

11 years agoclang-format: Fix space in decltype-constexprs.
Daniel Jasper [Wed, 28 Aug 2013 07:07:07 +0000 (07:07 +0000)]
clang-format: Fix space in decltype-constexprs.

Before:
  static constexpr bool Bar = decltype(bar()) ::value;

After:
  static constexpr bool Bar = decltype(bar())::value;

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

11 years agoRemove comment on the availability of boxed expressions. They have been available...
Ted Kremenek [Wed, 28 Aug 2013 06:03:59 +0000 (06:03 +0000)]
Remove comment on the availability of boxed expressions.  They have been available for a while.

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

11 years agoReorder and shrink size of NameLen field in diagnostic group table. Shaves ~4K from...
Craig Topper [Wed, 28 Aug 2013 06:01:10 +0000 (06:01 +0000)]
Reorder and shrink size of NameLen field in diagnostic group table. Shaves ~4K from clang binary.

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

11 years agoRichard makes a good point, clean up this test.
David Majnemer [Wed, 28 Aug 2013 05:45:53 +0000 (05:45 +0000)]
Richard makes a good point, clean up this test.

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

11 years ago[CMake] use combination of CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_LIBRARY_OUTPUT_DI...
Ted Kremenek [Wed, 28 Aug 2013 05:38:43 +0000 (05:38 +0000)]
[CMake] use combination of CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_LIBRARY_OUTPUT_DIRECTORY to install clang headers for Xcode builds.

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

11 years agoRevert r189440 - Disable loop vectorizer unrolling when no unrolling requested
Hal Finkel [Wed, 28 Aug 2013 05:21:45 +0000 (05:21 +0000)]
Revert r189440 - Disable loop vectorizer unrolling when no unrolling requested

As Chandler pointed out, we should not be using -backend-option because this
will cause crashes for users of the tooling interface, etc. A better way to fix
this will be to provide the unrolling pass-manager flag to the loop vectorizer
directly.

Original commit message:

Disable loop vectorizer unrolling when no unrolling requested

In addition to the regular loop unrolling transformation, the loop vectorizer
can also unroll loops. If no unrolling has specifically been requested (by
-fno-unroll-loops), and the loop vectorizer will be used, then add the backend
option to (also) prevent the loop vectorizer from unrolling loops.

I confirmed with Nadav (off list) that disabling vectorizer loop unrolling when
-fno-unroll-loops is provided is the desired behavior.

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

11 years agoDisable loop vectorizer unrolling when no unrolling requested
Hal Finkel [Wed, 28 Aug 2013 04:40:22 +0000 (04:40 +0000)]
Disable loop vectorizer unrolling when no unrolling requested

In addition to the regular loop unrolling transformation, the loop vectorizer
can also unroll loops. If no unrolling has specifically been requested (by
-fno-unroll-loops), and the loop vectorizer will be used, then add the backend
option to (also) prevent the loop vectorizer from unrolling loops.

I confirmed with Nadav (off list) that disabling vectorizer loop unrolling when
-fno-unroll-loops is provided is the desired behavior.

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

11 years agoMerge diagnostic group tables to reduce data size and relocation entries.
Craig Topper [Wed, 28 Aug 2013 04:02:50 +0000 (04:02 +0000)]
Merge diagnostic group tables to reduce data size and relocation entries.

The individual group and subgroups tables are now two large tables. The option table stores an index into these two tables instead of pointers. This reduces the size of the options tabe since it doesn't need to store pointers. It also reduces the number of relocations needed.

My build shows this reducing DiagnosticsIDs.o and the clang binary by ~20.5K. It also removes ~400 relocation entries from DiagnosticIDs.o.

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

11 years agocmake: install a cl.exe binary in the tools/msbuild-bin dir
Hans Wennborg [Wed, 28 Aug 2013 01:58:44 +0000 (01:58 +0000)]
cmake: install a cl.exe binary in the tools/msbuild-bin dir

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

11 years agoSome of this test doesn't want -std=c++11
David Majnemer [Wed, 28 Aug 2013 00:13:42 +0000 (00:13 +0000)]
Some of this test doesn't want -std=c++11

Sorry for the churn.

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

11 years agoRevert "Use CMAKE_RUNTIME_OUTPUT_DIRECTORY instead of LLVM_BINARY_DIR for installing...
Ted Kremenek [Wed, 28 Aug 2013 00:07:08 +0000 (00:07 +0000)]
Revert "Use CMAKE_RUNTIME_OUTPUT_DIRECTORY instead of LLVM_BINARY_DIR for installing Clang headers."

This appears to be breaking the buildbots.

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

11 years agoThis test now needs C++11
David Majnemer [Wed, 28 Aug 2013 00:03:12 +0000 (00:03 +0000)]
This test now needs C++11

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

11 years agoAST: Don't treat a TemplateExpansion as a Template
David Majnemer [Wed, 28 Aug 2013 00:00:27 +0000 (00:00 +0000)]
AST: Don't treat a TemplateExpansion as a Template

Summary:
Instead of calling getAsTemplate(), call
getAsTemplateOrTemplatePattern() because it handles the
TemplateExpansion case too.

This fixes PR16997.

Reviewers: doug.gregor, rsmith

Reviewed By: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1512

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

11 years agoRevert "PR14569: Omit debug info for thunks"
David Blaikie [Tue, 27 Aug 2013 23:57:18 +0000 (23:57 +0000)]
Revert "PR14569: Omit debug info for thunks"

This reverts commit r189320.

Alexey Samsonov and Dmitry Vyukov presented some arguments for keeping
these around - though it still seems like those tasks could be solved by
a tool just using the symbol table. In a very small number of cases,
thunks may be inlined & debug info might be able to save profilers &
similar tools from misclassifying those cases as part of the caller.

The extra changes here plumb through the VarDecl for various cases to
CodeGenFunction - this provides better fidelity through a few APIs but
generally just causes the CGF::StartFunction to fallback to using the
name of the IR function as the name in the debug info.

The changes to debug-info-global-ctor-dtor.cpp seem like goodness. The
two names that go missing (in favor of only emitting those names as
linkage names) are names that can be demangled - emitting them only as
the linkage name should encourage tools to do just that.

Again, thanks to Dinesh Dwivedi for investigation/work on this issue.

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

11 years agoObjectiveC migrator: minor refactoring of my last
Fariborz Jahanian [Tue, 27 Aug 2013 23:56:54 +0000 (23:56 +0000)]
ObjectiveC migrator: minor refactoring of my last
cf annotation patch.

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

11 years agoUse CMAKE_RUNTIME_OUTPUT_DIRECTORY instead of LLVM_BINARY_DIR for installing Clang...
Ted Kremenek [Tue, 27 Aug 2013 23:20:26 +0000 (23:20 +0000)]
Use CMAKE_RUNTIME_OUTPUT_DIRECTORY instead of LLVM_BINARY_DIR for installing Clang headers.

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

11 years agoDelete CC_Default and use the target default CC everywhere
Reid Kleckner [Tue, 27 Aug 2013 23:08:25 +0000 (23:08 +0000)]
Delete CC_Default and use the target default CC everywhere

Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention.  This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator.  There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

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

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

11 years agoObjectiveC migrator: Do not add explicit cf annotation for
Fariborz Jahanian [Tue, 27 Aug 2013 22:42:30 +0000 (22:42 +0000)]
ObjectiveC migrator: Do not add explicit cf annotation for
cf functions which are CF_IMPLICIT_BRIDGING_ENABLED.
Add cf annotation to those not CF_IMPLICIT_BRIDGING_ENABLED
to reduce bridge casts.

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

11 years agoCMake: Fix standalone Clang build, take two.
Jordan Rose [Tue, 27 Aug 2013 21:52:04 +0000 (21:52 +0000)]
CMake: Fix standalone Clang build, take two.

This time, use a variable that's defined consistently in standalone and
non-standalone builds.

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

11 years agoRevert "[CMake] Use CLANG_BINARY_DIR instead of LLVM_BINARY_DIR as installation path...
Ted Kremenek [Tue, 27 Aug 2013 20:46:01 +0000 (20:46 +0000)]
Revert "[CMake] Use CLANG_BINARY_DIR instead of LLVM_BINARY_DIR as installation path for Clang headers."

This was breaking some tests.  Will investigate.

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

11 years ago[CMake] Use CLANG_BINARY_DIR instead of LLVM_BINARY_DIR as installation path for...
Ted Kremenek [Tue, 27 Aug 2013 20:41:18 +0000 (20:41 +0000)]
[CMake] Use CLANG_BINARY_DIR instead of LLVM_BINARY_DIR as installation path for Clang headers.

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

11 years agoMake the information about disabled ARCMT/Rewriter/StaticAnalyzer available
Roman Divacky [Tue, 27 Aug 2013 19:27:35 +0000 (19:27 +0000)]
Make the information about disabled ARCMT/Rewriter/StaticAnalyzer available
to lit and use this info to disable Analysis/FixIt/Rewriter/Analysis tests
when those are not compiled into clang.

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

11 years agoRevert "CMake: Fix out-of-source build's symlinks."
Reid Kleckner [Tue, 27 Aug 2013 18:27:08 +0000 (18:27 +0000)]
Revert "CMake: Fix out-of-source build's symlinks."

This reverts commit r189371, it broke the in-source cmake build.

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

11 years agoclang-cl: Support -fsanitize=address
Hans Wennborg [Tue, 27 Aug 2013 18:10:21 +0000 (18:10 +0000)]
clang-cl: Support -fsanitize=address

This exposes the -fsanitize=address option and adds the runtime library
to the link command.

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

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

11 years agoscan-build: Set CC and CXX as make variables when wrapping make builds.
Jordan Rose [Tue, 27 Aug 2013 16:59:33 +0000 (16:59 +0000)]
scan-build: Set CC and CXX as make variables when wrapping make builds.

Variables set in a makefile are not overridden by environment variables.
Make sure we actually override CC and CXX when using scan-build.

Patch by Steve McCoy!

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

11 years agoCMake: Fix out-of-source build's symlinks.
Jordan Rose [Tue, 27 Aug 2013 16:59:30 +0000 (16:59 +0000)]
CMake: Fix out-of-source build's symlinks.

Symlinks to clang should go in Clang's build directory, not LLVM's.

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

11 years ago[analyzer] Don't include Clang headers inside a namespace.
Jordan Rose [Tue, 27 Aug 2013 16:59:26 +0000 (16:59 +0000)]
[analyzer] Don't include Clang headers inside a namespace.

Found by Gabor Kozar!

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

11 years agoWarn that -O4 is the same as -O3.
Rafael Espindola [Tue, 27 Aug 2013 16:58:15 +0000 (16:58 +0000)]
Warn that -O4 is the same as -O3.

We error on -O5 and higher. While it is tempting to do the same for -O4, I
agree with Jordan Rose: we should warn for a release at least first.

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

11 years agoRevert "Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer."
Samuel Benzaquen [Tue, 27 Aug 2013 16:55:22 +0000 (16:55 +0000)]
Revert "Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer."

Summary:
This reverts commit 3b082a3c72324aa3363b5184731740534c6b9a2b.

It breaks the build in c++11 mode.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1533

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

11 years agoAdd support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.
Samuel Benzaquen [Tue, 27 Aug 2013 16:04:53 +0000 (16:04 +0000)]
Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.

Summary:
Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer.
These function require some late binding behavior for the type conversions, thus changes in VariadicValue's MatcherList.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1531

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

11 years agoAdding a vector version of clang::tooling::shiftedCodePosition().
Edwin Vane [Tue, 27 Aug 2013 15:44:26 +0000 (15:44 +0000)]
Adding a vector version of clang::tooling::shiftedCodePosition().

During the transition of clang::tooling::Replacements from std::set to
std::vector, functions such as clang::tooling::applyAllReplacements() have been
duplicated to take a std::vector<Replacement>. Applying this same temporary
duplication to clang::tooling::shiftedCodePosition().

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

11 years agoRewrite eachOf/allOf/anyOf to use a variadic operator.
Samuel Benzaquen [Tue, 27 Aug 2013 15:11:16 +0000 (15:11 +0000)]
Rewrite eachOf/allOf/anyOf to use a variadic operator.

Summary:
Rewrite eachOf/allOf/anyOf to use a variadic operator, instead of hand-written calls to Polymorphic matchers.
This simplifies their definition and future changes to add them to the dynamic registry.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1427

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

11 years agoclang-format: Format segments of builder-type calls one per line.
Daniel Jasper [Tue, 27 Aug 2013 14:24:43 +0000 (14:24 +0000)]
clang-format: Format segments of builder-type calls one per line.

This fixes llvm.org/PR14818.

Before:
  return llvm::StringSwitch<Reference::Kind>(name)
             .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
             .StartsWith(".eh_frame", ORDER_EH_FRAME)
             .StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
             .StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);

After:
  return llvm::StringSwitch<Reference::Kind>(name)
             .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
             .StartsWith(".eh_frame", ORDER_EH_FRAME)
             .StartsWith(".init", ORDER_INIT)
             .StartsWith(".fini", ORDER_FINI)
             .StartsWith(".hash", ORDER_HASH)
             .Default(ORDER_TEXT);

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

11 years agoCleanup of OpaquePtr. No functionality changes.
Serge Pavlov [Tue, 27 Aug 2013 13:15:56 +0000 (13:15 +0000)]
Cleanup of OpaquePtr. No functionality changes.
- Some documenation were added.
- Usages of OpaquePtr<A>.getAsVal<A>() were replaced by OpaquePtr<A>.get().
- Methods getAs and getAsVal were renamed to getPtrTo and getPtrAs respectively.

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

11 years agoAdding const buffer iterator generators to Rewriter
Edwin Vane [Tue, 27 Aug 2013 13:00:34 +0000 (13:00 +0000)]
Adding const buffer iterator generators to Rewriter

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

11 years agoclang-format: Revamp builder-type call formatting.
Daniel Jasper [Tue, 27 Aug 2013 11:09:05 +0000 (11:09 +0000)]
clang-format: Revamp builder-type call formatting.

Previously builder-type calls were only correctly recognized in
top-level calls.

This fixes llvm.org/PR16981.
Before:
  someobj->Add((new util::filetools::Handler(dir))->OnEvent1(
      NewPermanentCallback(this, &HandlerHolderClass::EventHandlerCBA))
                   ->OnEvent2(NewPermanentCallback(
                                  this, &HandlerHolderClass::EventHandlerCBB))
                   ->OnEvent3(NewPermanentCallback(
                                  this, &HandlerHolderClass::EventHandlerCBC))
                   ->OnEvent5(NewPermanentCallback(
                                  this, &HandlerHolderClass::EventHandlerCBD))
                   ->OnEvent6(NewPermanentCallback(
                         this, &HandlerHolderClass::EventHandlerCBE)));

After:
  someobj->Add((new util::filetools::Handler(dir))
                   ->OnEvent1(NewPermanentCallback(
                         this, &HandlerHolderClass::EventHandlerCBA))
                   ->OnEvent2(NewPermanentCallback(
                         this, &HandlerHolderClass::EventHandlerCBB))
                   ->OnEvent3(NewPermanentCallback(
                         this, &HandlerHolderClass::EventHandlerCBC))
                   ->OnEvent5(NewPermanentCallback(
                         this, &HandlerHolderClass::EventHandlerCBD))
                   ->OnEvent6(NewPermanentCallback(
                         this, &HandlerHolderClass::EventHandlerCBE)));

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

11 years ago[-cxx-abi microsoft] Change the vdtor implicit should_call_delete argument type to int
Timur Iskhodzhanov [Tue, 27 Aug 2013 10:38:19 +0000 (10:38 +0000)]
[-cxx-abi microsoft] Change the vdtor implicit should_call_delete argument type to int

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

11 years agoclang-format: Fix bug in column layout.
Daniel Jasper [Tue, 27 Aug 2013 08:43:47 +0000 (08:43 +0000)]
clang-format: Fix bug in column layout.

Before (with 60 character limit in Google style):
  return {
      {aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa},
      {aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa}};
After:
  return {{aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa},
          {aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa}};

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

11 years ago[-cxx-abi microsoft] Remove ArgIndex, we handle all template argument kinds!
David Majnemer [Tue, 27 Aug 2013 08:21:25 +0000 (08:21 +0000)]
[-cxx-abi microsoft] Remove ArgIndex, we handle all template argument kinds!

TemplateExpansion cannot happen here because MSVC doesn't mangle
anything but the fully substituted template arguments.

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

11 years agoPR14569: Omit debug info for thunks
David Blaikie [Tue, 27 Aug 2013 05:21:11 +0000 (05:21 +0000)]
PR14569: Omit debug info for thunks

This was added in r166676 based on PR13942 on the basis that tools may
need debug information for any executable code/function for some fairly
broad/non-specific purposes. It seems to me (as noted in PR14569) that
the major/only purpose is in backtraces, which should generally not
apply to thunks as they won't appear in the stack themselves. By
removing them we fix PR14569 and reduce the size of Clang's debug info.

Strangely enough this doesn't seem to have a substantial impact on
Clang's self-hosted debug info (at least looking at DWO file size) size
at all. Not sure if I failed to test this correctly but I only observed
a 0.004% change in DWO file size over Clang+LLVM.

With thanks to Dinesh Dwivedi for work on this PR.

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

11 years agoUse set to create CLANG_ORDER_FILE instead of option which implies a bool value.
Michael Gottesman [Tue, 27 Aug 2013 04:40:12 +0000 (04:40 +0000)]
Use set to create CLANG_ORDER_FILE instead of option which implies a bool value.

Patch by Edoardo P. <ed0.88.prez@gmail.com>.

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

11 years agoShow which decls are marked invalid in -ast-dump.
Nick Lewycky [Tue, 27 Aug 2013 03:15:56 +0000 (03:15 +0000)]
Show which decls are marked invalid in -ast-dump.

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

11 years agoItanium mangler: remove "proposal" comments for manglings that are in the
Richard Smith [Tue, 27 Aug 2013 01:03:46 +0000 (01:03 +0000)]
Itanium mangler: remove "proposal" comments for manglings that are in the
latest draft of the ABI.

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

11 years agoR600: Add local address pointer size to DataLayout
Tom Stellard [Tue, 27 Aug 2013 00:55:26 +0000 (00:55 +0000)]
R600: Add local address pointer size to DataLayout

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

11 years agoSimplify a bit.
Rafael Espindola [Mon, 26 Aug 2013 23:23:21 +0000 (23:23 +0000)]
Simplify a bit.

This follows from computeKeyFunction having:

  // Template instantiations don't have key functions,see Itanium C++ ABI 5.2.6.
  // Same behavior as GCC.
  TemplateSpecializationKind TSK = RD->getTemplateSpecializationKind();
  if (TSK == TSK_ImplicitInstantiation ||
      TSK == TSK_ExplicitInstantiationDefinition)
    return 0;

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