]> granicus.if.org Git - clang/log
clang
11 years agoInclude pruning and general cleanup.
Benjamin Kramer [Sat, 1 Dec 2012 17:12:56 +0000 (17:12 +0000)]
Include pruning and general cleanup.

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

11 years agoDon't include Type.h in DeclarationName.h.
Benjamin Kramer [Sat, 1 Dec 2012 16:35:25 +0000 (16:35 +0000)]
Don't include Type.h in DeclarationName.h.

Recursively prune some includes.

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

11 years agoMake ASTVector.h standalone without including all of ASTContext.
Benjamin Kramer [Sat, 1 Dec 2012 15:18:03 +0000 (15:18 +0000)]
Make ASTVector.h standalone without including all of ASTContext.

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

11 years agoPull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull...
Benjamin Kramer [Sat, 1 Dec 2012 15:09:41 +0000 (15:09 +0000)]
Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull in all the generated Attr code.

Required to pull some functions out of line, but this shouldn't have a perf impact.
No functionality change.

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

11 years agoFix a test that was redefining FileCheck variables while referencing old ones.
Eli Bendersky [Sat, 1 Dec 2012 13:50:51 +0000 (13:50 +0000)]
Fix a test that was redefining FileCheck variables while referencing old ones.

In preparation for the FileCheck enhancement to support backreferences.

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

11 years agoSwitch to using -### as mentioned by chandlerc.
Joey Gouly [Sat, 1 Dec 2012 13:07:22 +0000 (13:07 +0000)]
Switch to using -### as mentioned by chandlerc.

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

11 years agoAdd -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approv...
Joey Gouly [Sat, 1 Dec 2012 12:15:28 +0000 (12:15 +0000)]
Add -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approved by d0k.

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

11 years agoAdd .arcconfig to the repository. Useful if someone wants to use phabricator's comman...
Benjamin Kramer [Sat, 1 Dec 2012 12:08:08 +0000 (12:08 +0000)]
Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool.

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

11 years agoFix a typo in comment.
Michael Han [Sat, 1 Dec 2012 04:35:48 +0000 (04:35 +0000)]
Fix a typo in comment.

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

11 years agoMake these functions more clearly express the test they are performing. No functional...
Richard Smith [Sat, 1 Dec 2012 03:15:03 +0000 (03:15 +0000)]
Make these functions more clearly express the test they are performing. No functionality change.

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

11 years agoConsistently use 'needsImplicit<special member>' to determine whether we need
Richard Smith [Sat, 1 Dec 2012 02:35:44 +0000 (02:35 +0000)]
Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.

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

11 years agoTry to make the source location information for token pastes a bit more consistent.
Eli Friedman [Sat, 1 Dec 2012 01:15:54 +0000 (01:15 +0000)]
Try to make the source location information for token pastes a bit more consistent.

Fixes a crash printing diagnostics on the gcc testsuite, and also makes
diagnostic range printing print nicer results for token pastes.

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

11 years agoRemove restriction on combining ubsan with asan or tsan. This has worked for a while.
Richard Smith [Sat, 1 Dec 2012 01:02:45 +0000 (01:02 +0000)]
Remove restriction on combining ubsan with asan or tsan. This has worked for a while.

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

11 years agoFix the determination of whether a capture refers to an enclosing
Douglas Gregor [Sat, 1 Dec 2012 01:01:09 +0000 (01:01 +0000)]
Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>.

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

11 years agoDon't emit a warning with an input/output parameter. We assume the user knows what...
Bill Wendling [Fri, 30 Nov 2012 23:46:56 +0000 (23:46 +0000)]
Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.

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

11 years agoFix test for Windows path separators
Douglas Gregor [Fri, 30 Nov 2012 23:40:49 +0000 (23:40 +0000)]
Fix test for Windows path separators

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

11 years agoTeach the serialized diagnostic writer to clone() itself, sharing
Douglas Gregor [Fri, 30 Nov 2012 23:32:31 +0000 (23:32 +0000)]
Teach the serialized diagnostic writer to clone() itself, sharing
state so that all of the various clones end up rendering their
diagnostics into the same serialized-diagnostics file. This is
important when we actually want failures during module build to be
reported back to the translation unit that tried to import the
not-yet-built or out-of-date module. <rdar://problem/12565727>

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

11 years agoDon't warn if the input size is less than the register size. Also don't warn if
Bill Wendling [Fri, 30 Nov 2012 23:18:12 +0000 (23:18 +0000)]
Don't warn if the input size is less than the register size. Also don't warn if
the output size is greater than the register size. No truncation occurs with
those. Reword warning to make it clearer what's the problem is.

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

11 years agoMake -Wtautological-constant-out-of-range-compare behave sanely for enums with a...
Eli Friedman [Fri, 30 Nov 2012 23:09:29 +0000 (23:09 +0000)]
Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>.

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

11 years agoRename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!
Douglas Gregor [Fri, 30 Nov 2012 22:11:57 +0000 (22:11 +0000)]
Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!

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

11 years agoWhen we're emitting a diagnostic with a source location in an imported
Douglas Gregor [Fri, 30 Nov 2012 21:58:49 +0000 (21:58 +0000)]
When we're emitting a diagnostic with a source location in an imported
module, provide a module import stack similar to what we would get for
an include stack, e.g.,

In module 'DependsOnModule' imported from build-fail-notes.m:4:
In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1:
Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here
@interface Module

<rdar://problem/12696425>

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

11 years agoFixing a precedence issue with my previous commit.
Aaron Ballman [Fri, 30 Nov 2012 21:44:01 +0000 (21:44 +0000)]
Fixing a precedence issue with my previous commit.

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

11 years agoFixing an MSVC warning about an unsafe mixture of Boolean and unsigned types in a...
Aaron Ballman [Fri, 30 Nov 2012 21:15:20 +0000 (21:15 +0000)]
Fixing an MSVC warning about an unsafe mixture of Boolean and unsigned types in a logical operator.

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

11 years agoComments: no need to escape any characters in \code ... \endcode.
Dmitri Gribenko [Fri, 30 Nov 2012 20:04:39 +0000 (20:04 +0000)]
Comments: no need to escape any characters in \code ... \endcode.

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

11 years agoSupport for #pragma region/endregion for MSVC compatibility. Patch thanks to pravic!
Aaron Ballman [Fri, 30 Nov 2012 19:52:30 +0000 (19:52 +0000)]
Support for #pragma region/endregion for MSVC compatibility.  Patch thanks to pravic!

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

11 years agoActually keep track of the source locations at which particular module
Douglas Gregor [Fri, 30 Nov 2012 19:28:05 +0000 (19:28 +0000)]
Actually keep track of the source locations at which particular module
files are loaded.

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

11 years agoWhen an error occurs while building a module on demand, provide "While
Douglas Gregor [Fri, 30 Nov 2012 18:38:50 +0000 (18:38 +0000)]
When an error occurs while building a module on demand, provide "While
building module 'Foo' imported from..." notes (the same we we provide
"In file included from..." notes) in the diagnostic, so that we know
how this module got included in the first place. This is part of
<rdar://problem/12696425>.

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

11 years agoAllow matchers to access the ASTContext.
Manuel Klimek [Fri, 30 Nov 2012 13:45:19 +0000 (13:45 +0000)]
Allow matchers to access the ASTContext.

Patch by Edwin Vane.

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

11 years agoUpdate to reflect the change of macro name in r168993.
Chandler Carruth [Fri, 30 Nov 2012 11:04:44 +0000 (11:04 +0000)]
Update to reflect the change of macro name in r168993.

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

11 years agoFix the computation of highlight ranges so we produce something sane when
Eli Friedman [Fri, 30 Nov 2012 06:19:40 +0000 (06:19 +0000)]
Fix the computation of highlight ranges so we produce something sane when
the beginning and end of the range are in different macro arguments.
PR14399.

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

11 years agoRefactor to reduce duplication in handling of special member functions. No functional...
Richard Smith [Fri, 30 Nov 2012 05:11:39 +0000 (05:11 +0000)]
Refactor to reduce duplication in handling of special member functions. No functionality change.

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

11 years agoAdd a test case for the new cortex-a5 switch
Quentin Colombet [Fri, 30 Nov 2012 01:34:36 +0000 (01:34 +0000)]
Add a test case for the new cortex-a5 switch

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

11 years agoUse the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues.
Jordan Rose [Fri, 30 Nov 2012 01:15:32 +0000 (01:15 +0000)]
Use the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues.

If 'x' is a temporary, x.getAs<Foo>() may not be safe if the result is
supposed to persist (if its address is stored somewhere). Since getAs()
can return a null value, the result is almost always stored into a
variable, which of course is not safe when the original value dies.

This has caused several bugs with GCC's "Temporaries May Vanish Sooner Than
You Expect" optimization; in C++11 builds, at least, we'll be able to catch
these problems now.

I would suggest applying these to other getAs() and get*As() methods
(castAs is "better" because sometimes the result is used directly, which
means the temporary will still be live), but these two have both caused
trouble in the analyzer in the past.

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

11 years agoFix unit tests for ModuleLoader change in r168961.
Douglas Gregor [Fri, 30 Nov 2012 00:01:57 +0000 (00:01 +0000)]
Fix unit tests for ModuleLoader change in r168961.

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

11 years agoKeep track of modules that have failed to build. If we encounter an
Douglas Gregor [Thu, 29 Nov 2012 23:55:25 +0000 (23:55 +0000)]
Keep track of modules that have failed to build. If we encounter an
import of that module elsewhere, don't try to build the module again:
it won't work, and the experience is quite dreadful. We track this
information somewhat globally, shared among all of the related
CompilerInvocations used to build modules on-the-fly, so that a
particular Clang instance will only try to build a given module once.

Fixes <rdar://problem/12552849>.

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

11 years agoFix a small calling-convention bug for x86-32. PR14453.
Eli Friedman [Thu, 29 Nov 2012 23:21:04 +0000 (23:21 +0000)]
Fix a small calling-convention bug for x86-32.  PR14453.

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

11 years agoAdd ARM cortex-a5 subtarget
Quentin Colombet [Thu, 29 Nov 2012 23:15:27 +0000 (23:15 +0000)]
Add ARM cortex-a5 subtarget

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

11 years agoRemove out-of-date comment.
Richard Smith [Thu, 29 Nov 2012 23:09:57 +0000 (23:09 +0000)]
Remove out-of-date comment.

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

11 years agoRevert commit revision r168953, to change the commit message, which was empty
Quentin Colombet [Thu, 29 Nov 2012 23:07:08 +0000 (23:07 +0000)]
Revert commit revision r168953, to change the commit message, which was empty

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

11 years agogit-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168953 91177308-0d34-0410...
Quentin Colombet [Thu, 29 Nov 2012 22:58:40 +0000 (22:58 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168953 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis patch exposes to Clang users three more sanitizers are experimental features...
Alexey Samsonov [Thu, 29 Nov 2012 22:36:21 +0000 (22:36 +0000)]
This patch exposes to Clang users three more sanitizers are experimental features of ASan:
1) init-order sanitizer: initialization-order checker.
Status: usable, but may produce false positives w/o proper blacklisting.
2) use-after-return sanitizer
Status: implemented, but heavily understed.
Should be optional, as it significanlty slows program down.
3) use-after-scope sanitizer
Status: in progress.

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

11 years agoMake the test less sensitive to DWARF emission implementation details.
Eli Bendersky [Thu, 29 Nov 2012 20:01:14 +0000 (20:01 +0000)]
Make the test less sensitive to DWARF emission implementation details.

Note: the ":" goes into the regex because FileCheck wrongly complains about
unbalanced brackets otherwise.

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

11 years agoMake sure that we put the rest of the sanitizer libraries on the link line
Eric Christopher [Thu, 29 Nov 2012 18:51:05 +0000 (18:51 +0000)]
Make sure that we put the rest of the sanitizer libraries on the link line
before libstdc++ like we do with ubsan.

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

11 years agoUse newer command line option here.
Eric Christopher [Thu, 29 Nov 2012 18:08:24 +0000 (18:08 +0000)]
Use newer command line option here.

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

11 years agoRemove duplicate test run lines.
Eric Christopher [Thu, 29 Nov 2012 18:08:22 +0000 (18:08 +0000)]
Remove duplicate test run lines.

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

11 years agoNow that the underlying problem has been fixed, add r168411 back.
Rafael Espindola [Thu, 29 Nov 2012 16:38:22 +0000 (16:38 +0000)]
Now that the underlying problem has been fixed, add r168411 back.
Original commit message:

Remove redundant code.

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

11 years agoMerge function types in C.
Rafael Espindola [Thu, 29 Nov 2012 16:09:03 +0000 (16:09 +0000)]
Merge function types in C.

Among other differences, GCC accepts

  typedef int IA[];
  typedef int A10[10];
  static A10 *f(void);
  static IA  *f(void);
  void g(void) {
    (void)sizeof(*f());
  }

but clang used to reject it with:

  invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []')

The intention of c99's 6.2.7 seems to be that we should use the composite type
and accept as gcc does.

Doing the type merging required some extra fixes:
  * Use the type from the function type in initializations, even if an parameter
    is available.
  * Fix the merging of the noreturn attribute in function types.
  * Make CodeGen  handle the fact that an parameter type can be different from
    the corresponding type in the function type.

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

11 years agoASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Remove i128 stuff. Conditi...
NAKAMURA Takumi [Thu, 29 Nov 2012 10:22:40 +0000 (10:22 +0000)]
ASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Remove i128 stuff. Conditioning-out in macro argument was not accepted on MS cl.exe.

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

11 years agoASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Suppress i128 according...
NAKAMURA Takumi [Thu, 29 Nov 2012 09:57:11 +0000 (09:57 +0000)]
ASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Suppress i128 according to r168856, for now.

I think "i128", that I conditioned out, could be completely removed.
MS Compiler doesn't accept i128. We can assume no one would use i128.

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

11 years ago[-cxx-abi microsoft] Also spill the argument-back-references context when mangling...
Timur Iskhodzhanov [Thu, 29 Nov 2012 08:58:47 +0000 (08:58 +0000)]
[-cxx-abi microsoft] Also spill the argument-back-references context when mangling templates

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

11 years agoReject uses of __int128 on platforms that don't support it. Also move the ugly
Richard Smith [Thu, 29 Nov 2012 05:41:51 +0000 (05:41 +0000)]
Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.

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

11 years agoFix sentence construction-o.
Nico Weber [Thu, 29 Nov 2012 05:29:23 +0000 (05:29 +0000)]
Fix sentence construction-o.

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

11 years agoFix crash-on-invalid. <rdar://problem/12765391>.
Eli Friedman [Thu, 29 Nov 2012 03:13:49 +0000 (03:13 +0000)]
Fix crash-on-invalid.  <rdar://problem/12765391>.

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

11 years agoThe declaration of a special member can require overload resolution to be
Richard Smith [Thu, 29 Nov 2012 01:34:07 +0000 (01:34 +0000)]
The declaration of a special member can require overload resolution to be
performed, to determine whether that special member is deleted or constexpr.
That overload resolution process can in turn trigger the instantiation of a
template, which can do anything, including triggering the declaration of that
very same special member function. When this happens, do not try to recursively
declare the special member -- that's impossible. Instead, only try to realise
the truth. There is no special member.

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

11 years agoChange SValBuilder::getConditionType() to return BoolTy in C++. Fixes <rdar://proble...
Ted Kremenek [Thu, 29 Nov 2012 01:03:10 +0000 (01:03 +0000)]
Change SValBuilder::getConditionType() to return BoolTy in C++.  Fixes <rdar://problem/12772656>.

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

11 years agoCorrectly handle IntegralToBool casts in C++ in the static analyzer. Fixes <rdar...
Ted Kremenek [Thu, 29 Nov 2012 00:50:20 +0000 (00:50 +0000)]
Correctly handle IntegralToBool casts in C++ in the static analyzer.  Fixes <rdar://problem/12759044>.

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

11 years ago[driver] -mkernel implies -mstrict-align; don't add the redundant option.
Chad Rosier [Thu, 29 Nov 2012 00:42:06 +0000 (00:42 +0000)]
[driver] -mkernel implies -mstrict-align; don't add the redundant option.
rdar://12771737

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

11 years agoImplement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to...
Michael Han [Wed, 28 Nov 2012 23:17:40 +0000 (23:17 +0000)]
Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition.

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

11 years agoobjective-C blocks: Make sure that identical logic is used
Fariborz Jahanian [Wed, 28 Nov 2012 23:12:17 +0000 (23:12 +0000)]
objective-C blocks: Make sure that identical logic is used
in deciding a copy/dispose field is needed in a byref structure
and when generating the copy/dispose helpers. In certain
cases, these fields were being added but no copy/dispose was
being generated. This was uncovered in ARC, but not in MRR.
// rdar://12759433

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

11 years agoPer C++11 [except.spec]p2, rvalue references are not permitted in exception specifica...
Richard Smith [Wed, 28 Nov 2012 22:52:42 +0000 (22:52 +0000)]
Per C++11 [except.spec]p2, rvalue references are not permitted in exception specifications.

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

11 years agoPR14388: An array or function type in an exception specification should be
Richard Smith [Wed, 28 Nov 2012 22:33:28 +0000 (22:33 +0000)]
PR14388: An array or function type in an exception specification should be
decayed to a pointer type. Patch by WenHan Gu, with a little tweaking and
additional testcases by me.

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

11 years agoABI: comments from Eli on r168820.
Manman Ren [Wed, 28 Nov 2012 22:29:41 +0000 (22:29 +0000)]
ABI: comments from Eli on r168820.

rdar://12723368

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

11 years agoABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store of
Manman Ren [Wed, 28 Nov 2012 22:08:52 +0000 (22:08 +0000)]
ABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store of
the original parameter or return type.

Since we do not accurately represent the data fields of a union, we should not
directly load or store a union type.

As an exmple, if we have i8,i8, i32, i32 as one field type and i32,i32 as
another field type, the first field type will be chosen to represent the union.
If we load with the union's type, the 3rd byte and the 4th byte will be skipped.

rdar://12723368

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

11 years agoPR13098: If we're instantiating an overloaded binary operator and we could
Richard Smith [Wed, 28 Nov 2012 21:47:39 +0000 (21:47 +0000)]
PR13098: If we're instantiating an overloaded binary operator and we could
determine which member function would be the callee from within the template
definition, don't pass that function as a "non-member function" to
CreateOverloadedBinOp. Instead, just rely on it to select the member function
for itself.

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

11 years ago[analyzer] scan-build: Don't forget to close our temp file for Clang's output.
Jordan Rose [Wed, 28 Nov 2012 19:12:44 +0000 (19:12 +0000)]
[analyzer] scan-build: Don't forget to close our temp file for Clang's output.

Also, minor whitespace/indentation fixes.

Patch by Peeter Joot!

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

11 years ago[analyzer] scan-build: Treat '.C' files as C++.
Jordan Rose [Wed, 28 Nov 2012 19:12:29 +0000 (19:12 +0000)]
[analyzer] scan-build: Treat '.C' files as C++.

Part of PR14443.

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

11 years agoRefactor -fsanitize, -f*-sanitizer arguments parsing. Provide a more careful diagnost...
Alexey Samsonov [Wed, 28 Nov 2012 17:34:24 +0000 (17:34 +0000)]
Refactor -fsanitize, -f*-sanitizer arguments parsing. Provide a more careful diagnostic for invalid sets of sanitizers

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

11 years ago[asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), Clang part.
Kostya Serebryany [Wed, 28 Nov 2012 10:32:11 +0000 (10:32 +0000)]
[asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), Clang part.

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

11 years agoRemove obsolete comment missed by r162937
Andy Gibbs [Wed, 28 Nov 2012 08:14:36 +0000 (08:14 +0000)]
Remove obsolete comment missed by r162937

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

11 years agoTeach Lexer::getSpelling about raw string literals. Specifically, if a raw
Richard Smith [Wed, 28 Nov 2012 07:29:00 +0000 (07:29 +0000)]
Teach Lexer::getSpelling about raw string literals. Specifically, if a raw
string literal needs cleaning (because it contains line-splicing in the
encoding prefix or in the ud-suffix), do not clean the section between the
double-quotes -- that's the "raw" bit!

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

11 years agoStore on the CXXRecordDecl whether the class has, or would have, a copy
Richard Smith [Wed, 28 Nov 2012 06:23:12 +0000 (06:23 +0000)]
Store on the CXXRecordDecl whether the class has, or would have, a copy
constructor/assignment operator with a const-qualified parameter type. The
prior method for determining this incorrectly used overload resolution.

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

11 years agoRemove workaround in RegionStore in r168741 since it is handled more generally by...
Ted Kremenek [Wed, 28 Nov 2012 05:36:28 +0000 (05:36 +0000)]
Remove workaround in RegionStore in r168741 since it is handled more generally by r168757.

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

11 years agoIntroduce ASTUnresolvedSet, an UnresolvedSet-like class, whose contents are
Argyrios Kyrtzidis [Wed, 28 Nov 2012 03:56:16 +0000 (03:56 +0000)]
Introduce ASTUnresolvedSet, an UnresolvedSet-like class, whose contents are
allocated using the allocator associated with an ASTContext.

Use this inside CXXRecordDecl::DefinitionData instead of an UnresolvedSet to
avoid a potential memory leak.

rdar://12761275

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

11 years agoDon't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,
Argyrios Kyrtzidis [Wed, 28 Nov 2012 03:56:09 +0000 (03:56 +0000)]
Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,
expose only the iterators instead.

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

11 years agoC++ core issue 1344, PR10618: promote "addition of default argument makes this
Richard Smith [Wed, 28 Nov 2012 03:45:24 +0000 (03:45 +0000)]
C++ core issue 1344, PR10618: promote "addition of default argument makes this
a special member" diagnostic from warning to error, and fix the cases where it
produced diagnostics with incorrect wording.

We don't support this as an extension, and we ban it even in C++98 mode. This
breaks too much (for instance, the ABI-specified calling convention for a type
can change if it acquires a copy constructor through the addition of a default
argument).

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

11 years agoFix another false positive due to a CXX temporary object appearing in a C initializer.
Ted Kremenek [Wed, 28 Nov 2012 01:49:01 +0000 (01:49 +0000)]
Fix another false positive due to a CXX temporary object appearing in a C initializer.

The stop-gap here is to just drop such objects when processing the InitListExpr.
We still need a better solution.

Fixes <rdar://problem/12755044>.

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

11 years agoobjective-C arc: Underline the selector when issuing
Fariborz Jahanian [Wed, 28 Nov 2012 01:27:44 +0000 (01:27 +0000)]
objective-C arc: Underline the selector when issuing
arc specific diagnostic on the selector. This is objc-arc
part of // rdar://11303469

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

11 years agodocs: [CMake] Add Xcode to the list of project formats CMake can generate.
NAKAMURA Takumi [Tue, 27 Nov 2012 23:34:28 +0000 (23:34 +0000)]
docs: [CMake] Add Xcode to the list of project formats CMake can generate.

Suggested by Sean McBride, thanks!

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

11 years agoclang/www/get_started.html: s/cmake/CMake/
NAKAMURA Takumi [Tue, 27 Nov 2012 23:34:08 +0000 (23:34 +0000)]
clang/www/get_started.html: s/cmake/CMake/

Suggested by Sean McBride, thanks!

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

11 years agoProvide stop-gap solution to crash reported in PR 14436.
Ted Kremenek [Tue, 27 Nov 2012 23:05:37 +0000 (23:05 +0000)]
Provide stop-gap solution to crash reported in PR 14436.

This was also covered by <rdar://problem/12753384>.  The static analyzer
evaluates a CXXConstructExpr within an initializer expression and
RegionStore doesn't know how to handle the resulting CXXTempObjectRegion
that gets created.  We need a better solution than just dropping the
value, but we need to better understand how to implement the right
semantics here.

Thanks to Jordan for his help diagnosing the behavior here.

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

11 years agoobjective-C arc: load of a __weak object happens via call to
Fariborz Jahanian [Tue, 27 Nov 2012 23:02:53 +0000 (23:02 +0000)]
objective-C arc: load of a __weak object happens via call to
objc_loadWeak. This retains and autorelease the weakly-refereced
object. This hidden autorelease sometimes makes __weak variable alive even
after the weak reference is erased, because the object is still referenced
by an autorelease pool. This patch overcomes this behavior by loading a
weak object via call to objc_loadWeakRetained(), followng it by objc_release
at appropriate place, thereby removing the hidden autorelease. // rdar://10849570

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

11 years ago[libclang] Remove WorkingDir field from CIndexer, it has been rendered useless.
Argyrios Kyrtzidis [Tue, 27 Nov 2012 22:49:42 +0000 (22:49 +0000)]
[libclang] Remove WorkingDir field from CIndexer, it has been rendered useless.
No functionality change.

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

11 years agoMove PrettyStackTraceParserEntry to ParseAST.cpp
Nico Weber [Tue, 27 Nov 2012 21:57:34 +0000 (21:57 +0000)]
Move PrettyStackTraceParserEntry to ParseAST.cpp

r128056 moved PrettyStackTraceParserEntry construction from Parser.h
to ParseAST.cpp, so there's no need to keep this class in a header.

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

11 years agoAllow an ASTConsumer to selectively skip function bodies while parsing. Patch
Richard Smith [Tue, 27 Nov 2012 21:31:01 +0000 (21:31 +0000)]
Allow an ASTConsumer to selectively skip function bodies while parsing. Patch
by Olivier Goffart!

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

11 years agoSimplify checking for whether we should implicitly declare special members and
Richard Smith [Tue, 27 Nov 2012 21:20:31 +0000 (21:20 +0000)]
Simplify checking for whether we should implicitly declare special members and
add some assertions. No functionality change.

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

11 years agoRemove an extra semicolon.
Chad Rosier [Tue, 27 Nov 2012 17:31:26 +0000 (17:31 +0000)]
Remove an extra semicolon.

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

11 years agoFix examples.
Rafael Espindola [Tue, 27 Nov 2012 16:16:02 +0000 (16:16 +0000)]
Fix examples.

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

11 years agoRemove some dead code. CLANG_IS_PRODUCTION is now just a build flag and
Rafael Espindola [Tue, 27 Nov 2012 16:10:37 +0000 (16:10 +0000)]
Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag and
is not used in any #ifdef.

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

11 years agoAdd -fsanitize=integer for reporting suspicious integer behaviors.
Will Dietz [Tue, 27 Nov 2012 15:01:55 +0000 (15:01 +0000)]
Add -fsanitize=integer for reporting suspicious integer behaviors.

Introduces new sanitizer "unsigned-integer-overflow".

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

11 years agoRemove outdated FIXME; should have removed that in r160782
Timur Iskhodzhanov [Tue, 27 Nov 2012 12:55:47 +0000 (12:55 +0000)]
Remove outdated FIXME; should have removed that in r160782

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

11 years agoclang/test/lit.cfg: Disable dev-fd-fs on cygwin for now.
NAKAMURA Takumi [Tue, 27 Nov 2012 05:25:41 +0000 (05:25 +0000)]
clang/test/lit.cfg: Disable dev-fd-fs on cygwin for now.

open("/dev/fd/1-foobar") fails with EEXIST on cygwin.

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

11 years agoTest for r168674.
Eli Friedman [Tue, 27 Nov 2012 02:58:49 +0000 (02:58 +0000)]
Test for r168674.

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

11 years agoFix the definition of the vfork() builtin on Haiku. PR14378.
Eli Friedman [Tue, 27 Nov 2012 02:58:24 +0000 (02:58 +0000)]
Fix the definition of the vfork() builtin on Haiku.  PR14378.

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

11 years agoThis patch addresses an incompatibility relative to the 64-bit PowerPC
Bill Schmidt [Tue, 27 Nov 2012 02:46:43 +0000 (02:46 +0000)]
This patch addresses an incompatibility relative to the 64-bit PowerPC
ELF ABI.

Complex values are to be passed in registers as though the real and
imaginary parts were passed as separate parameters.  Prior to this
patch, complex values were passed as byval aggregates.  It turns out
that specifying getDirect() for all complex types when classifying the
argument type results in the desired behavior.

The new Clang test case verifies that the correct LLVM IR is generated
for caller and callee for each of the underlying types for _Complex.

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

11 years agoscan-build: Respect TMPDIR on all platforms, not just Darwin (PR14438).
Jordan Rose [Tue, 27 Nov 2012 02:37:59 +0000 (02:37 +0000)]
scan-build: Respect TMPDIR on all platforms, not just Darwin (PR14438).

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

11 years ago[analyzer] Fix test to work on non-LP64 systems.
Jordan Rose [Tue, 27 Nov 2012 02:37:49 +0000 (02:37 +0000)]
[analyzer] Fix test to work on non-LP64 systems.

Thanks for the original catch in r168303, Takumi.

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

11 years agoAdd a testcase that r168411 would break.
Rafael Espindola [Tue, 27 Nov 2012 01:56:54 +0000 (01:56 +0000)]
Add a testcase that r168411 would break.

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

11 years agoRevert r168411 for now.
Rafael Espindola [Tue, 27 Nov 2012 01:44:24 +0000 (01:44 +0000)]
Revert r168411 for now.

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

11 years agoDuplicate some common owners between Clang and LLVM.
Richard Smith [Tue, 27 Nov 2012 00:48:12 +0000 (00:48 +0000)]
Duplicate some common owners between Clang and LLVM.

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

11 years agoMove Clang code owners list from llvm/ to cfe/.
Richard Smith [Tue, 27 Nov 2012 00:39:30 +0000 (00:39 +0000)]
Move Clang code owners list from llvm/ to cfe/.

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