]> granicus.if.org Git - clang/log
clang
11 years agoRelax testcase for r188400 to not test for forward-slashes as path separators.
Adrian Prantl [Wed, 14 Aug 2013 22:10:17 +0000 (22:10 +0000)]
Relax testcase for r188400 to not test for forward-slashes as path separators.

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

11 years agoPR16875: The return type of a dependent function type is visible when it's
Richard Smith [Wed, 14 Aug 2013 20:16:31 +0000 (20:16 +0000)]
PR16875: The return type of a dependent function type is visible when it's
referenced as a member of the current instantiation. In that case, deduce the
type of the function to a dependent type rather than exposing an undeduced auto
type to the rest of the current instantiation.

The standard doesn't really say that the type is dependent in this case; I'll
bring this up with CWG.

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

11 years agoBug fix: note diagnosis on expression narrowing should say "variable template" instea...
Larisse Voufo [Wed, 14 Aug 2013 20:15:02 +0000 (20:15 +0000)]
Bug fix: note diagnosis on expression narrowing should say "variable template" instead of "static data member" when appropriate

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

11 years agoFix grammar mistake.
Shuxin Yang [Wed, 14 Aug 2013 20:07:23 +0000 (20:07 +0000)]
Fix grammar mistake.

Thank Richard Smith for figuring out this problem.

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

11 years agoDo no use -emit-llvm for -flto.
Shuxin Yang [Wed, 14 Aug 2013 19:45:49 +0000 (19:45 +0000)]
Do no use -emit-llvm for -flto.

Tested on multiple OSes.

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

11 years agoTestcase for r188400.
Benjamin Kramer [Wed, 14 Aug 2013 19:45:27 +0000 (19:45 +0000)]
Testcase for r188400.

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

11 years agoAdd support for -fsanitize-blacklist and default blacklists for DFSan.
Peter Collingbourne [Wed, 14 Aug 2013 18:54:18 +0000 (18:54 +0000)]
Add support for -fsanitize-blacklist and default blacklists for DFSan.
Also add some documentation.

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

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

11 years agoEnhance the clang -v gcc debug printing to skip obviously bad and duplicate paths.
Benjamin Kramer [Wed, 14 Aug 2013 18:38:51 +0000 (18:38 +0000)]
Enhance the clang -v gcc debug printing to skip obviously bad and duplicate paths.

Otherwise it lists all files (e.g. shared libraries) that happen to be in the
same paths the GCC installations usually reside in.

On a x86_64 Debian 7 system with i386 multilibs.
before: clang -v 2>&1|wc -l
        3059
after:  clang -v 2>&1|wc -l
        10

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

11 years ago[tests] Reapply r188354, ensure subsitution string is ascii.
Daniel Dunbar [Wed, 14 Aug 2013 16:32:20 +0000 (16:32 +0000)]
[tests] Reapply r188354, ensure subsitution string is ascii.

 - Now fixed to ensure substitution value isn't of unicode type on Python 2.6-7.

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

11 years agoRevert r188354, "[tests] Ensure subsitution string is ascii."
NAKAMURA Takumi [Wed, 14 Aug 2013 14:57:01 +0000 (14:57 +0000)]
Revert r188354, "[tests] Ensure subsitution string is ascii."

It caused "shell parser error" on win32 internal shell. ShParser doesn't expect unicode, but str.

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

11 years ago[tests] Ensure subsitution string is ascii.
Daniel Dunbar [Wed, 14 Aug 2013 05:05:39 +0000 (05:05 +0000)]
[tests] Ensure subsitution string is ascii.

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

11 years agorevert 188352
Shuxin Yang [Wed, 14 Aug 2013 04:47:39 +0000 (04:47 +0000)]
revert 188352

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

11 years agoDriver::IsUsingLTO() no longer return true when seeing -emit-llvm.
Shuxin Yang [Wed, 14 Aug 2013 04:36:53 +0000 (04:36 +0000)]
Driver::IsUsingLTO() no longer return true when seeing -emit-llvm.

The rationale for this change is to differentiate following two situations:
  1) clang -c -emit-llvm a.c
  2) clang -c -flto a.c

Reviewed by Eric Christopher. Thanks a lot!

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

11 years agoBug fix: disallow a variable template to be redeclared as a non-templated variable
Larisse Voufo [Wed, 14 Aug 2013 03:09:19 +0000 (03:09 +0000)]
Bug fix: disallow a variable template to be redeclared as a non-templated variable

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

11 years agoDriver: Forward -Wl, and -Xlink arguments when using windows linker
Hans Wennborg [Wed, 14 Aug 2013 01:24:35 +0000 (01:24 +0000)]
Driver: Forward -Wl, and -Xlink arguments when using windows linker

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

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

11 years agoRefine diagnostics in my last patch.
Fariborz Jahanian [Wed, 14 Aug 2013 00:07:10 +0000 (00:07 +0000)]
Refine diagnostics in my last patch.
// rdar://14303083

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

11 years agoDon't produce duplicate notes if we have deduction failure notes when resolving
Richard Smith [Wed, 14 Aug 2013 00:00:44 +0000 (00:00 +0000)]
Don't produce duplicate notes if we have deduction failure notes when resolving
the address of an overloaded function template.

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

11 years agoObjectiveC [QoI] issue warning if an element of an nsarray
Fariborz Jahanian [Tue, 13 Aug 2013 23:44:55 +0000 (23:44 +0000)]
ObjectiveC [QoI] issue warning if an element of an nsarray
expresison is a concatenated nsstring element.
// rdar://14303083

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

11 years agoclang-cl: Support /link option and set target to win32
Hans Wennborg [Tue, 13 Aug 2013 23:38:57 +0000 (23:38 +0000)]
clang-cl: Support /link option and set target to win32

This adds support for the /link option, which forwards
subsequent arguments to the linker.

The test for this will only work when targetting win32.
Since that's the only target where clang-cl makes sense,
use that target by default.

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

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

11 years agoFix Altivec vector literal parser hack for C++11.
Eli Friedman [Tue, 13 Aug 2013 23:38:34 +0000 (23:38 +0000)]
Fix Altivec vector literal parser hack for C++11.

It doesn't make any sense to accept "..." in the argument to a C-style cast,
so use a separate expression list parsing routine which rejects it. PR16874.

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

11 years agoLink in the ubsan runtime when building shared objects.
Nick Lewycky [Tue, 13 Aug 2013 22:32:35 +0000 (22:32 +0000)]
Link in the ubsan runtime when building shared objects.

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

11 years agosizeof(void) etc. should be a hard error in C++.
Eli Friedman [Tue, 13 Aug 2013 22:26:42 +0000 (22:26 +0000)]
sizeof(void) etc. should be a hard error in C++.

PR16872.

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

11 years agoHandle "--" explicitly in the driver
Hans Wennborg [Tue, 13 Aug 2013 21:32:29 +0000 (21:32 +0000)]
Handle "--" explicitly in the driver

Anything that comes after -- is treated as an input file. This
used to be handled automagically by the option parsing library,
but after LLVM r188314, we should handle it ourselves.

No functionality change.

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

11 years agoFix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:
Richard Smith [Tue, 13 Aug 2013 18:18:50 +0000 (18:18 +0000)]
Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:

When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).

 - Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
   set of cases, and make it track whether it found a shadowed declaration.
 - Track whether we found a declaration in the same scope (for C++) including
   across serialization and template instantiation.

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

11 years agoHave Range::overlapsWith use positive logic
Edwin Vane [Tue, 13 Aug 2013 18:11:16 +0000 (18:11 +0000)]
Have Range::overlapsWith use positive logic

Improved test to catch missing case.

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

11 years agoObjectiveC migrator: Fixes a crash and makes couple
Fariborz Jahanian [Tue, 13 Aug 2013 18:01:42 +0000 (18:01 +0000)]
ObjectiveC migrator: Fixes a crash and makes couple
of harmless changes.

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

11 years agoAdding a vector version of tooling::applyAllReplacements
Edwin Vane [Tue, 13 Aug 2013 17:38:19 +0000 (17:38 +0000)]
Adding a vector version of tooling::applyAllReplacements

One day soon, tooling::Replacements will be changed from being implemented as
an std::set to being implemented as an std::vector. Until then, some new code
using vectors of Replacements would enjoy having a version of
applyAllReplacements that takes a vector.

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

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

11 years agoFixing a conflict detection bug in tooling::deduplicate
Edwin Vane [Tue, 13 Aug 2013 16:26:44 +0000 (16:26 +0000)]
Fixing a conflict detection bug in tooling::deduplicate

If a Replacment is contained within the conflict range being built, the
conflict range would be erroneously shortened. Now fixed. Tests updated to
catch this case.

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

11 years agoMove logic to enable the vectorizer to clang
Arnold Schwaighofer [Tue, 13 Aug 2013 15:46:23 +0000 (15:46 +0000)]
Move logic to enable the vectorizer to clang

We used to decide whether to really vectorize depending on the optimization
level in PassManagerBuilder.

This patch moves this decision to the clang driver. We look at the optimization
level and whether the f(no-)vectorize is set and decide whether to vectorize.

This allows us to simplify the logic in PassManagerBuilder to just a check for
whether the vectorizer should run or not.

We now do the right thing for:
$ clang -O1 -fvectorize
$ clang -fno-vectorize -O3

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

11 years agoRefactor "MatcherList" into "VariantMatcher" and abstract the notion of a list of...
Samuel Benzaquen [Tue, 13 Aug 2013 14:54:51 +0000 (14:54 +0000)]
Refactor "MatcherList" into "VariantMatcher" and abstract the notion of a list of matchers for the polymorphic case.

Summary:
Refactor "MatcherList" into "VariantMatcher" and abstract the notion of a list of matchers for the polymorphic case.
This work is to support future changes needed for eachOf/allOf/anyOf matchers. We will add a new type on VariantMatcher.

Reviewers: klimek

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

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

11 years agoFix xcore tests to use regex.
Arnold Schwaighofer [Tue, 13 Aug 2013 14:51:38 +0000 (14:51 +0000)]
Fix xcore tests to use regex.

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

11 years agoclang-format: Add option for the offset of constructor initializers.
Daniel Jasper [Tue, 13 Aug 2013 10:58:30 +0000 (10:58 +0000)]
clang-format: Add option for the offset of constructor initializers.

Some coding styles use a different indent for constructor initializers.

Patch by Klemens Baum. Thank you.
Review: http://llvm-reviews.chandlerc.com/D1360

Post review changes: Changed data type to unsigned as a negative indent
width does not make sense and added test for configuration parsing.

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

11 years agoAdd XCore target
Robert Lytton [Tue, 13 Aug 2013 09:43:10 +0000 (09:43 +0000)]
Add XCore target

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

11 years agoFix typo in comment.
David Majnemer [Tue, 13 Aug 2013 09:17:25 +0000 (09:17 +0000)]
Fix typo in comment.

Thanks Kim Gräsman!

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

11 years agoclang-format: Improve boolean expression formatting in macros.
Daniel Jasper [Tue, 13 Aug 2013 09:09:09 +0000 (09:09 +0000)]
clang-format: Improve boolean expression formatting in macros.

Before:
  #define IF(a, b, c) if (a&&(b == c))

After:
  #define IF(a, b, c) if (a && (b == c))

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

11 years agoclang-format: Activate WebKit-style tests for MS compilers.
Daniel Jasper [Tue, 13 Aug 2013 08:29:26 +0000 (08:29 +0000)]
clang-format: Activate WebKit-style tests for MS compilers.

They were accidentally placed in the #if.

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

11 years agoclang-format: Slightly adapt line break penalties.
Daniel Jasper [Tue, 13 Aug 2013 06:50:04 +0000 (06:50 +0000)]
clang-format: Slightly adapt line break penalties.

Before:
  aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa)
                               ->aaaaaaaaa());
After:
  aaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa)->aaaaaaaaa());

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

11 years ago[-cxx-abi microsoft] Mangle __uuidof correctly into template parameters
David Majnemer [Tue, 13 Aug 2013 06:32:20 +0000 (06:32 +0000)]
[-cxx-abi microsoft] Mangle __uuidof correctly into template parameters

Summary:
It seems that __uuidof introduces a global extern "C" declaration of
type __s_GUID.  However, our implementation of __uuidof does not provide
such a declaration and thus must open-code the mangling for __uuidof in
template parameters.

This allows us to codegen scoped COM pointers and other such things.

This fixes PR16836.
Depends on D1356.

Reviewers: rnk, cdavis5x, rsmith

Reviewed By: rnk

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

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

11 years agoDrive by cleanup
David Blaikie [Tue, 13 Aug 2013 04:21:38 +0000 (04:21 +0000)]
Drive by cleanup

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

11 years agovariable templates updated for PCH serialization... Still working on test cases...
Larisse Voufo [Tue, 13 Aug 2013 02:02:26 +0000 (02:02 +0000)]
variable templates updated for PCH serialization... Still working on test cases...

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

11 years agoAnalysisBasedWarnings.cpp:: Prune "\param VariableName", possibly copypasto, in comme...
NAKAMURA Takumi [Tue, 13 Aug 2013 01:53:21 +0000 (01:53 +0000)]
AnalysisBasedWarnings.cpp:: Prune "\param VariableName", possibly copypasto, in comments. [-Wdocumentation]

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

11 years ago[-cxx-abi microsoft] Mangle TemplateArgument::Declaration for references
David Majnemer [Tue, 13 Aug 2013 01:25:35 +0000 (01:25 +0000)]
[-cxx-abi microsoft] Mangle TemplateArgument::Declaration for references

Summary:
Properly mangle declarations showing up in template arguments that are
reference parameters.  Fun-fact: undname cannot handle these!

Reviewers: rnk, cdavis5x

Reviewed By: rnk

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

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

11 years agoSilence a warning from MSVC about not returning a value
Reid Kleckner [Tue, 13 Aug 2013 00:11:59 +0000 (00:11 +0000)]
Silence a warning from MSVC about not returning a value

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

11 years agoRemove Sema includes from Analysis code to fix layering
Reid Kleckner [Mon, 12 Aug 2013 23:49:39 +0000 (23:49 +0000)]
Remove Sema includes from Analysis code to fix layering

This moves a header-only class from Sema to Analysis and puts the option
check in Sema.

Patch by Chris Wailes!

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

11 years agoclang-cl: Sink /Fe and /Fo diagnostic code into BuildActions
Hans Wennborg [Mon, 12 Aug 2013 23:26:25 +0000 (23:26 +0000)]
clang-cl: Sink /Fe and /Fo diagnostic code into BuildActions

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

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

11 years agoObjectiveC migration. Add couple of routine
Fariborz Jahanian [Mon, 12 Aug 2013 23:17:13 +0000 (23:17 +0000)]
ObjectiveC migration. Add couple of routine
, currently unused, for future cf-annotation work.

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

11 years agoDebugInfo: Simplify declaration building code - relying on the limit debug info check...
David Blaikie [Mon, 12 Aug 2013 23:14:36 +0000 (23:14 +0000)]
DebugInfo: Simplify declaration building code - relying on the limit debug info checking already in CreateType(RecordType)

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

11 years agoDebugInfo: simplify some limited/declaration creation APIs
David Blaikie [Mon, 12 Aug 2013 22:24:20 +0000 (22:24 +0000)]
DebugInfo: simplify some limited/declaration creation APIs

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

11 years agoclang-cl: Consolidate tests for /Fo and /Fe into cl-outputs.c
Hans Wennborg [Mon, 12 Aug 2013 22:19:13 +0000 (22:19 +0000)]
clang-cl: Consolidate tests for /Fo and /Fe into cl-outputs.c

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

11 years agoAdd hooks to ExternalSemaSource for after-the-fact diagnosis of
Kaelyn Uhrain [Mon, 12 Aug 2013 22:11:14 +0000 (22:11 +0000)]
Add hooks to ExternalSemaSource for after-the-fact diagnosis of
incomplete types, courtesy of Luke Zarko.

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

11 years agoSpeculative build fix for r188206.
Hans Wennborg [Mon, 12 Aug 2013 22:02:09 +0000 (22:02 +0000)]
Speculative build fix for r188206.

The cmake-clang-x86_64 was upset:
error: 'template<class ImplClass, class RetTy> class clang::ConstStmtVisitor' used without template parameters

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

11 years agoclang-cl: Support the /Fe option
Hans Wennborg [Mon, 12 Aug 2013 21:56:42 +0000 (21:56 +0000)]
clang-cl: Support the /Fe option

This is used to name the linked output file.

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

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

11 years agoFix pretty-printing for unnamed unions.
Eli Friedman [Mon, 12 Aug 2013 21:54:04 +0000 (21:54 +0000)]
Fix pretty-printing for unnamed unions.

This is just a couple of minor fixes to account for the existence
of ElaboratedType.

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

11 years agoFix crash w/BlockDecl and invalid qualified decl.
Eli Friedman [Mon, 12 Aug 2013 21:54:01 +0000 (21:54 +0000)]
Fix crash w/BlockDecl and invalid qualified decl.

I'm not really satisfied with the ad-hoc nature of
Sema::diagnoseQualifiedDeclaration, but I'm not sure how to fix it.

Fixes <rdar://problem/14639501>.

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

11 years agoPatch by Chris Wailes <chris.wailes@gmail.com>.
DeLesley Hutchins [Mon, 12 Aug 2013 21:20:55 +0000 (21:20 +0000)]
Patch by Chris Wailes <chris.wailes@gmail.com>.
Reviewed by delesley, dblaikie.

Add the annotations and code needed to support a basic 'consumed' analysis.

Summary:
This new analysis is based on academic literature on linear types.  It tracks
the state of a value, either as unconsumed, consumed, or unknown.  Methods are
then annotated as CallableWhenUnconsumed, and when an annotated method is
called while the value is in the 'consumed' state a warning is issued.  A value
may be tested in the conditional statement of an if-statement; when this occurs
we know the state of the value in the different branches, and this information
is added to our analysis.  The code is still highly experimental, and the names
of annotations or the algorithm may be subject to change.

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

11 years agoForgot to add unittests/Sema/ before committing r188196 :(
Kaelyn Uhrain [Mon, 12 Aug 2013 19:57:06 +0000 (19:57 +0000)]
Forgot to add unittests/Sema/ before committing r188196 :(

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

11 years agoAdd hooks for typo correction to ExternalSemaSource, courtesy of Luke Zarko.
Kaelyn Uhrain [Mon, 12 Aug 2013 19:54:38 +0000 (19:54 +0000)]
Add hooks for typo correction to ExternalSemaSource, courtesy of Luke Zarko.

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

11 years agoclang-cl: Expand warning about /TC and /TP override, and expand test
Hans Wennborg [Mon, 12 Aug 2013 18:34:17 +0000 (18:34 +0000)]
clang-cl: Expand warning about /TC and /TP override, and expand test

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

11 years ago[Mips] MSA frontend option support
Jack Carter [Mon, 12 Aug 2013 17:20:29 +0000 (17:20 +0000)]
[Mips] MSA frontend option support

This patch adds -mmsa and -mno-msa to the options supported by
clang to enable and disable support for MSA.

When MSA is enabled, a predefined macro '__mips_msa' is defined to 1.

Patch by Daniel Sanders

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

11 years agoThis test passes on freebsd after r188178. Not exactly sure why.
Benjamin Kramer [Mon, 12 Aug 2013 16:29:25 +0000 (16:29 +0000)]
This test passes on freebsd after r188178. Not exactly sure why.

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

11 years agoSourceManager intialization tweaks.
Benjamin Kramer [Mon, 12 Aug 2013 13:46:52 +0000 (13:46 +0000)]
SourceManager intialization tweaks.

- Open files before calling stat on them.
- Go through FileManager for getting the buffer of named pipes. It has the
  necessary plumbing to deal with "volatile" files.
- Print the cause when stdin reading fails. The only case I can imagine where
  this happens is when stdin is wired to a device file, so no test case.

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

11 years agoclang-format: Improve stream-formatting.
Daniel Jasper [Mon, 12 Aug 2013 12:58:05 +0000 (12:58 +0000)]
clang-format: Improve stream-formatting.

Before:
  CHECK(controller->WriteProto(FLAGS_row_key, FLAGS_proto)) << "\""
                                                            << FLAGS_proto
                                                            << "\"";

After:
  SemaRef.Diag(Loc, diag::note_for_range_begin_end)
      << BEF << IsTemplate << Description << E->getType();

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

11 years agoFix FileCheck --check-prefix lines.
Tim Northover [Mon, 12 Aug 2013 12:51:05 +0000 (12:51 +0000)]
Fix FileCheck --check-prefix lines.

Various tests had sprung up over the years which had --check-prefix=ABC on the
RUN line, but "CHECK-ABC:" later on. This happened to work before, but was
strictly incorrect. FileCheck is getting stricter soon though.

Patch by Ron Ofir.

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

11 years agoclang-format: Correctly format alias declarations.
Daniel Jasper [Mon, 12 Aug 2013 12:16:34 +0000 (12:16 +0000)]
clang-format: Correctly format alias declarations.

Before:
  template <class CallbackClass>
  using MyCallback = void(CallbackClass::*)(SomeObject * Data);");

After:
  template <class CallbackClass>
  using MyCallback = void (CallbackClass::*)(SomeObject *Data);");

Also fix three wrong indentations.

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

11 years agoUse new llvm::SpecialCaseList API in CodeGenModule
Alexey Samsonov [Mon, 12 Aug 2013 11:48:05 +0000 (11:48 +0000)]
Use new llvm::SpecialCaseList API in CodeGenModule

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

11 years agoThis change fixes the formatting of statements such as catch (E& e).
Manuel Klimek [Mon, 12 Aug 2013 03:51:17 +0000 (03:51 +0000)]
This change fixes the formatting of statements such as catch (E& e).

Previously these were formatting as catch (E & e) because the inner parenthesis
was being marked as an expression.

Patch by Thomas Gibson-Robinson.

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

11 years agoFix misindentation.
Richard Smith [Mon, 12 Aug 2013 02:53:18 +0000 (02:53 +0000)]
Fix misindentation.

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

11 years agoOmit llvm:: before StringRef and SmallString. We have using directive in include...
Robert Wilhelm [Sat, 10 Aug 2013 13:29:01 +0000 (13:29 +0000)]
Omit  llvm:: before StringRef and SmallString. We have using directive in include/clang/Basic/LLVM.h.

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

11 years agoOmit llvm:: before SmallVector and SmallVectorImpl. We have using directive in inclu...
Robert Wilhelm [Sat, 10 Aug 2013 12:33:24 +0000 (12:33 +0000)]
Omit  llvm:: before SmallVector and SmallVectorImpl. We have using directive in include/clang/Basic/LLVM.h.

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

11 years agoFix to PR16225 (Assert-on-invalid: isa<LabelDecl>(D) && "declaration not instantiated...
Serge Pavlov [Sat, 10 Aug 2013 12:00:21 +0000 (12:00 +0000)]
Fix to PR16225 (Assert-on-invalid: isa<LabelDecl>(D) && "declaration not instantiated in this scope")

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

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

11 years agoAdded source locs for angled parentheses in class/var template partial specs.
Enea Zaffanella [Sat, 10 Aug 2013 07:24:53 +0000 (07:24 +0000)]
Added source locs for angled parentheses in class/var template partial specs.

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

11 years agoAvoid spurious error messages if parent template class cannot be instantiated
Serge Pavlov [Sat, 10 Aug 2013 05:54:47 +0000 (05:54 +0000)]
Avoid spurious error messages if parent template class cannot be instantiated

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

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

11 years agoFix warning in builds without asserts.
Rafael Espindola [Sat, 10 Aug 2013 04:25:53 +0000 (04:25 +0000)]
Fix warning in builds without asserts.

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

11 years agoSimplify now that llvm::sys::current_path checks $PWD.
Rafael Espindola [Sat, 10 Aug 2013 01:40:10 +0000 (01:40 +0000)]
Simplify now that llvm::sys::current_path checks $PWD.

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

11 years ago[analyzer] Update Open Projects and Potential Checkers pages.
Jordan Rose [Sat, 10 Aug 2013 01:24:35 +0000 (01:24 +0000)]
[analyzer] Update Open Projects and Potential Checkers pages.

- va_list checker (PR16811 and PR16812)
- Model floating-point values
- Bound bitwise masking operations (PR16615)
- Bound C string length (PR16558 and others)

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

11 years agoclang/test/Driver/cl-options.c: Suppress this on cygming due to -fno-builtin.
NAKAMURA Takumi [Sat, 10 Aug 2013 00:59:43 +0000 (00:59 +0000)]
clang/test/Driver/cl-options.c: Suppress this on cygming due to -fno-builtin.

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

11 years agoCorrectly profile CXXPseudoDestructorExprs.
Eli Friedman [Fri, 9 Aug 2013 23:37:05 +0000 (23:37 +0000)]
Correctly profile CXXPseudoDestructorExprs.

CXXPseudoDestructorExprs may not contain a type.  PR16852.

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

11 years agoExpose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.
James Dennett [Fri, 9 Aug 2013 23:08:25 +0000 (23:08 +0000)]
Expose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.

Summary:
Source-centric tools need access to the location of a C++11
lambda expression's capture-default ('&' or '=') when it's present.
It's possible for them to find it by re-lexing and re-implementing
rules that Clang's parser has already applied, but the cost of storing
the SourceLocation and making it available to them is 32 bits per
LambdaExpr (a small delta, proportionally), and the simplification in
client code is significant.

Reviewers: rsmith

Reviewed By: rsmith

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

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

11 years agoFix typo in template diffing docs.
Richard Trieu [Fri, 9 Aug 2013 22:52:48 +0000 (22:52 +0000)]
Fix typo in template diffing docs.

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

11 years agoFix for PR16570: when comparing two function pointers, discard qualifiers when
Richard Trieu [Fri, 9 Aug 2013 21:42:32 +0000 (21:42 +0000)]
Fix for PR16570: when comparing two function pointers, discard qualifiers when
comparing non-reference function parameters.  The qualifiers don't matter for
comparisons.

This is a re-commit of r187769, which was accidentially reverted in r187770,
with a simplification at the suggestion of Eli Friedman.

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

11 years ago[arcmt] When handling unbridged casts, handle the body of BlockDecl separately becaus...
Argyrios Kyrtzidis [Fri, 9 Aug 2013 20:20:25 +0000 (20:20 +0000)]
[arcmt] When handling unbridged casts, handle the body of BlockDecl separately because ParentMap does not record
Stmt parent nodes inside a BlockDecl.

Fixes rdar://14686900

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

11 years agoOmit llvm:: before ArrayRef, as we have using llvm::ArrayRef in include/clang/Basic...
Robert Wilhelm [Fri, 9 Aug 2013 18:02:13 +0000 (18:02 +0000)]
Omit  llvm:: before ArrayRef, as we have using llvm::ArrayRef in include/clang/Basic/LLVM.h.

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

11 years agoRemove "static" on simple temporary StringRef.
Benjamin Kramer [Fri, 9 Aug 2013 17:51:03 +0000 (17:51 +0000)]
Remove "static" on simple temporary StringRef.

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

11 years agoclang-cl: Don't pass /defaultlib to the linker
Hans Wennborg [Fri, 9 Aug 2013 17:38:42 +0000 (17:38 +0000)]
clang-cl: Don't pass /defaultlib to the linker

Since r187945, clang-cl will add the runtime library dependency to
the .obj file.

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

11 years agoOnly emit debug info for implicit members that actually get codegen, not just ODR...
David Blaikie [Fri, 9 Aug 2013 17:20:05 +0000 (17:20 +0000)]
Only emit debug info for implicit members that actually get codegen, not just ODR use.

This includes special members (copy/default ctor, copy assign, default
ctor) and template specializations for member function templates.

Good for a 5% decrease (1.80 to 1.71 GB) in size on Clang+LLVM's .dwo
files (when using fission).

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

11 years agoAdd a convenient way to compare GCCVersions without creating temporary objects.
Benjamin Kramer [Fri, 9 Aug 2013 17:17:48 +0000 (17:17 +0000)]
Add a convenient way to compare GCCVersions without creating temporary objects.

No functionality change.

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

11 years agoDirectIvarAssignment: Replace vtable'd objects with simple functions.
Benjamin Kramer [Fri, 9 Aug 2013 17:17:42 +0000 (17:17 +0000)]
DirectIvarAssignment: Replace vtable'd objects with simple functions.

Avoids unnecessary static constructors.

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

11 years ago[tests] Update to use lit_config and lit package, as appropriate.
Daniel Dunbar [Fri, 9 Aug 2013 14:43:04 +0000 (14:43 +0000)]
[tests] Update to use lit_config and lit package, as appropriate.

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

11 years agoFixup for r188058: assume hasAsanZeroBaseShadow() is false if ASan is not needed
Alexey Samsonov [Fri, 9 Aug 2013 10:56:42 +0000 (10:56 +0000)]
Fixup for r188058: assume hasAsanZeroBaseShadow() is false if ASan is not needed

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

11 years agoAdd lrint to the list of math builtins. It never sets errno so we can mark it as...
Benjamin Kramer [Fri, 9 Aug 2013 10:12:30 +0000 (10:12 +0000)]
Add lrint to the list of math builtins. It never sets errno so we can mark it as readnone.

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

11 years agoPut back a microoptimization with a comment to make it more obvious.
Benjamin Kramer [Fri, 9 Aug 2013 09:39:17 +0000 (09:39 +0000)]
Put back a microoptimization with a comment to make it more obvious.

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

11 years agoSema: Assertion failure during CodeGen in CodeGenModule::EmitUuidofInitializer
David Majnemer [Fri, 9 Aug 2013 08:56:20 +0000 (08:56 +0000)]
Sema: Assertion failure during CodeGen in CodeGenModule::EmitUuidofInitializer

Make sure we can properly generate code when the UUID has curly braces
on it, strip the curly braces at the sema layer.

This fixes PR16813.

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

11 years ago[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section
David Majnemer [Fri, 9 Aug 2013 08:35:59 +0000 (08:35 +0000)]
[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section

Revert r188055 which reverted r188053. An unrelated change previously snuck in.

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

11 years ago[analyzer] Enable usage of temporaries in InitListExprs
Pavel Labath [Fri, 9 Aug 2013 07:46:29 +0000 (07:46 +0000)]
[analyzer] Enable usage of temporaries in InitListExprs

Summary:
ExprEngine had code which specificaly disabled using CXXTempObjectRegions in
InitListExprs. This was a hack put in r168757 to silence a false positive.

The underlying problem seems to have been fixed in the mean time, as removing
this code doesn't seem to break anything. Therefore I propose to remove it and
solve PR16629 in the process.

Reviewers: jordan_rose

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

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

11 years agoMake SanitizerArgs parsing toolchain-independent
Alexey Samsonov [Fri, 9 Aug 2013 07:42:13 +0000 (07:42 +0000)]
Make SanitizerArgs parsing toolchain-independent

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

11 years agoUse isCharInSet from llvm/Support/UnicodeCharRanges.h, added a test for double-width...
Alexander Kornienko [Fri, 9 Aug 2013 06:35:06 +0000 (06:35 +0000)]
Use isCharInSet from llvm/Support/UnicodeCharRanges.h, added a test for double-width characters in FixIt-hints.

Summary: This is a follow-up to r187837.

Reviewers: gribozavr, jordan_rose

Reviewed By: jordan_rose

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

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

11 years agoRevert "[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section"
David Majnemer [Fri, 9 Aug 2013 05:56:24 +0000 (05:56 +0000)]
Revert "[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section"

This commit reverts r188053.

It is breaking the build bots.

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

11 years ago[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section
David Majnemer [Fri, 9 Aug 2013 05:09:04 +0000 (05:09 +0000)]
[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper section

We mangled them like:
L___uuid_12345678-1234-1234-1234-123456789abc

We should've mangled them like:
__GUID_12345678_1234_1234_1234_123456789abc

Furthermore, they are external symbols.

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

11 years agoImplement [class.friend]p11's special name lookup rules for friend declarations
Richard Smith [Fri, 9 Aug 2013 04:35:01 +0000 (04:35 +0000)]
Implement [class.friend]p11's special name lookup rules for friend declarations
of local classes. We were previously handling this by performing qualified
lookup within a function declaration(!!); replace it with the proper scope
lookup.

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

11 years ago[analyzer] Warn when using 'delete' on an uninitialized variable.
Jordan Rose [Fri, 9 Aug 2013 00:55:47 +0000 (00:55 +0000)]
[analyzer] Warn when using 'delete' on an uninitialized variable.

Patch by Karthik Bhat, modified slightly by me.

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