]> granicus.if.org Git - clang/log
clang
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

11 years agoFrontend: Create a virtual file for named pipe inputs.
Daniel Dunbar [Tue, 27 Nov 2012 00:04:16 +0000 (00:04 +0000)]
Frontend: Create a virtual file for named pipe inputs.
 - This ensures we see the right buffer size for the file.

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

11 years agoImprove diagnostic on C++11 attribute specifiers that appear at wrong syntactic locat...
Michael Han [Mon, 26 Nov 2012 22:54:45 +0000 (22:54 +0000)]
Improve diagnostic on C++11 attribute specifiers that appear at wrong syntactic locations around class specifiers.

This change list implemented logic that explicitly detects several combinations of locations where C++11 attribute
specifiers might be incorrectly placed within a class specifier. Previously we emit generic diagnostics like
"expected identifier" for such cases; now we emit specific diagnostic against the misplaced attributes, this also
fixed a bug in old code where attributes appear at legitimate locations were incorrectly rejected.

Thanks to Richard Smith for reviewing!

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

11 years agoAdd missing "break". Thanks to Craig for spotting it.
Eli Friedman [Mon, 26 Nov 2012 21:57:28 +0000 (21:57 +0000)]
Add missing "break".  Thanks to Craig for spotting it.

I'm looking at ways to fix the relevant test so it can catch this sort of mistake.

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

11 years agocheck that always_inline attribute works with -fno-inline
Sebastian Pop [Mon, 26 Nov 2012 20:44:46 +0000 (20:44 +0000)]
check that always_inline attribute works with -fno-inline

Clean up the existing test to use FileCheck.

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

11 years ago[analyzer] SATestBuild.py: allow make builds to disable parallelization
Jordan Rose [Mon, 26 Nov 2012 19:59:57 +0000 (19:59 +0000)]
[analyzer] SATestBuild.py: allow make builds to disable parallelization

Before, SATestBuild unilaterally added '-j<n>' to every project built with
'make'. Now, we check and see if there's a -j option already specified, which
allows a project to explicitly be marked '-j1'.

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

11 years ago[analyzer] Fix a crash reported in PR 14400.
Anna Zaks [Mon, 26 Nov 2012 19:11:46 +0000 (19:11 +0000)]
[analyzer] Fix a crash reported in PR 14400.

The AllocaRegion did not have the superRegion (based on LocationContext)
as part of it's hash. As a consequence, the AllocaRegions from
different frames were uniqued to be the same region.

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

11 years agoMSPGCC renamed ISR vectors from vector_<address> to __isr_<number>. This patch makes...
Anton Korobeynikov [Mon, 26 Nov 2012 18:59:10 +0000 (18:59 +0000)]
MSPGCC renamed ISR vectors from vector_<address> to __isr_<number>. This patch makes Clang reflect this scheme.
Patch by Job Noorman!

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

11 years agoFix PR14413 - incorrect mangling of anonymous namespaces with -cxx-abi microsoft
Timur Iskhodzhanov [Mon, 26 Nov 2012 08:55:48 +0000 (08:55 +0000)]
Fix PR14413 - incorrect mangling of anonymous namespaces with -cxx-abi microsoft

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

11 years agoPR14428: When instantiating a 'new' expression, if we had a non-dependent
Richard Smith [Mon, 26 Nov 2012 08:32:48 +0000 (08:32 +0000)]
PR14428: When instantiating a 'new' expression, if we had a non-dependent
initialization, don't rebuild it. Remove a couple of hacks which were trying to
work around this. Fix the special case for one-argument CXXConstructExprs to
not apply if the one argument is a default argument.

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

11 years agoAdd r168519 back, but with a fix to also merge the used flag in variables.
Rafael Espindola [Sun, 25 Nov 2012 14:07:59 +0000 (14:07 +0000)]
Add r168519 back, but with a fix to also merge the used flag in variables.

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

11 years agoAdd a basic testcase for the "variable is not needed" warning and one that
Rafael Espindola [Sun, 25 Nov 2012 14:00:51 +0000 (14:00 +0000)]
Add a basic testcase for the "variable is not needed" warning and one that
regressed in r168519.

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

11 years agoFix test case for linking with sanitizer opts added in r168428.
Alexey Samsonov [Sun, 25 Nov 2012 13:40:21 +0000 (13:40 +0000)]
Fix test case for linking with sanitizer opts added in r168428.

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

11 years agoRevert r168519, "Merge used flags so that we don't have to iterate on isUsed. With...
NAKAMURA Takumi [Sat, 24 Nov 2012 23:17:09 +0000 (23:17 +0000)]
Revert r168519, "Merge used flags so that we don't have to iterate on isUsed. With this change"

It brought bunch of (possibly false) warnings.

llvm/unittests/VMCore/PassManagerTest.cpp:60:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    char ModuleNDNM::ID=0;
                     ^
llvm/unittests/VMCore/PassManagerTest.cpp:86:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    char ModuleNDM2::ID=0;
                     ^
llvm/unittests/VMCore/PassManagerTest.cpp:106:21: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    char ModuleDNM::ID=0;
                    ^
llvm/unittests/VMCore/PassManagerTest.cpp:217:16: warning: variable 'initcount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    int LPass::initcount=0;
               ^
llvm/unittests/VMCore/PassManagerTest.cpp:218:16: warning: variable 'fincount' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    int LPass::fincount=0;
               ^
llvm/unittests/VMCore/PassManagerTest.cpp:259:16: warning: variable 'inited' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    int BPass::inited=0;
               ^
llvm/unittests/VMCore/PassManagerTest.cpp:260:16: warning: variable 'fin' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    int BPass::fin=0;
               ^
llvm/unittests/VMCore/PassManagerTest.cpp:283:24: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    char OnTheFlyTest::ID=0;
                       ^
8 warnings generated.

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

11 years agoMake err_module_expected_semi consistent with all the other expected_semi diags.
Nico Weber [Sat, 24 Nov 2012 03:20:20 +0000 (03:20 +0000)]
Make err_module_expected_semi consistent with all the other expected_semi diags.

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

11 years agoSema: Provide a valid source location when instantiating templates based on a CXXDefa...
Benjamin Kramer [Fri, 23 Nov 2012 17:04:52 +0000 (17:04 +0000)]
Sema: Provide a valid source location when instantiating templates based on a CXXDefaultArgExpr.

Fixes PR13758.

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

11 years agoMerge used flags so that we don't have to iterate on isUsed. With this change
Rafael Espindola [Fri, 23 Nov 2012 16:26:30 +0000 (16:26 +0000)]
Merge used flags so that we don't have to iterate on isUsed. With this change
"clang -cc1 -fsyntax-only" on the preprocessed output of

#define M extern int a;
#define M2 M M
#define M4 M2 M2
#define M8 M4 M4
#define M16 M8 M8
#define M32 M16 M16
#define M64 M32 M32
#define M128 M64 M64
#define M256 M128 M128
#define M512 M256 M256
#define M1024 M512 M512
#define M2048 M1024 M1024
#define M4096 M2048 M2048
#define M8192 M4096 M4096
#define M16384 M8192 M8192
M16384

goes from 2.994s to 1.416s. GCC is at 0.022s, so we still have a long way to go.

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

11 years agoRemove redundant check.
Rafael Espindola [Fri, 23 Nov 2012 14:29:54 +0000 (14:29 +0000)]
Remove redundant check.

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

11 years agoCheck that we don't warn on this testcase. This is basically a test that
Rafael Espindola [Fri, 23 Nov 2012 13:54:40 +0000 (13:54 +0000)]
Check that we don't warn on this testcase. This is basically a test that
Decl::isUsed checks the attribute. If the function had a body just the check
is DeclMustBeEmitted would be sufficient.

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

11 years agoPR14306: Move -fbounds-checking to -fsanitize=bounds.
Joey Gouly [Fri, 23 Nov 2012 10:39:49 +0000 (10:39 +0000)]
PR14306: Move -fbounds-checking to -fsanitize=bounds.

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

11 years agoReapply a subset of r167567 to clean up Darwin-specific code for invoking gcc.
Bob Wilson [Fri, 23 Nov 2012 06:14:39 +0000 (06:14 +0000)]
Reapply a subset of r167567 to clean up Darwin-specific code for invoking gcc.

Unlike my previous attempt at this, this patch leaves intact the check for
whether clang can handle the input file type, and for non-Darwin toolchains it
will invoke gcc for things it cannot handle. For Darwin toolchains, the
behavior reported in pr14338 still occurs with this patch, but that is a
definite improvement from what happens currently, where it just crashes with
an assertion failure.

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

11 years agoMake helpers static/anonymous.
Benjamin Kramer [Thu, 22 Nov 2012 15:02:44 +0000 (15:02 +0000)]
Make helpers static/anonymous.

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

11 years agoFix regression in r168477. Use canonical decl when looking for base class
Richard Smith [Thu, 22 Nov 2012 00:40:54 +0000 (00:40 +0000)]
Fix regression in r168477. Use canonical decl when looking for base class
specified as a qualified name.

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

11 years agoFix CXXRecordDecl::forallBases to not look through bases which are dependent
Richard Smith [Thu, 22 Nov 2012 00:24:47 +0000 (00:24 +0000)]
Fix CXXRecordDecl::forallBases to not look through bases which are dependent
and defined within the current instantiation, but which are not part of the
current instantiation. Previously, it would look at bases which could be
specialized separately from the current template.

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

11 years agoTest that we correctly deal with multiple copy constructors when detecting
Richard Smith [Thu, 22 Nov 2012 00:21:13 +0000 (00:21 +0000)]
Test that we correctly deal with multiple copy constructors when detecting
non-trivial special members for varargs calls.

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

11 years agoFix the '-fuse-init-array' option to actually be an option.
Chandler Carruth [Wed, 21 Nov 2012 23:40:23 +0000 (23:40 +0000)]
Fix the '-fuse-init-array' option to actually be an option.

Previously, this flag to CC1 was never exposed at the clang driver
layer, and if you happened to enable it (by being on Android or GCC 4.7
platform), you couldn't *disable* it, because there was no 'no' variant.
The whole thing was confusingly implemented.

Now, the target-specific flag processing gets the driver arg list, and
we use standard hasFlag with a default based on the GCC version and/or
Android platform. The user can still pass the 'no-' variant to forcibly
disable the flag, or pass the positive variant to clang itself to enable
the flag.

The test has also been substantially cleaned up and extended to cover
these use cases.

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

11 years agoSemaCXX: an enumeral type can be of character or boolean type in a C++11 enum class...
Benjamin Kramer [Wed, 21 Nov 2012 17:42:47 +0000 (17:42 +0000)]
SemaCXX: an enumeral type can be of character or boolean type in a C++11 enum class. Make sure we create a literal of the right type.

Fixes PR14386.

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

11 years agoTest commit: Remove blank line.
Joey Gouly [Wed, 21 Nov 2012 16:54:35 +0000 (16:54 +0000)]
Test commit: Remove blank line.

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

11 years agoTry to fix test from r168428 on mingw bot
Alexey Samsonov [Wed, 21 Nov 2012 15:52:36 +0000 (15:52 +0000)]
Try to fix test from r168428 on mingw bot

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

11 years agoclang/test/Driver/x86_64-nacl-defines.cpp: Specify filename generated.
NAKAMURA Takumi [Wed, 21 Nov 2012 14:45:57 +0000 (14:45 +0000)]
clang/test/Driver/x86_64-nacl-defines.cpp: Specify filename generated.

FIXME: It could be /dev/null.

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

11 years ago[Sanitizer] force linking with static sanitizer runtimes on Darwin even if they are...
Alexey Samsonov [Wed, 21 Nov 2012 14:17:42 +0000 (14:17 +0000)]
[Sanitizer] force linking with static sanitizer runtimes on Darwin even if they are not found in resource directory. Add test checking sanitizer linker flags on Darwin.

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

11 years agoUse color for -ast-dump-filter only when it is supported
Dmitri Gribenko [Wed, 21 Nov 2012 10:54:55 +0000 (10:54 +0000)]
Use color for -ast-dump-filter only when it is supported

Patch by Philip Craig.

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

11 years agoRemove redundant code.
Rafael Espindola [Wed, 21 Nov 2012 02:53:22 +0000 (02:53 +0000)]
Remove redundant code.

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

11 years agoRemove redundant code.
Rafael Espindola [Wed, 21 Nov 2012 02:47:19 +0000 (02:47 +0000)]
Remove redundant code.

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

11 years agoDon't walk a linked list twice in the same function. On my machine this takes
Rafael Espindola [Tue, 20 Nov 2012 23:23:57 +0000 (23:23 +0000)]
Don't walk a linked list twice in the same function. On my machine this takes
"clang -cc1" on a file with 10k repetitions of
extern int no_such_variable;
from 1.434s to 1.133s.

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

11 years agoUpdate method calls to the new interface re r168354.
Bill Wendling [Tue, 20 Nov 2012 05:09:43 +0000 (05:09 +0000)]
Update method calls to the new interface re r168354.

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

11 years agoFix some trailing whitespace (on a blank line) to cycle/test bots.
David Blaikie [Mon, 19 Nov 2012 23:12:51 +0000 (23:12 +0000)]
Fix some trailing whitespace (on a blank line) to cycle/test bots.

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

11 years agoPR14381: Never skip constexpr function bodies when code-completing. We may need
Richard Smith [Mon, 19 Nov 2012 21:13:18 +0000 (21:13 +0000)]
PR14381: Never skip constexpr function bodies when code-completing. We may need
them in order to parse the rest of the file.

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

11 years agoWhen adding a NamedDecl to a correction, add the underlying Decl (via
Kaelyn Uhrain [Mon, 19 Nov 2012 18:49:53 +0000 (18:49 +0000)]
When adding a NamedDecl to a correction, add the underlying Decl (via
getUnderlyingDecl()) so that derivatives of
CorrectionCandidateCallback::ValidateCandidate(...) don't have to worry
about being thrown by UsingDecls and such.

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