]> granicus.if.org Git - clang/log
clang
10 years agoChange OwningPtr::take() to OwningPtr::release().
Ahmed Charles [Fri, 7 Mar 2014 19:33:25 +0000 (19:33 +0000)]
Change OwningPtr::take() to OwningPtr::release().

This is a precursor to moving to std::unique_ptr.

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

10 years agoRemove dead return and simplify code.
Ted Kremenek [Fri, 7 Mar 2014 18:53:05 +0000 (18:53 +0000)]
Remove dead return and simplify code.

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

10 years agoRenaming the chains() ranged iterator to chain() per suggestion by Richard Smith.
Aaron Ballman [Fri, 7 Mar 2014 18:36:15 +0000 (18:36 +0000)]
Renaming the chains() ranged iterator to chain() per suggestion by Richard Smith.

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

10 years ago[C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() with...
Aaron Ballman [Fri, 7 Mar 2014 18:11:58 +0000 (18:11 +0000)]
[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.

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

10 years agoAdd a note in the user manual that tsan is not supported on Mac.
Nico Weber [Fri, 7 Mar 2014 18:11:40 +0000 (18:11 +0000)]
Add a note in the user manual that tsan is not supported on Mac.

Patch from Sean McBride <sean@rogue-research.com>!

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

10 years ago"Mac OS/X" -> "Mac OS X" spelling fixes for clang.
Nico Weber [Fri, 7 Mar 2014 18:09:57 +0000 (18:09 +0000)]
"Mac OS/X" -> "Mac OS X" spelling fixes for clang.

Patch from Sean McBride <sean@rogue-research.com>!

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

10 years ago[C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterato...
Aaron Ballman [Fri, 7 Mar 2014 17:50:17 +0000 (17:50 +0000)]
[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.

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

10 years ago[C++11] Adding an iterator_range accessor for parameter declarations to the CaptureDe...
Aaron Ballman [Fri, 7 Mar 2014 16:40:17 +0000 (16:40 +0000)]
[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.

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

10 years ago[C++11] Replacing BlockDecl iterators param_begin() and param_end() with iterator_ran...
Aaron Ballman [Fri, 7 Mar 2014 16:09:59 +0000 (16:09 +0000)]
[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.

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

10 years ago[C++11] Replacing FunctionDecl iterators param_begin() and param_end() with iterator_...
Aaron Ballman [Fri, 7 Mar 2014 15:12:56 +0000 (15:12 +0000)]
[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.

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

10 years ago[C++11] Replace LLVM-style type traits with C++11 standard ones.
Benjamin Kramer [Fri, 7 Mar 2014 14:30:23 +0000 (14:30 +0000)]
[C++11] Replace LLVM-style type traits with C++11 standard ones.

No functionality change.

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

10 years ago[C++11] Replacing iterators ddiag_begin() and ddiag_end() with iterator_range ddiags...
Aaron Ballman [Fri, 7 Mar 2014 14:09:15 +0000 (14:09 +0000)]
[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.

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

10 years ago[C++11] Updating getUsingDirectives to use iterator_range instead of a std::pair.
Aaron Ballman [Fri, 7 Mar 2014 13:44:44 +0000 (13:44 +0000)]
[C++11] Updating getUsingDirectives to use iterator_range instead of a std::pair.

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

10 years agoFully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
Aaron Ballman [Fri, 7 Mar 2014 13:13:38 +0000 (13:13 +0000)]
Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.

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

10 years ago[C++11] Replacing iterators attr_begin() and attr_end() with iterator_range attrs...
Aaron Ballman [Fri, 7 Mar 2014 12:50:00 +0000 (12:50 +0000)]
[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.

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

10 years agoRemove a test that we don't need anymore
Timur Iskhodzhanov [Fri, 7 Mar 2014 10:21:25 +0000 (10:21 +0000)]
Remove a test that we don't need anymore

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

10 years ago[OPENMP] Fix for threadprivate construct instantiatiation.
Alexey Bataev [Fri, 7 Mar 2014 09:46:29 +0000 (09:46 +0000)]
[OPENMP] Fix for threadprivate construct instantiatiation.

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

10 years agoFix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual inheritan...
Timur Iskhodzhanov [Fri, 7 Mar 2014 09:34:59 +0000 (09:34 +0000)]
Fix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual inheritance hierarchy

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

10 years agoExternalClangExamples: add a link to ToyClangPlugin
Dmitri Gribenko [Fri, 7 Mar 2014 09:06:12 +0000 (09:06 +0000)]
ExternalClangExamples: add a link to ToyClangPlugin

Patch by Alexey Denisov.

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

10 years agoTweak some test paths to match on Windows
Ben Langmuir [Fri, 7 Mar 2014 08:15:35 +0000 (08:15 +0000)]
Tweak some test paths to match on Windows

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

10 years ago[OPENMP] Small update in threadprivate variables processing to fix template instantia...
Alexey Bataev [Fri, 7 Mar 2014 08:03:37 +0000 (08:03 +0000)]
[OPENMP] Small update in threadprivate variables processing to fix template instantiation.

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

10 years ago[Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is TU_Prefix
Argyrios Kyrtzidis [Fri, 7 Mar 2014 07:47:58 +0000 (07:47 +0000)]
[Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is TU_Prefix
avoid warning for unused macros.

rdar://15034698

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

10 years ago[OPENMP] Fixed linked libraries for libiomp5 on Linux
Alexey Bataev [Fri, 7 Mar 2014 07:43:52 +0000 (07:43 +0000)]
[OPENMP] Fixed linked libraries for libiomp5 on Linux

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

10 years agoAdd a bunch of missing changes from r203208
Ben Langmuir [Fri, 7 Mar 2014 07:27:49 +0000 (07:27 +0000)]
Add a bunch of missing changes from r203208

Somehow lost these in a git operation.

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

10 years agoFix recent regressions in -Wreturn-type caused by heuristics to -Wunreachable-code.
Ted Kremenek [Fri, 7 Mar 2014 07:14:36 +0000 (07:14 +0000)]
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.

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

10 years agoAdd dependencies from imported modules with -MD
Ben Langmuir [Fri, 7 Mar 2014 06:40:32 +0000 (06:40 +0000)]
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.

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

10 years agoAnother one fix for getSema()/getDerived().getSema()
Alexey Bataev [Fri, 7 Mar 2014 04:16:48 +0000 (04:16 +0000)]
Another one fix for getSema()/getDerived().getSema()

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

10 years agoFixed getSema()/getDerived().getSema() diff pointed by Hal Finkel.
Alexey Bataev [Fri, 7 Mar 2014 04:01:56 +0000 (04:01 +0000)]
Fixed getSema()/getDerived().getSema() diff pointed by Hal Finkel.

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

10 years ago[-Wunreachable-code] Correctly expand artificial reachability to pruned '&&' and...
Ted Kremenek [Fri, 7 Mar 2014 02:25:53 +0000 (02:25 +0000)]
[-Wunreachable-code] Correctly expand artificial reachability to pruned '&&' and '||' branches involving configuration values.

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

10 years ago[-Wunreachable-code] Teach reachable code analysis heuristics about more literal...
Ted Kremenek [Fri, 7 Mar 2014 02:25:50 +0000 (02:25 +0000)]
[-Wunreachable-code] Teach reachable code analysis heuristics about more literal types.

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

10 years agoThe Visual Studio IDE changed behavior in VS2012. It used to be the case that
Yunzhong Gao [Fri, 7 Mar 2014 00:23:36 +0000 (00:23 +0000)]
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

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

10 years agoPartial revert of r203179. The build bots are telling me that some out-of-tree builds...
Aaron Ballman [Fri, 7 Mar 2014 00:10:58 +0000 (00:10 +0000)]
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.

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

10 years ago[C++11] Replacing iterators redecls_begin() and redecls_end() with iterator_range...
Aaron Ballman [Thu, 6 Mar 2014 23:45:36 +0000 (23:45 +0000)]
[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.

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

10 years agoC. Compare vector sizes using their raw element size instead of
Fariborz Jahanian [Thu, 6 Mar 2014 22:47:09 +0000 (22:47 +0000)]
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.

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

10 years agoUse llvm.compiler.used instead of llvm.used for objc symbols.
Rafael Espindola [Thu, 6 Mar 2014 22:15:10 +0000 (22:15 +0000)]
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.

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

10 years agoMake the test a bit stronger by showing what is added to llvm.used.
Rafael Espindola [Thu, 6 Mar 2014 22:02:16 +0000 (22:02 +0000)]
Make the test a bit stronger by showing what is added to llvm.used.

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

10 years agoRemove a dead store, add a FIXME for another.
Richard Smith [Thu, 6 Mar 2014 21:59:38 +0000 (21:59 +0000)]
Remove a dead store, add a FIXME for another.

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

10 years agoExclude invalid old decl from mismatching linkage assertion
Ismail Pazarbasi [Thu, 6 Mar 2014 21:48:45 +0000 (21:48 +0000)]
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.

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

10 years agoRemove dead code I introduced 6 years, 4 months ago in r43518.
Ted Kremenek [Thu, 6 Mar 2014 21:42:43 +0000 (21:42 +0000)]
Remove dead code I introduced 6 years, 4 months ago in r43518.

Found by -Wunreachable-code.

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

10 years agoPGO: rename profile data files from .pgodata to .profdata.
Bob Wilson [Thu, 6 Mar 2014 21:36:04 +0000 (21:36 +0000)]
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.

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

10 years agoPGO: rename FileCheck variable to follow the existing convention.
Bob Wilson [Thu, 6 Mar 2014 21:35:59 +0000 (21:35 +0000)]
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.

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

10 years agoUpdate for LLVM API change
Saleem Abdulrasool [Thu, 6 Mar 2014 20:47:19 +0000 (20:47 +0000)]
Update for LLVM API change

Use the new getObjectFormat/setObjectFormat instead of Environment now that the
file format is a separate field.

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

10 years ago[docs] s/cpp11-migrate/clang-modernize/
Rui Ueyama [Thu, 6 Mar 2014 20:30:05 +0000 (20:30 +0000)]
[docs] s/cpp11-migrate/clang-modernize/

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

10 years agoPGO: Add support for Objective-C blocks.
Bob Wilson [Thu, 6 Mar 2014 20:24:27 +0000 (20:24 +0000)]
PGO: Add support for Objective-C blocks.

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

10 years agoFix dead store and simplify. No functionality change (although the code is now
Richard Smith [Thu, 6 Mar 2014 20:00:05 +0000 (20:00 +0000)]
Fix dead store and simplify. No functionality change (although the code is now
correct if MaxEditDistance were increased to something greater than 1).

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

10 years agoMS ABI: Disambiguate the manglings for global guard variables
David Majnemer [Thu, 6 Mar 2014 19:57:36 +0000 (19:57 +0000)]
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.

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

10 years agoBased on usage, the NamedDecl is always set when constructing a CallingContext, but...
Aaron Ballman [Thu, 6 Mar 2014 19:37:24 +0000 (19:37 +0000)]
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.

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

10 years agoRefactored to use a simple helper function that wraps the logic of creating an SExprN...
Aaron Ballman [Thu, 6 Mar 2014 19:25:11 +0000 (19:25 +0000)]
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.

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

10 years agoAdd tests for MS inline asm change r203146
Reid Kleckner [Thu, 6 Mar 2014 19:19:36 +0000 (19:19 +0000)]
Add tests for MS inline asm change r203146

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

10 years agoMS ABI: Fix the initializer/finalizer mangling for static data members
David Majnemer [Thu, 6 Mar 2014 19:10:27 +0000 (19:10 +0000)]
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.

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

10 years agoVery minor simplification and typo correction; no functional changes intended.
Aaron Ballman [Thu, 6 Mar 2014 19:10:16 +0000 (19:10 +0000)]
Very minor simplification and typo correction; no functional changes intended.

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

10 years agoRevert "Use private linkage for remaining GlobalVariables with private names."
Rafael Espindola [Thu, 6 Mar 2014 18:54:12 +0000 (18:54 +0000)]
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.

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

10 years agoFix use-after-free detected by ASan bootstrap.
Richard Smith [Thu, 6 Mar 2014 18:08:08 +0000 (18:08 +0000)]
Fix use-after-free detected by ASan bootstrap.

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

10 years agoRun -fprofile-instr tests with %clang_cc1.
Bob Wilson [Thu, 6 Mar 2014 17:18:34 +0000 (17:18 +0000)]
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.

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

10 years agoExpand documentation section on comment parsing
Dmitri Gribenko [Thu, 6 Mar 2014 16:32:09 +0000 (16:32 +0000)]
Expand documentation section on comment parsing

Patch by Jonathan Sauer, with a little editing by me.

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

10 years ago[ASTPrinter] 'SEL' isn't a ObjCObjectPointer, so we don't need to handle it in TypePr...
Argyrios Kyrtzidis [Thu, 6 Mar 2014 15:31:56 +0000 (15:31 +0000)]
[ASTPrinter] 'SEL' isn't a ObjCObjectPointer, so we don't need to handle it in TypePrinter::printObjCObjectPointerBefore.

Suggested by Jordan.

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

10 years agoFix operator<< recognition (PR19064).
Alexander Kornienko [Thu, 6 Mar 2014 15:13:08 +0000 (15:13 +0000)]
Fix operator<< recognition (PR19064).

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

10 years ago[C++11] Adding override specifiers where appropriate, and removing virtual specifiers...
Aaron Ballman [Thu, 6 Mar 2014 15:09:50 +0000 (15:09 +0000)]
[C++11] Adding override specifiers where appropriate, and removing virtual specifiers where not needed.

No functional changes intended.

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

10 years agoReformatting the style used within the massive attribute semantic handling switch...
Aaron Ballman [Thu, 6 Mar 2014 14:02:27 +0000 (14:02 +0000)]
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.

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

10 years agoAdded an inserter for ArrayRef<SourceRange>.
Alexander Kornienko [Thu, 6 Mar 2014 13:23:30 +0000 (13:23 +0000)]
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

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

10 years ago[OPENMP] Updated comments and _OPENMP macro value for OpenMP 4.0 (for 'omp simd'...
Alexey Bataev [Thu, 6 Mar 2014 12:27:56 +0000 (12:27 +0000)]
[OPENMP] Updated comments and _OPENMP macro value for OpenMP 4.0 (for 'omp simd' support)

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

10 years ago[OPENMP] Missed test for 'simd private'
Alexey Bataev [Thu, 6 Mar 2014 11:48:22 +0000 (11:48 +0000)]
[OPENMP] Missed test for 'simd private'

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

10 years ago[-Wunreachable-code] Refine treating all branches of 'switch' as reachable, which...
Ted Kremenek [Thu, 6 Mar 2014 08:09:00 +0000 (08:09 +0000)]
[-Wunreachable-code] Refine treating all branches of 'switch' as reachable, which includes those with all cases covered but with no 'default:'.

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

10 years agoCodeGenObjC/instr-profile.m: Add -target darwin to appease bots.
NAKAMURA Takumi [Thu, 6 Mar 2014 07:29:30 +0000 (07:29 +0000)]
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 {

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

10 years ago[-Wunreachable-code] don't warn about dead 'return <string literal>' dominated by...
Ted Kremenek [Thu, 6 Mar 2014 06:50:46 +0000 (06:50 +0000)]
[-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.

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

10 years agoAttempt to fix buildbots by dropping the -LABEL from some FileCheck patterns.
Bob Wilson [Thu, 6 Mar 2014 06:49:37 +0000 (06:49 +0000)]
Attempt to fix buildbots by dropping the -LABEL from some FileCheck patterns.

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

10 years ago[OPENMP] Clause 'num_threads'
Alexey Bataev [Thu, 6 Mar 2014 06:15:19 +0000 (06:15 +0000)]
[OPENMP] Clause 'num_threads'

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

10 years agoPGO: add instrumentation for Objective-C methods.
Bob Wilson [Thu, 6 Mar 2014 06:10:02 +0000 (06:10 +0000)]
PGO: add instrumentation for Objective-C methods.

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

10 years ago[OPENMP] Added option -fopenmp=libiomp5|libgomp
Alexey Bataev [Thu, 6 Mar 2014 05:43:53 +0000 (05:43 +0000)]
[OPENMP] Added option -fopenmp=libiomp5|libgomp

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

10 years agoRemove 'break' dominated by 'return' in 'EmitBuiltinExpr'.
Ted Kremenek [Thu, 6 Mar 2014 05:37:38 +0000 (05:37 +0000)]
Remove 'break' dominated by 'return' in 'EmitBuiltinExpr'.

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

10 years agoRemove 2 dead 'break' statements. The 'break' usage in this switch is inconsistent...
Ted Kremenek [Thu, 6 Mar 2014 05:37:35 +0000 (05:37 +0000)]
Remove 2 dead 'break' statements.  The 'break' usage in this switch is inconsistent, making this hard to see.

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

10 years agoRemove dead return in Parser::MayBeDesignationStart().
Ted Kremenek [Thu, 6 Mar 2014 05:37:32 +0000 (05:37 +0000)]
Remove dead return in Parser::MayBeDesignationStart().

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

10 years agoRemove dead return in BugReporter (found via -Wunreachable-code).
Ted Kremenek [Thu, 6 Mar 2014 05:37:28 +0000 (05:37 +0000)]
Remove dead return in BugReporter (found via -Wunreachable-code).

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

10 years agoPGO: Use the main file name to help distinguish functions with local linkage.
Bob Wilson [Thu, 6 Mar 2014 04:55:41 +0000 (04:55 +0000)]
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.

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

10 years agoPGO: Rename variables to avoid referring to the "MangledName" of a function.
Bob Wilson [Thu, 6 Mar 2014 04:55:37 +0000 (04:55 +0000)]
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.

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

10 years agoRefactor PGO code in preparation for handling non-C/C++ code.
Bob Wilson [Thu, 6 Mar 2014 04:55:35 +0000 (04:55 +0000)]
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.

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

10 years agoPGO: don't emit counter increment if no counters have been allocated.
Bob Wilson [Thu, 6 Mar 2014 04:55:28 +0000 (04:55 +0000)]
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.

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

10 years ago[Layering] Update include of Linker.h to match its move to a Linker
Chandler Carruth [Thu, 6 Mar 2014 03:46:44 +0000 (03:46 +0000)]
[Layering] Update include of Linker.h to match its move to a Linker
subdirectory in LLVM r203065.

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

10 years agoFix crash if a submodule overrides one of its own macros, and add support for
Richard Smith [Thu, 6 Mar 2014 03:16:27 +0000 (03:16 +0000)]
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.

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

10 years agoFix test from r203061
Richard Trieu [Thu, 6 Mar 2014 02:28:22 +0000 (02:28 +0000)]
Fix test from r203061

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

10 years agoSuppress diagnostics during name lookup for absolute value type.
Richard Trieu [Thu, 6 Mar 2014 02:25:04 +0000 (02:25 +0000)]
Suppress diagnostics during name lookup for absolute value type.

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

10 years agoUse private linkage for remaining GlobalVariables with private names.
Rafael Espindola [Thu, 6 Mar 2014 01:57:34 +0000 (01:57 +0000)]
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" :-)

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

10 years agoUpdate clang test to cover for new treatment of intrinsics as readnone.
Raul E. Silvera [Thu, 6 Mar 2014 01:37:10 +0000 (01:37 +0000)]
Update clang test to cover for new treatment of intrinsics as readnone.

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

10 years agoConstruct GlobalValues with the correct linkage instead of using setLinkage.
Rafael Espindola [Thu, 6 Mar 2014 01:10:46 +0000 (01:10 +0000)]
Construct GlobalValues with the correct linkage instead of using setLinkage.

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

10 years ago[-Wunreachable-code] Handle idiomatic do...while() with an uninteresting condition.
Ted Kremenek [Thu, 6 Mar 2014 01:09:45 +0000 (01:09 +0000)]
[-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.

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

10 years agoChange the color of comment nodes from bright yellow to blue. Bright yellow on
Richard Trieu [Thu, 6 Mar 2014 01:09:03 +0000 (01:09 +0000)]
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.

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

10 years ago[Layering] Update include of DebugInfo.h which moved to the IR library
Chandler Carruth [Thu, 6 Mar 2014 00:46:56 +0000 (00:46 +0000)]
[Layering] Update include of DebugInfo.h which moved to the IR library
in LLVM r203046.

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

10 years agoObjective-C properties. Fixes a crash in Sema where RHS of
Fariborz Jahanian [Thu, 6 Mar 2014 00:34:05 +0000 (00:34 +0000)]
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.

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

10 years agoSwitch to an idiomatic C++ erase/remove for this loop, and fix a bug in the
Richard Smith [Thu, 6 Mar 2014 00:33:23 +0000 (00:33 +0000)]
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).

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

10 years ago[Layering] Update include for the move of DIBuilder.h to the IR library
Chandler Carruth [Thu, 6 Mar 2014 00:22:29 +0000 (00:22 +0000)]
[Layering] Update include for the move of DIBuilder.h to the IR library
in LLVM r203038.

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

10 years ago[-Wunreachable-code] Handle idiomatic do...while() with an uninteresting condition.
Ted Kremenek [Thu, 6 Mar 2014 00:17:44 +0000 (00:17 +0000)]
[-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.

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

10 years agoclang/test/Modules/recursive.c: Tweak expressions for win32.
NAKAMURA Takumi [Thu, 6 Mar 2014 00:12:04 +0000 (00:12 +0000)]
clang/test/Modules/recursive.c: Tweak expressions for win32.

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

10 years ago[-Wunreachable-code] generalize pruning out warning on trivial returns.
Ted Kremenek [Wed, 5 Mar 2014 23:46:07 +0000 (23:46 +0000)]
[-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.

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

10 years agoObjective-C. Suppress the warning for auto synthesis of property not
Fariborz Jahanian [Wed, 5 Mar 2014 23:44:00 +0000 (23:44 +0000)]
Objective-C. Suppress the warning for auto synthesis of property not
synthesizing protocol properties if class's super class
implements them. // rdar://16089191

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

10 years ago[-Wunreachabe-code] add test for double 'break'.
Ted Kremenek [Wed, 5 Mar 2014 23:38:43 +0000 (23:38 +0000)]
[-Wunreachabe-code] add test for double 'break'.

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

10 years ago[-Wunreachable-code] include some enum constants in "configuration value" heuristic
Ted Kremenek [Wed, 5 Mar 2014 23:38:41 +0000 (23:38 +0000)]
[-Wunreachable-code] include some enum constants in "configuration value" heuristic

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

10 years agoPR19010: Make sure we initialize (empty) indirect base class subobjects when
Richard Smith [Wed, 5 Mar 2014 23:32:50 +0000 (23:32 +0000)]
PR19010: Make sure we initialize (empty) indirect base class subobjects when
evaluating trivial default initialization of a literal class type.

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

10 years agoFix recursion bug in logic to validate 'objc_protocol_requires_explicit_implementatio...
Ted Kremenek [Wed, 5 Mar 2014 23:18:22 +0000 (23:18 +0000)]
Fix recursion bug in logic to validate 'objc_protocol_requires_explicit_implementation' conformance.

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

10 years agoDR status page: add link targets for individual DRs, and link duplicates.
Richard Smith [Wed, 5 Mar 2014 23:02:47 +0000 (23:02 +0000)]
DR status page: add link targets for individual DRs, and link duplicates.

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

10 years agoTests for DR370-380.
Richard Smith [Wed, 5 Mar 2014 22:54:58 +0000 (22:54 +0000)]
Tests for DR370-380.

Also promote a couple of Warnings on ill-formed code found by this testing to
ExtWarns.

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