Граф коммитов

43694 Коммитов

Автор SHA1 Сообщение Дата
Timur Iskhodzhanov 115ac5ac12 Add a missing space
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179525 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 14:16:31 +00:00
Rafael Espindola 90cc390c49 Remove hasExternalLinkageUncached.
It was being used correctly, but it is a very dangerous API to have around.
Instead, move the logic from the filtering to when we are deciding if we should
link two decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179523 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 12:49:13 +00:00
Rafael Espindola 72fdc8947e Fix the storage class of method instantiations.
We keep the "as written" storage class, but that is a fuzzy concept for
instantiations. With this patch instantiations of methods of class templates
now get a storage class that is based on the semantics of isStatic(). With this
can simplify isStatic() itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179521 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 12:38:20 +00:00
Tim Northover cef64fe34e Remove reference to MSVC only building X86 backend.
This is no longer true.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179519 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 11:55:27 +00:00
Richard Smith df4cc0a0c7 Local thread_local variables are implicitly 'static'. (This doesn't apply to _Thread_local nor __thread.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179517 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 08:33:22 +00:00
Richard Smith b6b127f279 Properly check for a constant initializer for a thread-local variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179516 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 08:07:34 +00:00
Richard Smith 231dbd23f1 Add triple to another test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179515 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 08:02:05 +00:00
Richard Smith b16ae8b754 Add triples to these tests since they're now using TLS, which isn't available on all targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 08:00:15 +00:00
Nadav Rotem 3c6a9b0523 Add a new flag -vectorize-slp-aggressive to enable Hals BB vectorizer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179507 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 05:38:41 +00:00
Nadav Rotem 50ea96332b Rename the slp-vectorizer clang/llvm flags. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179506 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 04:57:18 +00:00
Dmitri Gribenko d09615fcc0 Comment command table: use inheritance instead of duplicating code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179501 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 02:31:50 +00:00
Richard Smith 04e5176505 CodeGen support for function-local static thread_local variables with
non-constant constructors or non-trivial destructors. Plus bugfixes for
thread_local references bound to temporaries (the temporaries themselves are
lifetime-extended to become thread_local), and the corresponding case for
std::initializer_list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 23:01:42 +00:00
Rafael Espindola f6b4a6868c Removed #if 0 code that doesn't compiled if uncommented.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179495 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 22:08:07 +00:00
Richard Smith 6a570f610c Diagnose if a __thread or _Thread_local variable has a non-constant initializer
or non-trivial destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179491 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 20:11:31 +00:00
Anna Zaks 1ac39c2599 [analyzer] Add a link to the Building a Checker in 24 Hours talk to the developer manual
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 18:36:51 +00:00
Simon Atanasyan 321ae79aae [Mips] Support -mmicromips / -mno-micromips command line options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179489 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 14:07:51 +00:00
Simon Atanasyan a814161451 [Mips] Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179488 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 14:07:41 +00:00
Simon Atanasyan 7c06cba04d [Mips] Follow-up to r179481. Reduce code duplication. Use
AddTargetFeature() routine to handle -msingle-float / -mdouble-float
options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179487 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 14:07:36 +00:00
Simon Atanasyan d96e315fb8 [Mips] Follow-up to r179481. Consider "single-float" as a separate
independent of float ABI feature in the MipsTargetInfoBase class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179486 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 14:07:30 +00:00
Rafael Espindola d44d04f571 Add driver support for fedora 18 on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179484 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 10:14:21 +00:00
John McCall 088831d0b9 Handle incompatible redeclarations of library builtins better.
Invalid redeclarations of valid explicit declarations shouldn't
take the same path as redeclarations of implicit declarations,
and invalid local extern declarations shouldn't foul things up
for everybody else.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179482 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 08:50:55 +00:00
Simon Atanasyan 2ed42b86da [Mips] Remove "single" from the list of valid MIPS float ABI names. Add
two new options –msingle-float and –mdouble-float. These options can be
used simultaneously with float ABI selection options (-mfloat-abi,
-mhard-float, -msoft-float). They mark whether a floating-point
coprocessor supports double-precision operations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179481 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 08:37:15 +00:00
Rafael Espindola 67cd74ec17 Simplify test so that it is more portable.
I have checked that the test still fails when the "|| !P.isRegularFile()" from
the original patch is removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179464 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 22:26:02 +00:00
Simon Atanasyan f7f74c6b77 Remove duplicated comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179454 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 06:43:15 +00:00
Richard Smith 38afbc7361 Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 02:43:54 +00:00
Richard Smith 84083b74ab Use MapVector rather than simulating it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179438 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 01:28:18 +00:00
Argyrios Kyrtzidis 175c8e2e57 Speed-up ObjCMethodDecl::getOverriddenMethods().
Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its
results instead of re-calculating the categories multiple times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179436 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 01:04:01 +00:00
Argyrios Kyrtzidis ecc65238c9 Introduce SourceManager::getDecomposedIncludedLoc, that returns the "included/expanded in" decomposed location of the given FileID.
The main benefit is to speed-up SourceManager::isBeforeInTranslationUnit which is common to query
the included/expanded location of the same FileID multiple times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 01:03:57 +00:00
Richard Smith 3a0f7ac43a Give this test a triple so that its use of thread_local doesn't make it fail on the MSVC bot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 00:34:48 +00:00
John McCall 927b0af2f0 Don't replace an existing decl in the scope chains with its
local-extern redeclaration;  type refinements, default arguments,
etc. must all be locally scoped.

rdar://13535367

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179430 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 00:20:21 +00:00
Daniel Dunbar dd9bd3ba42 Headers: Don't try to use RSIZE_MAX unless we are freestanding.
- We don't want to depend on the platforms stdint.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179429 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 23:41:08 +00:00
Anton Yartsev 9df151c5bc [analyzer] Enable NewDelete checker if NewDeleteLeaks checker is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179428 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 23:25:40 +00:00
Daniel Dunbar 2943d3dded Headers: Add support for ISO9899:2011 rsize_t.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 23:24:56 +00:00
Anton Yartsev e0c804b214 NewDeleteLeaks is a subchecker of NewDelete checker; it is tested in NewDelete-checker-test.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179426 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 23:18:46 +00:00
Richard Smith ec64244f59 Parsing support for thread_local and _Thread_local. We give them the same
semantics as __thread for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179424 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 22:46:28 +00:00
Richard Smith 32b5013a7a tl;dr: Teach Clang to work around g++ changing its workaround to glibc's
implementation of C99's attempt to control the C++ standard. *sigh*


The C99 standard says that certain macros in <stdint.h>, such as SIZE_MAX,
should not be defined when the header is included in C++ mode, unless
__STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined. The C++11 standard
says "Thanks, but no thanks" and C11 removed this rule, but various C library
implementations (such as glibc) follow C99 anyway.

g++ prior to 4.8 worked around the C99 / glibc behavior by defining
__STDC_*_MACROS in <cstdint>, which was incorrect, because <stdint.h> is
supposed to provide these macros too. g++ 4.8 works around it by defining
__STDC_*_MACROS in its builtin <stdint.h> header.

This change makes Clang act like g++ 4.8 in this regard: our <stdint.h> now
countermands any attempt by the C library to implement the undesired C99 rules,
by defining the __STDC_*_MACROS first. Unlike g++, we do this even in C++98
mode, since that was the intent of the C++ committee, matches the behavior
required in C11, and matches our built-in implementation of <stdint.h>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 22:11:07 +00:00
Douglas Gregor 7332ae4967 <rdar://problem/13643854> Only emit ambiguous-expansion warnings when at least one of the macro definitions comes from a non-system header.
This slightly weakens the heuristic introduced in r178109.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179411 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 21:00:54 +00:00
Anton Yartsev b1b683ea5f [analyzer] Makes NewDeleteLeaks checker work independently from NewDelete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179410 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 20:48:49 +00:00
Bob Wilson 1e8058f8d9 Define Neon intrinsics as "static inline" to avoid warning. rdar://13108414
We had been defining Neon intrinsics as "static" with always_inline attributes.
If you use them from an extern inline function, you get a warning, e.g.:

static function 'vadd_u8' is used in an inline function with external linkage

This change simply adds the inline keyword to avoid that warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179406 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 20:17:20 +00:00
Chad Rosier 0c50a032f4 Add test case for r179403.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179404 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 19:52:07 +00:00
Chad Rosier 579d8d1b77 Add test case for r179399.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179400 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 18:54:40 +00:00
Anna Zaks 8713e1a5c3 [analyzer] Print a diagnostic note even if the region cannot be printed.
There are few cases where we can track the region, but cannot print the note,
which makes the testing limited. (Though, I’ve tested this manually by making
all regions non-printable.) Even though the applicability is limited now, the enhancement
will be more relevant as we start tracking more regions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179396 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 18:40:27 +00:00
Anna Zaks 9e2f5977a1 [analyzer]Print field region even when the base region is not printable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179395 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 18:40:21 +00:00
Chad Rosier 333ac6ed90 Add test case for r179383 and r179393.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179394 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 18:22:08 +00:00
Jyotsna Verma 14ca7ceb28 Disable following tests for Hexagon:
1) Driver/output-file-is-dir.c - Checks for object file which can't
be created for Hexagon since assembler is unavailable.
2) PCH/cxx-typeid.cpp - 'typeinfo' include file is unavailable for Hexagon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 17:25:02 +00:00
Argyrios Kyrtzidis 4522f63e00 [libclang] Introduce clang_Location_isInSystemHeader to check if a location resides in a system header.
This is a modified patch provided from Mikołaj Siedlarek!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179384 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 17:06:51 +00:00
Benjamin Kramer 3bbffd549c Sema: Give a typically small DenseMap some inline capacity.
Also reflow code a bit, no change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179382 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 15:22:25 +00:00
Manuel Klimek 67d080dafa Revamps structural error detection / handling.
Previously we'd only detect structural errors on the very first level.
This leads to incorrectly balanced braces not being discovered, and thus
incorrect indentation.

This change fixes the problem by:
- changing the parser to use an error state that can be detected
  anywhere inside the productions, for example if we get an eof on
  SOME_MACRO({ some block <eof>
- previously we'd never break lines when we discovered a structural
  error; now we break even in the case of a structural error if there
  are two unwrapped lines within the same line; thus,
  void f() { while (true) { g(); y(); } }
  will still be re-formatted, even if there's missing braces somewhere
  in the file
- still exclude macro definitions from generating structural error;
  macro definitions are inbalanced snippets

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179379 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 14:13:36 +00:00
Daniel Jasper 7a9ed44173 Fix clang-format-diff.py script.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179377 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 13:42:36 +00:00
Daniel Jasper c6d82ca9b2 Provide better emacs integration.
The new emacs integration is simpler, does not save the current file
before reformatting and ensures that emacs does not scroll as a result
of formatting.

Also explicitly set the style in clang-format tests to make them more
robust.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179372 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 10:12:01 +00:00