Commit Graph

51411 Commits

Author SHA1 Message Date
Rafael Espindola a7a94d10ea Replace CLANG_IS_PRODUCTION with CLANG_PLUGIN_SUPPORT.
llvm-svn: 203473
2014-03-10 17:00:46 +00:00
Samuel Benzaquen a083935d0a Add loc() to the dynamic registry.
Summary:
Add loc() to the dynamic registry.
Other fixes:
 - Fix the polymorphic variant value to accept an exact match, even if
   there are other possible conversions.
 - Fix specifiesTypeLoc() to not crash on an empty
   NestedNameSpecifierLoc.

Reviewers: klimek

CC: cfe-commits, klimek

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

llvm-svn: 203467
2014-03-10 15:40:23 +00:00
Daniel Jasper 84a12e18d3 clang-format: Add spaces between lambdas and comments.
Before:
  void f() {
    bar([]() {}// Does not respect SpacesBeforeTrailingComments
        );
  }

After:
  void f() {
    bar([]() {} // Does not respect SpacesBeforeTrailingComments
        );
  }

This fixes llvm.org/PR19017.

llvm-svn: 203466
2014-03-10 15:06:25 +00:00
Aaron Ballman 62e47c423d Reverting llvm::distance changes to use std::distance with iterators instead, per post-commit review feedback.
Replacing llvm::copy changes with SmallVector range-based construction which is a considerably cleaner approach.

llvm-svn: 203461
2014-03-10 13:43:55 +00:00
Alexander Kornienko 4504f93901 Preserve hanging indent when breaking line comments.
Summary:
If we need to break the second line here:
// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa aaaaa aaaaaa aaaaa aaaaa aaaaa

with the patch it will be turned to

// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa

instead of

// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
//            aaaaa aaaaa aaaaaa aaaaa aaaaa
// aaaaa

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek

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

llvm-svn: 203458
2014-03-10 13:14:56 +00:00
Robert Lytton 2c942c64fb Make __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros
llvm-svn: 203455
2014-03-10 12:06:29 +00:00
Daniel Jasper 81a20787db clang-format: Add spaces around trailing/lambda return types.
Before:
  int c = []()->int { return 2; }();

After:
  int c = []() -> int { return 2; }();

llvm-svn: 203452
2014-03-10 10:02:02 +00:00
NAKAMURA Takumi 2b85e546f2 clang/test/Index/preamble-reparse-warn-*.c: Stabilize on win32.
llvm-svn: 203446
2014-03-10 06:02:13 +00:00
NAKAMURA Takumi 5e9c821420 clang/test/Index/preamble-reparse-warn-*.c: Use @LINE in FileCheck.
llvm-svn: 203445
2014-03-10 06:02:03 +00:00
Richard Smith a108760b33 When a type's definition is instantiated, the definition becomes visible, even
if the type's declaration was previously instantiated in an unimported module.
(For an imported type definition, this already worked, because the source
location is set to the location of the definition, but for locally-instantiated
type definitions, it did not.)

llvm-svn: 203425
2014-03-10 00:04:29 +00:00
Bob Wilson d836d3dde1 Remove trailing whitespace.
llvm-svn: 203422
2014-03-09 23:02:27 +00:00
Nick Lewycky 206cc2d9c6 Tab to spaces. No functionality change.
llvm-svn: 203417
2014-03-09 17:09:28 +00:00
Logan Chien 8153b368b6 Fix uninitialized value in AttributedTypeLoc.
Clang might crash while reading the precompiled headers if
we don't initialize the AttrEnumOperandLoc properly.

This commit fixes the combination of string attribute
operand and enum operand.  Besides, this commit also adds
several assertions to avoid unexpected operand kind.

llvm-svn: 203416
2014-03-09 16:21:03 +00:00
Aaron Ballman 53d413f794 [C++11] Replacing some using declarations which are not supported on all compilers (such as MSVC 2012) with a less problematic typedef.
llvm-svn: 203397
2014-03-09 12:59:45 +00:00
Ahmed Charles bfb6232233 [C++11] Use std::unique_ptr for ownership in a vector.
Also change to using range-based for loops. No functional change intended.

llvm-svn: 203396
2014-03-09 12:24:23 +00:00
Ahmed Charles a3374446d4 Fix build break, replace take() with release().
llvm-svn: 203390
2014-03-09 11:46:32 +00:00
Ahmed Charles dfca6f97bc [C++11] Replace OwningPtr include with <memory>.
llvm-svn: 203389
2014-03-09 11:36:40 +00:00
Ahmed Charles af94d56b56 [C++11] Remove the remaining uses of OwningPtr.
Replace OwningArrayPtr with std::unique_ptr<T[]>.

llvm-svn: 203388
2014-03-09 11:34:25 +00:00
Ted Kremenek 2dd810a331 [-Wunreachable-code] Handle Objective-C bool literals in 'isConfigurationValue'.
This includes special casing 'YES' and 'NO', which are constants
defined as macros.

llvm-svn: 203380
2014-03-09 08:13:49 +00:00
David Majnemer 970714bcf9 Update clang to account for changes made to LLVM in r203376
llvm-svn: 203377
2014-03-09 07:09:06 +00:00
David Blaikie dcb72d72ff Remove uses of SmallString::equals in favor of SmallVectorImpl<char>'s operator==
llvm-svn: 203373
2014-03-09 05:18:27 +00:00
Argyrios Kyrtzidis 0098a4bd04 [Sema] Fix assertion hit with #pragma weak.
rdar://16264844

llvm-svn: 203372
2014-03-09 05:15:28 +00:00
Argyrios Kyrtzidis b255ee91a7 [libclang] Don't pad the main buffer for the preamble.
Padding does not seem to be useful currently, and it leads to bogus location if an error
points to the end of the file.

rdar://15836513

llvm-svn: 203370
2014-03-09 04:24:57 +00:00
NAKAMURA Takumi 9cd3ce20cc retain-comments-from-system-headers.c: Flush module cache, or incremental test would fail since r203317.
llvm-svn: 203367
2014-03-09 03:56:18 +00:00
Chandler Carruth 4d01fff492 [C++11] Update Clang for the change to LLVM's Use-Def chain iterators in
r203364: what was use_iterator is now user_iterator, and there is
a use_iterator for directly iterating over the uses.

This also switches to use the range-based APIs where appropriate.

llvm-svn: 203365
2014-03-09 03:16:50 +00:00
Ted Kremenek c980afc578 [-Wunreachable-code] Tweak heuristic for configuration values to include arithmetic operations involving sizeof(), but not raw integers.
This case was motivated by a false positive with the
llvm::AlignOf<> specialization in LLVM.

llvm-svn: 203363
2014-03-08 23:20:11 +00:00
Aaron Ballman b97112e4bd [C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.

llvm-svn: 203362
2014-03-08 22:19:01 +00:00
Argyrios Kyrtzidis 8ed7414e58 [Preprocessor] Only check for -Wunused-macros if the translation unit kind is TU_Complete.
llvm-svn: 203360
2014-03-08 21:18:26 +00:00
Aaron Ballman e8a8baef44 [C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203355
2014-03-08 20:12:42 +00:00
Aaron Ballman 23a6dcb365 [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203353
2014-03-08 18:45:14 +00:00
Aaron Ballman 43027eb093 Reapplying r203299 in a slightly different manner. Now range APIs are implemented in terms of iterator APIs.
llvm-svn: 203351
2014-03-08 18:30:40 +00:00
Ted Kremenek efea63450b [-Wunreachabe-code] Don't warn about unreachable destructors for temporaries.
This can possibly be refined later, but right now the experience
is so incomprehensible for a user to understand what is going on
this isn't a useful warning.

llvm-svn: 203336
2014-03-08 02:22:32 +00:00
Ted Kremenek fcc1417fad Fix CFG bug where the 'isTemporaryDtorsBranch' bit was silently lost for terminators.
llvm-svn: 203335
2014-03-08 02:22:29 +00:00
Ted Kremenek ff909f907c [CFG] Record would-be successor for noreturn destructor.
llvm-svn: 203334
2014-03-08 02:22:25 +00:00
Ted Kremenek 04bfbeea04 [-Wunreachable-code] Handle 'return' with no argument dominated by 'noreturn' function.
llvm-svn: 203333
2014-03-08 02:22:23 +00:00
Rafael Espindola 181d29782e Add an option to disable plugins in clang.
An option with the same name already exists in the makefile build.

The name CLANG_IS_PRODUCTION is historical. We should probably change it, but
should change the configure build at the same time.

llvm-svn: 203325
2014-03-08 01:19:37 +00:00
Rafael Espindola bc28340573 Revert "Add an option to disable plugins in clang."
This reverts commit r203320.

There is some order dependency going on that I missed.

llvm-svn: 203321
2014-03-08 00:41:53 +00:00
Rafael Espindola 8c49cd1b06 Add an option to disable plugins in clang.
An option with the same name already exists in the makefile build.

llvm-svn: 203320
2014-03-08 00:33:15 +00:00
Richard Smith 664b32b814 Revert accidentally-committed file.
llvm-svn: 203318
2014-03-08 00:04:19 +00:00
Richard Smith 9bca298f6d Module [extern_c] attribute: inherit to submodules, don't write 'extern "C"'
blocks when building in C mode, and serialize and deserialize the attribute.

llvm-svn: 203317
2014-03-08 00:03:56 +00:00
Ismail Pazarbasi 025f428c73 Replace "can not" with "cannot" in diagnostics messages.
llvm-svn: 203302
2014-03-07 22:36:23 +00:00
Aaron Ballman da634f1dee In my tests, I'm finding that declaring iterators in terms of ranges can sometimes have dangerous side-effects where the range temporary is destroyed, taking the underlying iterators out with it.
This changes the iterators so that they are no longer implemented in terms of ranges (so it's a very partial revert of the existing rangification efforts).

llvm-svn: 203299
2014-03-07 22:17:20 +00:00
Benjamin Kramer 4cadf292a5 [C++11] Revert uses of lambdas with array_pod_sort.
Looks like GCC implements the lambda->function pointer conversion differently.

llvm-svn: 203293
2014-03-07 21:51:58 +00:00
Benjamin Kramer 15ae783e14 [C++11] Convert sort predicates into lambdas.
No functionality change.

llvm-svn: 203289
2014-03-07 21:35:40 +00:00
Ted Kremenek 94d1617a1f [-Wunreachable-code] Treat constant globals as configuration values in unreachable code heuristics.
This one could possibly be refined even further; e.g. looking
at the initializer and see if it is truly a configuration value.

llvm-svn: 203283
2014-03-07 20:51:13 +00:00
Ted Kremenek 91e45e056b Zap another dead 'break' statement.
llvm-svn: 203282
2014-03-07 20:51:10 +00:00
Ahmed Charles b89843299a Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Aaron Ballman 629afaefe0 [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203278
2014-03-07 19:56:05 +00:00
Ahmed Charles d72a5f103d Replace OwningPtr::isValid() with conversion to bool.
This is a precursor to moving to std::unique_ptr.

llvm-svn: 203277
2014-03-07 19:51:06 +00:00
Ahmed Charles 9a16beb8bc Change OwningPtr::take() to OwningPtr::release().
This is a precursor to moving to std::unique_ptr.

llvm-svn: 203275
2014-03-07 19:33:25 +00:00
Ted Kremenek 090a273b55 Remove dead return and simplify code.
llvm-svn: 203266
2014-03-07 18:53:05 +00:00
Aaron Ballman 29c9460d3e Renaming the chains() ranged iterator to chain() per suggestion by Richard Smith.
llvm-svn: 203262
2014-03-07 18:36:15 +00:00
Aaron Ballman 1391608234 [C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203261
2014-03-07 18:11:58 +00:00
Nico Weber c7cb940440 Add a note in the user manual that tsan is not supported on Mac.
Patch from Sean McBride <sean@rogue-research.com>!

llvm-svn: 203260
2014-03-07 18:11:40 +00:00
Nico Weber ab88f0b12f "Mac OS/X" -> "Mac OS X" spelling fixes for clang.
Patch from Sean McBride <sean@rogue-research.com>!

llvm-svn: 203259
2014-03-07 18:09:57 +00:00
Aaron Ballman 43b68bebe7 [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203255
2014-03-07 17:50:17 +00:00
Aaron Ballman e7fbde8cb6 [C++11] Adding an iterator_range accessor for parameter declarations to the CaptureDecl class; however, the only usage of the iterators cannot be converted to using the range yet. This change is for consistency with other Decls exposing parameters.
llvm-svn: 203252
2014-03-07 16:40:17 +00:00
Aaron Ballman b2b8b1dc66 [C++11] Replacing BlockDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203250
2014-03-07 16:09:59 +00:00
Aaron Ballman f6bf62e2d0 [C++11] Replacing FunctionDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203248
2014-03-07 15:12:56 +00:00
Benjamin Kramer ed2f476b20 [C++11] Replace LLVM-style type traits with C++11 standard ones.
No functionality change.

llvm-svn: 203241
2014-03-07 14:30:23 +00:00
Aaron Ballman b105e49f28 [C++11] Replacing iterators ddiag_begin() and ddiag_end() with iterator_range ddiags(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203240
2014-03-07 14:09:15 +00:00
Aaron Ballman 63ab760ebe [C++11] Updating getUsingDirectives to use iterator_range instead of a std::pair.
llvm-svn: 203239
2014-03-07 13:44:44 +00:00
Aaron Ballman 7dce1a840c Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
llvm-svn: 203237
2014-03-07 13:13:38 +00:00
Aaron Ballman 690829696c [C++11] Replacing iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203236
2014-03-07 12:50:00 +00:00
Timur Iskhodzhanov f0e88c72ec Remove a test that we don't need anymore
llvm-svn: 203228
2014-03-07 10:21:25 +00:00
Alexey Bataev d3db6acf7e [OPENMP] Fix for threadprivate construct instantiatiation.
llvm-svn: 203225
2014-03-07 09:46:29 +00:00
Timur Iskhodzhanov a895758203 Fix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual inheritance hierarchy
llvm-svn: 203222
2014-03-07 09:34:59 +00:00
Dmitri Gribenko d2bbdcfc0d ExternalClangExamples: add a link to ToyClangPlugin
Patch by Alexey Denisov.

llvm-svn: 203219
2014-03-07 09:06:12 +00:00
Ben Langmuir 38f54a8ea5 Tweak some test paths to match on Windows
llvm-svn: 203215
2014-03-07 08:15:35 +00:00
Alexey Bataev d178ad4943 [OPENMP] Small update in threadprivate variables processing to fix template instantiation.
llvm-svn: 203214
2014-03-07 08:03:37 +00:00
Argyrios Kyrtzidis e1974dcd92 [Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is TU_Prefix
avoid warning for unused macros.

rdar://15034698

llvm-svn: 203213
2014-03-07 07:47:58 +00:00
Alexey Bataev 648250a2e5 [OPENMP] Fixed linked libraries for libiomp5 on Linux
llvm-svn: 203212
2014-03-07 07:43:52 +00:00
Ben Langmuir 198c168518 Add a bunch of missing changes from r203208
Somehow lost these in a git operation.

llvm-svn: 203210
2014-03-07 07:27:49 +00:00
Ted Kremenek 7d47cace55 Fix recent regressions in -Wreturn-type caused by heuristics to -Wunreachable-code.
I had forgotten that the same reachability code is used by both -Wreturn-type
and -Wunreachable-code, so the heuristics applied to the latter were indirectly
impacting the former.

To address this, the reachability code is more refactored so that whiled
the logic at its core is shared, the intention of the clients are better
captured and segregated in helper APIs.

Fixes PR19074, and also some false positives reported offline to me
by Nick Lewycky.

llvm-svn: 203209
2014-03-07 07:14:36 +00:00
Ben Langmuir cb69b57b2a Add dependencies from imported modules with -MD
Add module dependencies to the dependency files created by -MD/-MMD/etc.
by attaching an ASTReaderListener that will call into the dependency
file generator when a module input file is seen in the serialized AST.

llvm-svn: 203208
2014-03-07 06:40:32 +00:00
Alexey Bataev 96d1510c61 Another one fix for getSema()/getDerived().getSema()
llvm-svn: 203196
2014-03-07 04:16:48 +00:00
Alexey Bataev 3d76e777cd Fixed getSema()/getDerived().getSema() diff pointed by Hal Finkel.
llvm-svn: 203195
2014-03-07 04:01:56 +00:00
Ted Kremenek 782f003c62 [-Wunreachable-code] Correctly expand artificial reachability to pruned '&&' and '||' branches involving configuration values.
llvm-svn: 203194
2014-03-07 02:25:53 +00:00
Ted Kremenek c10830b308 [-Wunreachable-code] Teach reachable code analysis heuristics about more literal types.
llvm-svn: 203193
2014-03-07 02:25:50 +00:00
Yunzhong Gao 820c687e9e The Visual Studio IDE changed behavior in VS2012. It used to be the case that
the clang diagnostic has to report a column number one less than the correct
value in order for the IDE to move the cursor to the expected location. This
behavior is changed in VS2012 and VS2013 so that the IDE is now expecting the
column number to match the actual source location.
  Before: source(line, column-1): type: message
  After: source(line, column): type: message

This patch changes -fdiagnostics-format=msvc to match the new VS2012 and VS2013
when fmsc-version is 1700 or greater.

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

llvm-svn: 203183
2014-03-07 00:23:36 +00:00
Aaron Ballman 211cd8ccb7 Partial revert of r203179. The build bots are telling me that some out-of-tree builds are using redecls_begin()/redecls_end(), so adding some machinery back in to support them.
llvm-svn: 203182
2014-03-07 00:10:58 +00:00
Aaron Ballman 86c9390673 [C++11] Replacing iterators redecls_begin() and redecls_end() with iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely.
llvm-svn: 203179
2014-03-06 23:45:36 +00:00
Fariborz Jahanian 328a7c4b8b C. Compare vector sizes using their raw element size instead of
getTypeSize (which rounds up sizes) in order to issue diagnostics 
when casting to mismatched vector sizes; instead of crashing in IRGen.
// rdar:// 16196902. Reviewed offline by John McCall.

llvm-svn: 203175
2014-03-06 22:47:09 +00:00
Rafael Espindola 060062a433 Use llvm.compiler.used instead of llvm.used for objc symbols.
LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not
print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the
ones that the clang's objc codegen is producing. The net result, is that it is
equivalent to llvm.compiler.used.

The need for putting the private symbol in llvm.compiler.used should be clear
(the objc runtime uses them). The reason for also putting the weak symbols in
it is for LTO: ld64 will not ask us to preserve the it.

llvm-svn: 203172
2014-03-06 22:15:10 +00:00
Rafael Espindola dec97f82f7 Make the test a bit stronger by showing what is added to llvm.used.
llvm-svn: 203170
2014-03-06 22:02:16 +00:00
Richard Smith 131daca01d Remove a dead store, add a FIXME for another.
llvm-svn: 203169
2014-03-06 21:59:38 +00:00
Ismail Pazarbasi be19ae05e7 Exclude invalid old decl from mismatching linkage assertion
This patch fixes PR18964. In linkage computation, assertion fails when
an old invalid declaration's linkage mismatches with the current
decl's one.

llvm-svn: 203168
2014-03-06 21:48:45 +00:00
Ted Kremenek 02548c08f8 Remove dead code I introduced 6 years, 4 months ago in r43518.
Found by -Wunreachable-code.

llvm-svn: 203167
2014-03-06 21:42:43 +00:00
Bob Wilson bd48799c8d PGO: rename profile data files from .pgodata to .profdata.
These tests were added before we had settled on using a .profdata extension
for the profile data files. Renaming them now for consistency.

llvm-svn: 203166
2014-03-06 21:36:04 +00:00
Bob Wilson 363bd1a815 PGO: rename FileCheck variable to follow the existing convention.
I added this "STF" variable without noticing that all the other counter names
end with a "C". Renaming it to "STC" for consistency.

llvm-svn: 203165
2014-03-06 21:35:59 +00:00
Saleem Abdulrasool 29b82b631d Update for LLVM API change
Use the new getObjectFormat/setObjectFormat instead of Environment now that the
file format is a separate field.

llvm-svn: 203161
2014-03-06 20:47:19 +00:00
Rui Ueyama 1987d52691 [docs] s/cpp11-migrate/clang-modernize/
llvm-svn: 203158
2014-03-06 20:30:05 +00:00
Bob Wilson c845c00a5b PGO: Add support for Objective-C blocks.
llvm-svn: 203157
2014-03-06 20:24:27 +00:00
Richard Smith 2d70976fc0 Fix dead store and simplify. No functionality change (although the code is now
correct if MaxEditDistance were increased to something greater than 1).

llvm-svn: 203153
2014-03-06 20:00:05 +00:00
David Majnemer 34b4989658 MS ABI: Disambiguate the manglings for global guard variables
If a guard variable will be created for an entity at global scope,
then we cannot rely on the scope depth to disambiguate names for us.

Instead, mangle the entire variable into the guard to ensure it's uniqueness.

llvm-svn: 203151
2014-03-06 19:57:36 +00:00
Aaron Ballman 69bb592ad1 Based on usage, the NamedDecl is always set when constructing a CallingContext, but none of the other optional parameters are. Removing the optional parameters, and making the NamedDecl required.
No functional changes intended.

llvm-svn: 203149
2014-03-06 19:37:24 +00:00
Aaron Ballman 19842c437a Refactored to use a simple helper function that wraps the logic of creating an SExprNode and returning the position in which it was inserted.
No functional change intended.

llvm-svn: 203148
2014-03-06 19:25:11 +00:00
Reid Kleckner 8d4a16ec3a Add tests for MS inline asm change r203146
llvm-svn: 203147
2014-03-06 19:19:36 +00:00
David Majnemer f55feec559 MS ABI: Fix the initializer/finalizer mangling for static data members
Initializers and finalizers for static data members have the variable's
access-specifier, storage-class, type and CV-qualifiers mangled in.

llvm-svn: 203145
2014-03-06 19:10:27 +00:00
Aaron Ballman cea2609b59 Very minor simplification and typo correction; no functional changes intended.
llvm-svn: 203144
2014-03-06 19:10:16 +00:00
Rafael Espindola 70efc5b4db Revert "Use private linkage for remaining GlobalVariables with private names."
This reverts commit r203059.

Revert while we discuss what does it mean to be private and weak.

llvm-svn: 203141
2014-03-06 18:54:12 +00:00
Richard Smith 6f548ec37e Fix use-after-free detected by ASan bootstrap.
llvm-svn: 203140
2014-03-06 18:08:08 +00:00
Bob Wilson 9c86656d62 Run -fprofile-instr tests with %clang_cc1.
This should help avoid problems like the buildbot fallout from my change in
r203085. I left the CodeGenCXX tests alone for now.

llvm-svn: 203131
2014-03-06 17:18:34 +00:00
Dmitri Gribenko 28bfb48fd0 Expand documentation section on comment parsing
Patch by Jonathan Sauer, with a little editing by me.

llvm-svn: 203128
2014-03-06 16:32:09 +00:00
Argyrios Kyrtzidis 38765b9c17 [ASTPrinter] 'SEL' isn't a ObjCObjectPointer, so we don't need to handle it in TypePrinter::printObjCObjectPointerBefore.
Suggested by Jordan.

llvm-svn: 203124
2014-03-06 15:31:56 +00:00
Alexander Kornienko 86b2dfdc3b Fix operator<< recognition (PR19064).
llvm-svn: 203123
2014-03-06 15:13:08 +00:00
Aaron Ballman 8cbf633715 [C++11] Adding override specifiers where appropriate, and removing virtual specifiers where not needed.
No functional changes intended.

llvm-svn: 203122
2014-03-06 15:09:50 +00:00
Aaron Ballman 8abdd0e090 Reformatting the style used within the massive attribute semantic handling switch statement, so now there is only one style used in this block of code, instead of three or more styles.
No functional change intended.

llvm-svn: 203120
2014-03-06 14:02:27 +00:00
Alexander Kornienko a74979d66f Added an inserter for ArrayRef<SourceRange>.
Summary:
Added an inserter for ArrayRef<SourceRange>, as it is already needed in at least
two places (static analyzer and clang-tidy).

Reviewers: jordan_rose

CC: cfe-commits, gribozavr

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

llvm-svn: 203117
2014-03-06 13:23:30 +00:00
Alexey Bataev d4dbdf5438 [OPENMP] Updated comments and _OPENMP macro value for OpenMP 4.0 (for 'omp simd' support)
llvm-svn: 203114
2014-03-06 12:27:56 +00:00
Alexey Bataev 178d599143 [OPENMP] Missed test for 'simd private'
llvm-svn: 203108
2014-03-06 11:48:22 +00:00
Ted Kremenek 6999d02587 [-Wunreachable-code] Refine treating all branches of 'switch' as reachable, which includes those with all cases covered but with no 'default:'.
llvm-svn: 203094
2014-03-06 08:09:00 +00:00
NAKAMURA Takumi e1879a90f8 CodeGenObjC/instr-profile.m: Add -target darwin to appease bots.
This expected;
  ; Function Attrs: uwtable
  define internal void @"\01+[A foreach:]"(i8* %self, i8* %_cmd, %0* %array) #0 {

But the Name is mangled on other hosts; (x86_64-unknown-unknown)
  ; Function Attrs: nounwind uwtable
  define internal void @_c_A__foreach_(i8* %self, i8* %_cmd, %1* %array) #0 {

llvm-svn: 203092
2014-03-06 07:29:30 +00:00
Ted Kremenek ec2dc73e86 [-Wunreachable-code] don't warn about dead 'return <string literal>' dominated by a 'noreturn' call, where literal becomes an std::string.
I have mixed feelings about this one.  It's used all over the codebase,
and is analogous to the current heuristic for ordinary C string literals.

This requires some ad hoc pattern matching of the AST.  While the
test case mirrors what we see std::string in libc++, it's not really
testing the libc++ headers.

llvm-svn: 203091
2014-03-06 06:50:46 +00:00
Bob Wilson b3fd21a42f Attempt to fix buildbots by dropping the -LABEL from some FileCheck patterns.
llvm-svn: 203090
2014-03-06 06:49:37 +00:00
Alexey Bataev 568a833f68 [OPENMP] Clause 'num_threads'
llvm-svn: 203087
2014-03-06 06:15:19 +00:00
Bob Wilson 5ec8fe19cf PGO: add instrumentation for Objective-C methods.
llvm-svn: 203085
2014-03-06 06:10:02 +00:00
Alexey Bataev 186b28a8cf [OPENMP] Added option -fopenmp=libiomp5|libgomp
llvm-svn: 203081
2014-03-06 05:43:53 +00:00
Ted Kremenek 90097491ed Remove 'break' dominated by 'return' in 'EmitBuiltinExpr'.
llvm-svn: 203080
2014-03-06 05:37:38 +00:00
Ted Kremenek 7bceca1fcf Remove 2 dead 'break' statements. The 'break' usage in this switch is inconsistent, making this hard to see.
llvm-svn: 203079
2014-03-06 05:37:35 +00:00
Ted Kremenek ad71fc6104 Remove dead return in Parser::MayBeDesignationStart().
llvm-svn: 203078
2014-03-06 05:37:32 +00:00
Ted Kremenek d8c64f573d Remove dead return in BugReporter (found via -Wunreachable-code).
llvm-svn: 203077
2014-03-06 05:37:28 +00:00
Bob Wilson da1ebedeea PGO: Use the main file name to help distinguish functions with local linkage.
In addition, for all functions, use the name from the llvm::Function to
identify the function in the profile data. Compute that "function name",
including the file name for local functions, once when assigning the PGO
counters and store it in the CodeGenPGO class.

Move the code to add InlineHint and Cold attributes out of StartFunction(),
because the "function name" string isn't available at that point.

llvm-svn: 203075
2014-03-06 04:55:41 +00:00
Bob Wilson d0b7824ece PGO: Rename variables to avoid referring to the "MangledName" of a function.
For C++ functions, we will continue to use the mangled name to identify
functions in the PGO profile data, but this name is confusing for things like
Objective-C methods. For functions with local linkage, we're also going to
include the file name to help distinguish those functions, so this changes to
use more generic variable names.

No functional changes.

llvm-svn: 203074
2014-03-06 04:55:37 +00:00
Bob Wilson 68f475faf7 Refactor PGO code in preparation for handling non-C/C++ code.
Move the PGO.assignRegionCounters() call out of StartFunction, because that
function is called from many places where it does not make sense to do PGO
instrumentation (e.g., compiler-generated helper functions). Change several
functions to take a StringRef argument for the unique name associated with
a function, so that the name can be set differently for things like Objective-C
methods and block literals.

llvm-svn: 203073
2014-03-06 04:55:35 +00:00
Bob Wilson 749ebc7f33 PGO: don't emit counter increment if no counters have been allocated.
I hit this while debugging another issue where my sources were in an
inconsistent state, so I don't have a testcase. Regardless, this check is
simpler and more direct than checking if the option is enabled.

llvm-svn: 203072
2014-03-06 04:55:28 +00:00
Chandler Carruth 00fa3f7bf1 [Layering] Update include of Linker.h to match its move to a Linker
subdirectory in LLVM r203065.

llvm-svn: 203067
2014-03-06 03:46:44 +00:00
Richard Smith 9d100866f2 Fix crash if a submodule overrides one of its own macros, and add support for
submodule macro overriding within the same top-level module (necessary for the
testcase to be remotely reasonable). Incidentally reduces the number of libc++
testsuite regressions with modules enabled from 7 to 6.

llvm-svn: 203063
2014-03-06 03:16:27 +00:00
Richard Trieu 1a1e818b13 Fix test from r203061
llvm-svn: 203062
2014-03-06 02:28:22 +00:00
Richard Trieu fe771c071a Suppress diagnostics during name lookup for absolute value type.
llvm-svn: 203061
2014-03-06 02:25:04 +00:00
Rafael Espindola d0bb55a1d4 Use private linkage for remaining GlobalVariables with private names.
This patch changes the remaining GlobalVariables using "\01L" and
"\01l" prefixes to use private linkage. What is strange about them is
that they currently use WeakAnyLinkage. There is no comment stating
why and that is really odd since the symbols are completely hidden, so
it doesn't make sense for them to be weak.

Clang revisions like r63329, r63408, r63770, r65761 set the linkage to
weak, but don't say why. I suspect they were just copying llvm-gcc.

In llvm-gcc I found r58599 and r56322 that set DECL_WEAK, but they
were just syncing from the apple gcc. I am not exactly sure what that
means, since the last commit to
svn://gcc.gnu.org/svn/gcc/branches/apple was in 2006, 2 years earlier.

In summary, I have no idea why weak linkage was being used :-(

To quote John McCall, "Let’s try without it and see" :-)

llvm-svn: 203059
2014-03-06 01:57:34 +00:00
Raul E. Silvera 57a9850961 Update clang test to cover for new treatment of intrinsics as readnone.
llvm-svn: 203056
2014-03-06 01:37:10 +00:00
Rafael Espindola 5d117f3742 Construct GlobalValues with the correct linkage instead of using setLinkage.
llvm-svn: 203052
2014-03-06 01:10:46 +00:00
Ted Kremenek 7549f0f9bf [-Wunreachable-code] Handle idiomatic do...while() with an uninteresting condition.
Sometimes do..while() is used to create a scope that can be left early.
In such cases, the unreachable 'while()' test is not usually interesting
unless it actually does something that is observable.

llvm-svn: 203051
2014-03-06 01:09:45 +00:00
Richard Trieu 532018f7a5 Change the color of comment nodes from bright yellow to blue. Bright yellow on
a white background is difficult to read.  Also include a chart showing which
colors are used by which elements in the AST dump.

llvm-svn: 203050
2014-03-06 01:09:03 +00:00
Chandler Carruth 0654bacac3 [Layering] Update include of DebugInfo.h which moved to the IR library
in LLVM r203046.

llvm-svn: 203047
2014-03-06 00:46:56 +00:00
Fariborz Jahanian 15dde89357 Objective-C properties. Fixes a crash in Sema where RHS of
the property assignment is an lvalue for an incomplete type.
// rdar://15118128. Reviewed offline by John McCall.

llvm-svn: 203043
2014-03-06 00:34:05 +00:00
Richard Smith bb29e518c8 Switch to an idiomatic C++ erase/remove for this loop, and fix a bug in the
process (I don't believe it's possible to write a testcase for the bug with
a non-checking STL implementation).

llvm-svn: 203042
2014-03-06 00:33:23 +00:00
Chandler Carruth 7c582545a4 [Layering] Update include for the move of DIBuilder.h to the IR library
in LLVM r203038.

llvm-svn: 203039
2014-03-06 00:22:29 +00:00
Ted Kremenek 1de2e14f2f [-Wunreachable-code] Handle idiomatic do...while() with an uninteresting condition.
Sometimes do..while() is used to create a scope that can be left early.
In such cases, the unreachable 'while()' test is not usually interesting
unless it actually does something that is observable.

llvm-svn: 203036
2014-03-06 00:17:44 +00:00
NAKAMURA Takumi 5145f4c1c8 clang/test/Modules/recursive.c: Tweak expressions for win32.
llvm-svn: 203034
2014-03-06 00:12:04 +00:00
Ted Kremenek 0a69cabd35 [-Wunreachable-code] generalize pruning out warning on trivial returns.
Previously we only pruned dead returns preceded by a call to a
'noreturn' function.  After looking at the results of the LLVM codebase,
there are many others that should be pruned as well.

llvm-svn: 203029
2014-03-05 23:46:07 +00:00
Fariborz Jahanian 6766f8d23b Objective-C. Suppress the warning for auto synthesis of property not
synthesizing protocol properties if class's super class
implements them. // rdar://16089191

llvm-svn: 203028
2014-03-05 23:44:00 +00:00
Ted Kremenek 21eea24d79 [-Wunreachabe-code] add test for double 'break'.
llvm-svn: 203027
2014-03-05 23:38:43 +00:00
Ted Kremenek 01a39b601f [-Wunreachable-code] include some enum constants in "configuration value" heuristic
llvm-svn: 203026
2014-03-05 23:38:41 +00:00
Richard Smith da3f4fd3fe PR19010: Make sure we initialize (empty) indirect base class subobjects when
evaluating trivial default initialization of a literal class type.

llvm-svn: 203025
2014-03-05 23:32:50 +00:00
Ted Kremenek 760a2acbb5 Fix recursion bug in logic to validate 'objc_protocol_requires_explicit_implementation' conformance.
llvm-svn: 203024
2014-03-05 23:18:22 +00:00
Richard Smith a13f8ae84e DR status page: add link targets for individual DRs, and link duplicates.
llvm-svn: 203022
2014-03-05 23:02:47 +00:00
Richard Smith faf156ad15 Tests for DR370-380.
Also promote a couple of Warnings on ill-formed code found by this testing to
ExtWarns.

llvm-svn: 203021
2014-03-05 22:54:58 +00:00
Ted Kremenek 3cdbc39a6e [-Wunreachable-code] generalize configuration value checking to all comparison operators.
llvm-svn: 203016
2014-03-05 22:32:39 +00:00
Aaron Ballman 4853a10e57 Updating this test case to appease build bots which support ANSI escape sequences (unlike my dev box).
llvm-svn: 203014
2014-03-05 21:59:02 +00:00
Aaron Ballman 6c8100748f Capabilities are required to pass a name specifying what type of capability is being annotated. There are currently only two supported names: mutex and role. Adding functionality to check for the capability name and diagnose when it's unexpected.
Note that for backwards compatibility, an unnamed capability will default to being a "mutex." This allows the deprecated lockable attribute to continue to function.

llvm-svn: 203012
2014-03-05 21:47:13 +00:00
Ben Langmuir 9385323747 Attempt to re-enable the VFS unittests on Windows
Using a //net/ path to hopefully avoid problems with non-absolute paths
on Windows.

llvm-svn: 203010
2014-03-05 21:32:20 +00:00
Rafael Espindola 191b95125a Don't produce an alias between destructors with different calling conventions.
Fixes pr19007.

llvm-svn: 203007
2014-03-05 21:04:41 +00:00
Richard Smith 7bea1d42d8 When building a module from the command line via -emit-module, add an entry to
the module build stack for the module being built, so we can correctly detect
recursive module builds.

llvm-svn: 203006
2014-03-05 20:55:36 +00:00
Richard Smith 8c71eba19f If a #include finds a file relative to the current file, don't forget to check
whether it's part of a module.

llvm-svn: 203005
2014-03-05 20:51:45 +00:00
Nico Weber fcf6128c71 Mention clang-cl in MSVCCompatibility.rst
llvm-svn: 203002
2014-03-05 20:18:59 +00:00
Rafael Espindola 1368f8ac96 Update for llvm change.
llvm-svn: 203000
2014-03-05 20:08:57 +00:00
Argyrios Kyrtzidis f8d46fb6eb [code-completion] Add a couple of test cases suggested by Jordan, and a FIXME.
llvm-svn: 202995
2014-03-05 19:10:31 +00:00
David Majnemer f27217ffaf AST: Remove layering violation with Sema
Scope lives in Sema and cannot be used in AST. Shuffle things around.

llvm-svn: 202993
2014-03-05 18:55:38 +00:00
Aaron Ballman 8f1439bd0c [C++11] Using std::unique_ptr to ensure that Argument objects do not leak (since clang-tblgen isn't long-lived, the old leak is probably acceptable, but it offended my senses nonetheless).
llvm-svn: 202989
2014-03-05 16:49:55 +00:00
Ben Langmuir 53145df884 Use ThreadSafeRefCountedBase for vfs::FileSystem
Allow trivial read-only filesystems such as RealFileSystem to be shared
between threads.

llvm-svn: 202986
2014-03-05 15:25:59 +00:00
Timur Iskhodzhanov 77764b6d4c Style fix: replace "1 entries" with "1 entry" in the vftable layout dumping code
llvm-svn: 202978
2014-03-05 13:54:07 +00:00
Benjamin Kramer 65f0a4a1af Revert "[C++11] Replace trivial lambda with std::cref."
MSVC2013's standard library is too broken to understand this pattern.

llvm-svn: 202971
2014-03-05 13:25:00 +00:00
Benjamin Kramer fcef811822 [C++11] Replace trivial lambda with std::cref.
llvm-svn: 202968
2014-03-05 11:38:18 +00:00
Alexander Kornienko cef10edcb2 Added a const qualifier to SourceManager& parameters.
llvm-svn: 202964
2014-03-05 10:38:27 +00:00
David Majnemer f017ec360c MS ABI: Mangle lambdas
Use a scheme inspired by the Itanium ABI to properly implement the
mangling of lambdas.

N.B.  The incredibly astute observer will notice that we do not generate
external names that are identical, or even compatible with, MSVC.
This is fine because they don't generate names that they can use across
translation units.  Technically, we can generate any name we'd like so
long as that name wouldn't conflict with any other and would be stable
across translation units.

This fixes PR15512.

llvm-svn: 202962
2014-03-05 10:35:06 +00:00
NAKAMURA Takumi 6a927ecb7a Disable BasicTests/VFS on win32 for now. Investigating.
Failing Tests (5):
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MultiComponentPath
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.TrailingSlashes
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName

llvm-svn: 202952
2014-03-05 09:10:04 +00:00
David Majnemer 2206bf5d5b [-cxx-abi microsoft] Implement local manglings accurately
Summary:
The MSVC ABI appears to mangle the lexical scope into the names of
statics.  Specifically, a counter is incremented whenever a scope is
entered where things can be declared in such a way that an ambiguity can
arise.  For example, a class scope inside of a class scope doesn't do
anything interesting because the nested class cannot collide with
another nested class.

There are problems with this scheme:
- It is unreliable. The counter is only incremented when a previously
  never encountered scope is entered.  There are cases where this will
  cause ambiguity amongst declarations that have the same name where one
  was introduced in a deep scope while the other was introduced right
  after in the previous lexical scope.
- It is wasteful.  Statements like: {{{{{{{ static int foo = a; }}}}}}}
  will make the mangling of "foo" larger than it need be because the
  scope counter has been incremented many times.

Because of these problems, and practical implementation concerns.  We
choose not to implement this scheme if the local static or local type
isn't visible.  The mangling of these declarations will look very
similar but the numbering will make far more sense, this scheme is
lifted from the Itanium ABI implementation.

Reviewers: rsmith, doug.gregor, rnk, eli.friedman, cdavis5x

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 202951
2014-03-05 08:57:59 +00:00
Ted Kremenek 4b3c66e6e8 Adjust logic for 'objc_protocol_requires_explicit_implementation' for inherited protocols and protocols already conformed in the class hierarchy.
Per more discussion, 'objc_protocol_requires_explicit_implementation' is
refinement that it mainly adds that requirement that a protocol must be
explicitly satisfied at the moment the first class in the class hierarchy
conforms to it.  Any subclasses that also conform to that protocol,
either directly or via conforming to a protocol that inherits that protocol,
do not need to re-implement that protocol.

Doing this requires first doing a pass on the super class hierarchy,
gathering the set of protocols conformed to by the super classes,
and then culling those out when determining conformance.  This
two-pass algorithm could be generalized for all protocol checking,
and could possibly be a performance win in some cases.  For now
we restrict this change to protocols with this attribute to isolate
the change in logic (especially as the design continues to evolve).

This change needs to be adjusted for properties as well; this
only impacts methods right now.

llvm-svn: 202948
2014-03-05 08:13:08 +00:00
Alexey Bataev 2759a7c9c0 [OPENMP] allow clause 'private' on directive 'omp simd'
llvm-svn: 202944
2014-03-05 07:21:14 +00:00
Alexey Bataev 18a3764b4f [OPENMP] emit error message for clause 'if(1 0)'
llvm-svn: 202942
2014-03-05 06:53:13 +00:00
Argyrios Kyrtzidis 0692508670 [AST] A "Class<P>" type should not have '*' when printed out.
rdar://14309030

llvm-svn: 202941
2014-03-05 06:47:57 +00:00
Alexey Bataev af7849e7c7 [OPNEMP] Fixed instantiation of 'if' clause
llvm-svn: 202940
2014-03-05 06:45:14 +00:00
David Majnemer 197e2103a2 Speculatively fix MSVC buildbots
llvm-svn: 202938
2014-03-05 06:32:38 +00:00
Peter Collingbourne 875ba2da47 Merge using-decl-pr17575.cpp into existing test case.
llvm-svn: 202925
2014-03-05 02:12:55 +00:00
Peter Collingbourne 01c7d98043 Add a test case for PR17575.
llvm-svn: 202922
2014-03-05 01:49:35 +00:00
Ted Kremenek 6d9bb56cd3 [-Wunreachable-code] Don't warn about dead code guarded by a "configuration value".
Some unreachable code is only "sometimes unreachable" because it
is guarded by a configuration value that is determined at compile
time and is always constant.  Sometimes those represent real bugs,
but often they do not.  This patch causes the reachability analysis
to cover such branches even if they are technically unreachable
in the CFG itself.  There are some conservative heuristics at
play here to determine a "configuration value"; these are intended
to be refined over time.

llvm-svn: 202912
2014-03-05 00:01:17 +00:00
David Majnemer 1e57976ec0 Headers: Provide an ABI compatible max_align_t when _MSC_VER is defined
Summary:
Our usual definition of max_align_t wouldn't match up with MSVC if it
was used in a template argument.

Reviewers: chandlerc, rsmith, rnk

Reviewed By: chandlerc

CC: cfe-commits

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

llvm-svn: 202911
2014-03-04 23:43:48 +00:00
David Blaikie 9afd5daea3 Remove some unnecessary qualification
llvm-svn: 202909
2014-03-04 23:39:18 +00:00
Fariborz Jahanian 7a5830294f Objective-C. Return 0 as class of methods in protocols.
This simplifies my last patch a bit. No change in
functionality.

llvm-svn: 202906
2014-03-04 22:57:32 +00:00
Ben Langmuir a6f8ca8c5f Support relative paths in VFSFromYAML
Use llvm::sys::fs::make_absolute to get an absolute path before
matching. Also, allow "." directories to enable testing.  ".." is still
not supported, and will require crossing file system boundaries to
implement correctly.

llvm-svn: 202903
2014-03-04 22:34:50 +00:00
David Majnemer 75991301d2 TokenKinds: _Atomic isn't a keyword in MS mode
Summary:
This is needed to allow MSVC's <atomic> header to properly parse.
It uses _Atomic as a class-id.

Reviewers: rnk

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 202901
2014-03-04 22:07:09 +00:00
David Blaikie 0856f66dd2 DebugInfo: Refix r202888 (a fix to r202769) in a different way, ensuring types aren't needlessly built during -gmlt
llvm-svn: 202900
2014-03-04 22:01:08 +00:00
Ted Kremenek 5a09527d0d [CFG] Tweak "?:" CFG construction to record the unreachable blocks.
llvm-svn: 202898
2014-03-04 21:53:26 +00:00
Richard Smith 841f1c782e [C++11] Simplify a callback to use a lambda.
llvm-svn: 202897
2014-03-04 21:50:01 +00:00
Benjamin Kramer cfcdd23339 Revert "FileEntry: Remove unused and half-broken copy ctor."
Looks like libstdc++ 4.7 still needs it.

llvm-svn: 202896
2014-03-04 21:49:45 +00:00
Benjamin Kramer 5bc79bfc10 [C++11] Push move semantics through APValue.
llvm-svn: 202894
2014-03-04 21:47:57 +00:00
Benjamin Kramer 4bd1ffa3ee FileEntry: Remove unused and half-broken copy ctor.
llvm-svn: 202893
2014-03-04 21:47:50 +00:00
Ted Kremenek eb862849a1 [-Wunreachable-code] handle cases where a dead 'return' may have a valid predecessor.
Fies PR19040.

llvm-svn: 202892
2014-03-04 21:41:38 +00:00
Reid Kleckner dfb1887cc9 Add a test case for r202888, which boiled down to -gline-tables-only
clang-cl defaults to -gline-tables-only, because that's the only
CodeView debug info that LLVM knows how to emit.

llvm-svn: 202891
2014-03-04 21:33:26 +00:00
Richard Smith 2f0e4e78b2 Add tests for newly-resolved core issues <= 370.
llvm-svn: 202889
2014-03-04 21:14:30 +00:00
Reid Kleckner e0b9201f5a Fix unconditional dereference of a WeakVH in CGDebugInfo TypeCache
This fails an "isa<> used with null pointer" assert during a clang-cl
self-host on Windows.  This was caused by r202769, and I'm currently
reducing a test case.

Reviewers: dblaikie

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

llvm-svn: 202888
2014-03-04 20:51:58 +00:00
Richard Smith 37213e219b Update DR status page to match post-Issaquah core issues list.
llvm-svn: 202886
2014-03-04 20:44:20 +00:00
Richard Smith 586cd94340 Add links to TSen from post-Issaquah mailing.
llvm-svn: 202882
2014-03-04 20:22:54 +00:00
Benjamin Kramer 9299637dc0 Pass llvm::Triple objects by const reference.
Copying isn't cheap as it contains a std::string.

llvm-svn: 202880
2014-03-04 19:31:42 +00:00
Simon Atanasyan 738f85a20e [Mips] Check all MIPS toolchains to find the one that best meets command
line arguments and directories tree. The old toolchain selection heuristics
worked incorrectly when user has a reduced MIPS toolchain supports
the O32 ABI only.

Patch reviewed by Jonathan Roelofs, David Majnemer.

llvm-svn: 202873
2014-03-04 18:37:28 +00:00
Fariborz Jahanian dafffbe2be Objective-C IRGen. Fix up the hueristics for determining
if an ivar offset load is invariant iff inside an instance method
and ivar belongs to instance method's class and one of its super class.
// rdar://16095748

llvm-svn: 202872
2014-03-04 18:34:52 +00:00
Roman Divacky b8322b13f8 The wmmintrin.h header includes two different sub-headers: one for AES support
and one for PCLMUL support.  The current immintrin.h header only includes
wmmintrin.h if AES support is enabled.  It should include it if either AES or
PCLMUL is enabled (GCC's version of immintrin.h does this).

Patch by John Baldwin!

llvm-svn: 202871
2014-03-04 18:26:12 +00:00
Timur Iskhodzhanov 3a9ac93478 First step towards fixing PR18967 - simplify the ComputeThisOffset interface
llvm-svn: 202870
2014-03-04 18:17:38 +00:00
Sean Callanan c94711c7e3 When deciding whether or not to resolve two
anonymous structs to the same Decl in the
ASTImporter, ensure that both are filled in
from their external sources (if present).
Otherwise two different structs may be 
identified erroneously.

llvm-svn: 202869
2014-03-04 18:11:50 +00:00
Reid Kleckner 51082b1a86 Tests for LLVM MS inline asm change r202865
llvm-svn: 202866
2014-03-04 17:57:56 +00:00
Jordan Rose af71031e3c Fix -Wsign-compare warning.
No functionality change.

llvm-svn: 202864
2014-03-04 17:45:43 +00:00
Benjamin Kramer b99c6b5d94 [C++11] Make StoredDeclsList move-only.
It is only moved when a StoredDeclsMap grows.

llvm-svn: 202859
2014-03-04 16:42:46 +00:00
Chandler Carruth 735e6d8046 [Modules] Update to reflect the move of CFG.h to the IR library in LLVM
r202827.

llvm-svn: 202828
2014-03-04 11:46:22 +00:00
Chandler Carruth 61743af166 [Modules] Update to reflect ValueHandle moving to the IR library in LLVM
r202821.

llvm-svn: 202822
2014-03-04 11:18:19 +00:00
Chandler Carruth c80ceea90b [Modules] Update to reflect the move of CallSite into the IR library in
LLVM r202816.

llvm-svn: 202817
2014-03-04 11:02:08 +00:00
Chandler Carruth 757fcd6d1f [cleanup] Re-sort includes with llvm/utils/sort_includes.py and fix
a missing include from CLog.h.

CLog.h referenced most of the core libclang types but never directly
included Index.h that provides them. Previously it got lucky and other
headers were always included first but with the sorting it ended up
first in one case and stopped compiling. Adding the Index.h include
fixes it right up.

llvm-svn: 202810
2014-03-04 10:05:20 +00:00
Yaron Keren 230f29f910 We now require Visual C++ 2012 (MSVC_VERSION = 1700) or later to build LLVM.
llvm-svn: 202804
2014-03-04 09:12:17 +00:00
NAKAMURA Takumi 4a5a9d2174 Give %itanium_abi_triple to the test to appease targeting msvc.
llvm-svn: 202803
2014-03-04 09:04:20 +00:00
Argyrios Kyrtzidis 7ffeea4ef3 [CMake] Add the newly introduced compiler header.
llvm-svn: 202792
2014-03-04 06:28:23 +00:00
David Majnemer 590604b2d4 MS ABI: Reorganize some tests
Move some c++11 specific tests to mangle-ms-cxx11

llvm-svn: 202790
2014-03-04 05:47:41 +00:00
David Majnemer 8f77453f7c MS ABI: Mangle variable templates properly
We wouldn't recognize variable templates as being templates leading us
to leave the template arguments off of the mangled name.  This would
allow two unrelated templates to map to the same mangled name.

N.B.  While MSVC doesn't support variable templates as of this date,
this mangling is the most likely thing they will choose to use.  Their
demangler can successfully demangle our manglings with the template
arguments shown.

llvm-svn: 202789
2014-03-04 05:38:05 +00:00
Alexey Bataev af02c1c003 Fix for r202778 - Implement __readeflags and __writeeflags intrinsics (renamed res to __res)
llvm-svn: 202784
2014-03-04 03:42:58 +00:00
David Blaikie 534f41ddfa DebugInfo: Make test (introduced in r202769) resilient to platforms that default to -fstandalone-debug
llvm-svn: 202780
2014-03-04 03:08:16 +00:00
David Blaikie f7f2185975 DebugInfo: Improvements/corrections to conservative emission of types in explicit template instantiation declarations
* detect out of line definitions correctly
* detect member function explicit specializations correctly

llvm-svn: 202779
2014-03-04 03:08:14 +00:00
Alexey Bataev 7cab007902 Implement __readeflags and __writeeflags intrinsics
llvm-svn: 202778
2014-03-04 03:03:03 +00:00
Pete Cooper a8290ac028 Add triple to test. On Mac OS it was failing to generate debug info which matched the check lines
llvm-svn: 202777
2014-03-04 02:56:59 +00:00
Richard Smith 309271b0ad Fix typo that resulted in names at TU scope getting lost sometimes after a
module import.

llvm-svn: 202771
2014-03-04 00:21:14 +00:00
David Blaikie 0e716b42f4 DebugInfo: Emit only the declaration of a class template that has an explicit instantiation declaration (& always emit such a type when there's an explicit instantiation definition)
We should only have this optimization fire when the explicit
instantiation definition would cause at  least one member function to be
emitted, thus ensuring that even a compiler not performing this
optimization would still emit the full type information elsewhere.

But we should also pessimize output still by always emitting the
definition when the explicit instantiation definition appears so that at
some point in the future we can depend on that information even when no
code had to be emitted in that TU. (this shouldn't happen very often,
since people mostly use explicit spec decl/defs to reduce code size -
but perhaps one day they could use it to explicitly reduce debug info
size too)

This was worth about 2% for Clang and LLVM - so not a huge win, but a
win. It looks really great for simple STL programs (include <string> and
just declare a string - 14k -> 1.4k of .dwo)

llvm-svn: 202769
2014-03-03 23:48:23 +00:00
Hans Wennborg 04110bfb77 Include <tuple> to speculatively try to fix VS2013 build after r202755
llvm-svn: 202765
2014-03-03 22:25:31 +00:00
Fariborz Jahanian 1d5c1fad68 Objective-C. Fixes a regression when figuring out linkage
for metadata symbols for forward referenced protocols which 
are never defined.  // rdar://16203115

llvm-svn: 202761
2014-03-03 21:53:57 +00:00
Richard Smith 446161b9ac Improve diagnostics for malformed constructor declarations (where lookup for
the type of the first parameter fails, and it is the only, unnamed, parameter).

llvm-svn: 202759
2014-03-03 21:12:53 +00:00
Benjamin Kramer 5367356a64 [C++11] Add missing include.
llvm-svn: 202757
2014-03-03 20:39:28 +00:00
Benjamin Kramer a741b8c451 [C++11] Simplify compare operators with std::tie.
No functionality change.

llvm-svn: 202755
2014-03-03 20:26:46 +00:00
Diego Novillo b56be64599 Schedule discriminator pass.
This needs to modify a line table test to account for the new lexical
block created to hold the new discriminator value.

llvm-svn: 202754
2014-03-03 20:06:18 +00:00
Jordan Rose ba16bce97d Re-fix previous commit.
Always run the test again, even for a trivial change...

llvm-svn: 202747
2014-03-03 19:46:28 +00:00
Jordan Rose 7b3c1bb158 Remove absolute path from r202733.
llvm-svn: 202746
2014-03-03 19:45:34 +00:00
Argyrios Kyrtzidis 3227d86f1b [libclang] Have clang_getCursorSpelling() return the string for a CXCursor_ObjCStringLiteral or CXCursor_StringLiteral cursor.
rdar://16206459

llvm-svn: 202745
2014-03-03 19:40:52 +00:00
Chandler Carruth b55d0226b7 [C++11] Remove a now unnecessary use of std::function for a remove_if
predicate. The wrapper used by SetVector was erroneously requiring an
adaptable predicate. It has been fixed and we really don't want to
require an indirect call for every predicate evaluation.

llvm-svn: 202744
2014-03-03 19:36:27 +00:00
Diego Novillo e6d398189e Update call DIBuilder::createLexicalBlock.
Create lexical blocks with discriminator value 0 by default.

llvm-svn: 202737
2014-03-03 18:53:32 +00:00
Aaron Ballman f08a5c7608 I guess we're still using LLVM_DELETED_FUNCTION instead of = delete. This should fix a complaining built bot.
llvm-svn: 202734
2014-03-03 18:41:48 +00:00
Jordan Rose 7ef1c387a0 Serialized diagnostic severity levels should be stable.
Serialized diagnostics were accidentally using the AST diagnostic level values
rather than a dedicated stable enum, so the addition of "remark" broke the
reading of existing serialized diagnostics files. I've added a .dia file
generated from Xcode 5's Clang to make sure we don't break this in the future.

llvm-svn: 202733
2014-03-03 18:29:52 +00:00
Reid Kleckner 77d7698709 Fix MSVCCompatibility doc ReST and wording.
llvm-svn: 202732
2014-03-03 18:22:25 +00:00
Aaron Ballman 3efb895bb1 Removing some unused functionality.
llvm-svn: 202727
2014-03-03 16:21:37 +00:00
Tom Stellard 81eeab3455 Update tests for addition of patch level to LLVM version
llvm-svn: 202721
2014-03-03 15:22:14 +00:00
Robert Lytton d21e2d76fc correct consitency of XCore caps
llvm-svn: 202711
2014-03-03 13:45:29 +00:00
Dmitri Gribenko 5ea34fcc8d Decl printing: add tests for typedefs
Patch by Konrad Kleine.

llvm-svn: 202709
2014-03-03 13:21:00 +00:00
Tim Northover 926a235fea AArch64: convert NEON tests to use CHECK-LABEL.
llvm-svn: 202703
2014-03-03 11:34:36 +00:00
Peter Collingbourne f93725459a MSVC 2012 doesn't support std::initializer_list at all, so don't rely on
that std::vector constructor.

llvm-svn: 202684
2014-03-03 08:13:06 +00:00
Argyrios Kyrtzidis 1594c15500 Introduce '-fmodules-user-build-path' which accepts the "canonical" path to a user workspace build.
This is used to avoid conflicts with user modules with the same name from different workspaces.

rdar://16042513

llvm-svn: 202683
2014-03-03 08:12:05 +00:00
Peter Collingbourne 2bbb029599 MSVC cannot understand temporaries formed from initializer lists.
llvm-svn: 202682
2014-03-03 07:49:35 +00:00
Argyrios Kyrtzidis d502a10c5e [libclang] Introduce APIs that assist in constructing a simple module.map file for a user framework.
rdar://16092858

llvm-svn: 202681
2014-03-03 07:41:45 +00:00
Ahmed Charles bf8e283f15 [C++11] Add #include's for OwningPtr.
Allows removing #include's in LLVM while switching to std::unique_ptr.

llvm-svn: 202677
2014-03-03 07:11:21 +00:00
Argyrios Kyrtzidis 74c96c0c75 [libclang] Change clang_VirtualFileOverlay_writeToBuffer to return a malloc'ed buffer.
Returning CXString is not appropriate if we want to switch to a non-string format buffer.

llvm-svn: 202675
2014-03-03 06:38:52 +00:00
Peter Collingbourne c0423b349b Disable all dependency output options when using the Tooling library.
It isn't appropriate for a tool to be stomping over the dependency files,
especially if the actual build uses a compiler other than Clang or the tool
cannot find all the headers for some reason (which would cause the existing
dependency file to be deleted).

If a tool actually needs to care about dependency files we can think about
adding a mechanism for getting to this information.

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

llvm-svn: 202669
2014-03-02 23:37:26 +00:00
David Majnemer dbd6acb64b Revert "Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__"
This commit reverts r201037, it's functionality is not needed given the
definition of std::max_align_t in libcxx circa r201843.

llvm-svn: 202667
2014-03-02 23:01:10 +00:00
David Majnemer b100410365 Normalize line endings
Some files had CRLF line terminators, some only had a mixture of
CRLF and LF.  Switch to LF.

llvm-svn: 202659
2014-03-02 18:46:05 +00:00
Hal Finkel f7a07a5010 Add a PPC inline asm constraint type for single CR bits
This adds support for the PPC "wc" inline asm constraint (used for allocating
individual CR bits). Support for this constraint type was recently added to the
LLVM PowerPC backend. Although gcc does not currently support allocating
individual CR bits, this identifier choice has been coordinated with the gcc
PowerPC team, and will be marked as reserved for this purpose in the gcc
constraints.md file.

Prior to this change, none of the multi-character PPC constraints were handled
correctly (the '^' escape character was not being added as required by the
parsing code in LLVM). This should now be fixed. I'll add tests for these other
constraints as support is added for them in the backend.

llvm-svn: 202658
2014-03-02 18:24:18 +00:00
David Majnemer fc256c3952 AttributeReference: Use UNIX line endings
llvm-svn: 202656
2014-03-02 18:17:08 +00:00