Commit Graph

5427 Commits

Author SHA1 Message Date
Stephan Tolksdorf d85fa23ad1 Recognize simple cases of trivial explicitly defaulted public dtors as irrelevant
Reviewed in http://llvm-reviews.chandlerc.com/D3190

llvm-svn: 204953
2014-03-27 20:23:12 +00:00
Dmitri Gribenko ef099dc670 Comment parsing: attach comments to enums declared using the NS_ENUM macro
Previously we would only attach comments to the typedef.

llvm-svn: 204942
2014-03-27 16:40:51 +00:00
Dmitri Gribenko 9ee0e303d6 Comment parsing: when comment ranges are deserialized from multiple modules,
correctly order comments in SourceManager::isBeforeInTranslationUnit() order

Unfortunately, this is not as simple as it was implemented previously, and
actually requires doing a merge sort.

llvm-svn: 204936
2014-03-27 15:40:39 +00:00
Alexander Musman fd2b75948d [OPENMP] OMPExecutableDirective re-factoring
Store the number of clauses and children of OMPExecutableDirective and dynamically compute the locations of corresponding arrays.

http://llvm-reviews.chandlerc.com/D2977

llvm-svn: 204933
2014-03-27 15:14:18 +00:00
Timur Iskhodzhanov 1523c610c9 Make the 'for (auto ...)' names more readable
llvm-svn: 204787
2014-03-26 08:22:48 +00:00
Timur Iskhodzhanov dd0a27664d Fix PR19066 - 0-sized vftable in the presence of virtual inheritance
Reviewed at http://llvm-reviews.chandlerc.com/D3181

llvm-svn: 204786
2014-03-26 08:12:53 +00:00
Reid Kleckner d0fe317e0c MS ABI: Mark direct virtual bases as visted when building vtable paths
Fixes PR19240.  In retrospect, this is a fairly obvious bug.  :)

llvm-svn: 204744
2014-03-25 18:33:27 +00:00
Richard Smith a8b7459115 If a DeclContext's lookups need to be reconciled, and we're given external declarations for a name, reconcile first. Otherwise, when we come to reconcile, we'll ask for external declarations for that name again. No functionality change intended.
llvm-svn: 204692
2014-03-25 00:34:21 +00:00
Richard Smith 750f511f11 Fix a bug where an explicit instantiation declaration of a class template
specialization would make us think it might have a key function.

llvm-svn: 204686
2014-03-24 23:54:09 +00:00
David Majnemer 58e5bee17a MS ABI: Eliminate Duplicate Strings
COFF doesn't have mergeable sections so LLVM/clang's normal tactics for
string deduplication will not have any effect.

To remedy this we place each string inside it's own section and mark
the section as IMAGE_COMDAT_SELECT_ANY.  However, we can only do this if the
string has an external name that we can generate from it's contents.

To be compatible with MSVC, we must use their scheme.  Otherwise identical
strings in translation units from clang may not be deduplicated with
translation units in MSVC.

This fixes PR18248.

N.B. We will not attempt to do anything with a string literal which is not of
type 'char' or 'wchar_t' because their compiler does not support unicode
string literals as of this date.  Further, we avoid doing this if
either -fwritable-strings or -fsanitize=address are present.

This reverts commit r204596.

llvm-svn: 204675
2014-03-24 21:43:36 +00:00
Warren Hunt c89450e054 [MS-ABI] Drop Special Layout in 64-bit mode.
As of cl.exe version 18, the special layout rules for structs with 
alignment 16 or greater has been dropped.  This patch drops the behavior 
from clang.  This patch also updates the lit tests to reflect the 
change.

llvm-svn: 204674
2014-03-24 21:37:27 +00:00
Timur Iskhodzhanov 89f588ff73 Revert r204562,204566,204586,204587 as they broke ASan on Windows
llvm-svn: 204596
2014-03-24 10:31:09 +00:00
David Majnemer 96bc4b0367 MS ABI: Add tests, other cleanups for r204562
This commit cleans up a few accidents:
- Do not rely on the order in which StringLiteral lays out bytes.
- Use a more efficient mechanism for handling so-called
  "special-mappings" when mangling string literals.
- There is no need to allocate a copy of the mangled name.
- Add the test written for r204562.

Thanks to Richard Smith for pointing these out!

llvm-svn: 204586
2014-03-24 05:53:08 +00:00
Richard Smith ecf74ff40a Consistently dump default template arguments for template parameters as 'TemplateArgument's.
llvm-svn: 204572
2014-03-23 20:50:39 +00:00
David Majnemer 3843a05edf MS ABI: Eliminate Duplicate Strings
COFF doesn't have mergeable sections so LLVM/clang's normal tactics for
string deduplication will not have any effect.

To remedy this we place each string inside it's own section and mark
the section as IMAGE_COMDAT_SELECT_ANY.  However, we can only do this if the
string has an external name that we can generate from it's contents.

To be compatible with MSVC, we must use their scheme.  Otherwise identical
strings in translation units from clang may not be deduplicated with
translation units in MSVC.

This fixes PR18248.

N.B. We will not attempt to do anything with a string literal which is not of
type 'char' or 'wchar_t' because their compiler does not support unicode
string literals as of this date.

llvm-svn: 204562
2014-03-23 17:47:16 +00:00
Nuno Lopes fb744589bc remove a bunch of unused private methods
found with a smarter version of -Wunused-member-function that I'm playwing with.
Appologies in advance if I removed someone's WIP code.

 ARCMigrate/TransProperties.cpp                  |    8 -----
 AST/MicrosoftMangle.cpp                         |    1 
 Analysis/AnalysisDeclContext.cpp                |    5 ---
 Analysis/LiveVariables.cpp                      |   14 ----------
 Index/USRGeneration.cpp                         |   10 -------
 Sema/Sema.cpp                                   |   33 +++++++++++++++++++++---
 Sema/SemaChecking.cpp                           |    3 --
 Sema/SemaDecl.cpp                               |   20 ++------------
 StaticAnalyzer/Checkers/GenericTaintChecker.cpp |    1 
 9 files changed, 34 insertions(+), 61 deletions(-)

llvm-svn: 204561
2014-03-23 17:12:37 +00:00
Alexey Bataev 62c87d2509 [OPENMP] parsing of clause 'safelen' (for directive 'omp simd')
llvm-svn: 204428
2014-03-21 04:51:18 +00:00
Timur Iskhodzhanov ba5570221d Fix PR19172 - wrong this adjustment calculated for virtual destructor in a class with complex inheritance
Reviewed at http://llvm-reviews.chandlerc.com/D3128

llvm-svn: 204394
2014-03-20 20:38:34 +00:00
Timur Iskhodzhanov 4fea4f917d Flust stdout after each vftable dumped to simplify debugging
llvm-svn: 204341
2014-03-20 13:42:14 +00:00
Dmitri Gribenko dbff5c71fa Comment parsing: fix a crash when dumping comment ast for a function template
with variadic parameters

Patch by Joe Ranieri.

llvm-svn: 204236
2014-03-19 14:03:47 +00:00
Dmitri Gribenko d9eb05aca3 Comment parsing: recognize \param ... on function templates with variadic
parameters

Patch by Joe Ranieri.

llvm-svn: 204235
2014-03-19 13:59:36 +00:00
Yunzhong Gao fcdc45ff2d Creating a printing policy for "half":
Since "half" is an OpenCL keyword and clang accepts __fp16 as an extension for
other languages, error messages and metadata (and hence debug info) should refer
to the half-precision floating point as "__fp16" instead of "half" when
compiling for non-OpenCL languages. This patch creates a new printing policy for
half in a similar manner to what is done for bool and wchar_t.

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

llvm-svn: 204164
2014-03-18 17:55:18 +00:00
Richard Smith 7fcb35f5e1 More working around a GCC range-based for scope bug.
llvm-svn: 204108
2014-03-18 02:37:59 +00:00
Richard Smith cbdf733dba AST dumper: if we have multiple implicit instantiations of the same class
template specialization (from different modules), dump them all, so that every
declaration is dumped somewhere.

llvm-svn: 204100
2014-03-18 02:07:28 +00:00
Richard Smith 8aa4922ac5 Fix variable shadowing. Due to a bug in GCC's implementation of range-based for
loops, it was making this an error, resulting in buildbot failures.

llvm-svn: 204097
2014-03-18 00:35:12 +00:00
Richard Smith 20ade551a6 Factor out repeated code in dumping template declarations.
llvm-svn: 204090
2014-03-17 23:34:53 +00:00
Richard Smith dcc2c453a5 Range-ify and simplify some of the AST dumping code by factoring out the lastChild check.
llvm-svn: 204086
2014-03-17 23:00:06 +00:00
Richard Smith baf3ca5c01 Don't fold together the name lookup entries for two declarations if they are
declared in different namespaces in the same inline namespace set.

llvm-svn: 204082
2014-03-17 21:46:03 +00:00
Aaron Ballman 804a7fb7ba [C++11] Replacing DeclContext iterators using_directives_begin() and using_directives_end() with iterator_range using_directives(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions. Also used as an opportunity to normalize the name from getUsingDirectives() to using_directives().
llvm-svn: 204061
2014-03-17 17:14:12 +00:00
Aaron Ballman 83731469a1 [C++11] Replacing ObjCObjectPointerType iterators qual_begin() and qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204048
2014-03-17 16:14:00 +00:00
Aaron Ballman 1683f7baf6 [C++11] Replacing ObjCObjectType iterators qual_begin() and qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204047
2014-03-17 15:55:30 +00:00
Aaron Ballman b088fbee3f [C++11] Replacing FunctionProtoType iterators exception_begin() and exception_end() with iterator_range exceptions(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204046
2014-03-17 15:38:09 +00:00
Aaron Ballman 40bd0aaf68 [C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204045
2014-03-17 15:23:01 +00:00
Aaron Ballman c7e4e219b5 [C++11] Replacing CompoundStmt iterators body_begin() and body_end() with iterator_range body(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204040
2014-03-17 14:19:37 +00:00
Benjamin Kramer a939c23aec Make some assertions on constant expressions static.
llvm-svn: 204012
2014-03-15 18:54:13 +00:00
Aaron Ballman e6f465e51f [C++11] Removing the found_decls_begin() and found_decls_end() APIs and replacing with a range-only found_decls() API.
llvm-svn: 203975
2014-03-14 21:38:48 +00:00
Aaron Ballman 9371dd2287 [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203958
2014-03-14 18:34:04 +00:00
Aaron Ballman c656303a2c [C++11] Replacing CapturedStmt iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203953
2014-03-14 18:08:33 +00:00
James Dennett 0492ef0e0b Fix a crash (assertion failure) in EvaluateAsRValue.
Summary:
Gracefully fail to evaluate a constant expression if its type is
unknown, rather than failing an assertion trying to access the type.

Reviewers: klimek

Reviewed By: klimek

CC: chandlerc, cfe-commits

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

llvm-svn: 203950
2014-03-14 17:44:10 +00:00
Aaron Ballman 535bbcccb1 [C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203947
2014-03-14 17:01:24 +00:00
Aaron Ballman 702fa310e5 [C++11] Replacing ClassTemplateDecl iterators spec_begin() and spec_end() with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203940
2014-03-14 16:13:33 +00:00
Aaron Ballman b8733c5ba4 [C++11] Replacing FunctionTemplateDecl iterators spec_begin() and spec_end() with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203938
2014-03-14 16:05:56 +00:00
Aaron Ballman 2205d2a56a [C++11] Replacing OMPThreadPrivateDecl and OMPClause iterators varlist_begin() and varlist_end() with iterator_range varlists(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203937
2014-03-14 15:55:35 +00:00
Aaron Ballman d6d25de46e [C++11] Replacing ObjCImplementationDecl iterators ivar_begin() and ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203932
2014-03-14 15:16:45 +00:00
Aaron Ballman d85eff49a3 [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203930
2014-03-14 15:02:45 +00:00
Aaron Ballman 865fbcdd8d [C++11] Replacing ObjCCategoryDecl iterators ivar_begin() and ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203924
2014-03-14 13:13:27 +00:00
Aaron Ballman 19a417699f [C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203922
2014-03-14 12:55:57 +00:00
Aaron Ballman 0f6e64d505 [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203863
2014-03-13 22:58:06 +00:00
Aaron Ballman b4a5345598 [C++11] Replacing ObjCInterfaceDecl iterators known_extensions_begin() and known_extensions_end() with iterator_range known_extensions(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203857
2014-03-13 21:57:01 +00:00
Aaron Ballman f53d8dd37d [C++11] Replacing ObjCInterfaceDecl iterators visible_extensions_begin() and visible_extensions_end() with iterator_range visible_extensions(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203855
2014-03-13 21:47:07 +00:00