]> granicus.if.org Git - clang/log
clang
12 years ago[Basic] Stop using a SmallVector<> for Diagnostic. This drops Clang binary size
Daniel Dunbar [Tue, 13 Mar 2012 18:21:17 +0000 (18:21 +0000)]
[Basic] Stop using a SmallVector<> for Diagnostic. This drops Clang binary size
by ~%.3/~100k in my build -- simply by eliminating the horrible code bloat coming
from the .clear() of the SmallVector<FixItHint>, which does a std::~string, etc.
 - My understanding is we don't ever emit arbitrary numbers of fixits, so I just
   moved us to using a statically sized array like we do for arguments and
   ranges.

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

12 years agoRemove unused-but-set variable.
Benjamin Kramer [Tue, 13 Mar 2012 17:05:43 +0000 (17:05 +0000)]
Remove unused-but-set variable.

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

12 years agoLong double is just double on FreeBSD/{PPC,PPC64}.
Roman Divacky [Tue, 13 Mar 2012 16:53:54 +0000 (16:53 +0000)]
Long double is just double on FreeBSD/{PPC,PPC64}.

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

12 years agoTweak linkage order for solaris.
David Chisnall [Tue, 13 Mar 2012 14:14:54 +0000 (14:14 +0000)]
Tweak linkage order for solaris.

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

12 years agoEnsure that default arguments are handled correctly in sub scopes. For example:
James Molloy [Tue, 13 Mar 2012 08:55:35 +0000 (08:55 +0000)]
Ensure that default arguments are handled correctly in sub scopes. For example:

void f () {
  int g (int a, int b=4);
  {
    int g(int a, int b=5);
  }
}

should compile.

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

12 years agoImplement [temp.param]p5: the top-level cv-qualifiers on a non-type template
Richard Smith [Tue, 13 Mar 2012 07:21:50 +0000 (07:21 +0000)]
Implement [temp.param]p5: the top-level cv-qualifiers on a non-type template
parameter's declaration are ignored when determining the parameter's type.

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

12 years agoPR11850 + duplicates: don't assume that a function parameter pack expansion is
Richard Smith [Tue, 13 Mar 2012 06:56:52 +0000 (06:56 +0000)]
PR11850 + duplicates: don't assume that a function parameter pack expansion is
at the end of the parameter list.

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

12 years agoPR11925: A function can't have a variably-modified return type. Not even in C++.
Richard Smith [Tue, 13 Mar 2012 05:56:40 +0000 (05:56 +0000)]
PR11925: A function can't have a variably-modified return type. Not even in C++.

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

12 years agoIt never makes sense to do a lookup into a LinkageSpecDecl, so assert that we
Nick Lewycky [Tue, 13 Mar 2012 04:12:34 +0000 (04:12 +0000)]
It never makes sense to do a lookup into a LinkageSpecDecl, so assert that we
don't, and clean up the places that do it.

The change to ASTWriter is surprising, but the deleted code is a no-op as of
r152608.

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

12 years agoFix PR10447: lazily building name lookup tables for DeclContexts was broken.
Richard Smith [Tue, 13 Mar 2012 03:12:56 +0000 (03:12 +0000)]
Fix PR10447: lazily building name lookup tables for DeclContexts was broken.
The deferred lookup table building step couldn't accurately tell which Decls
should be included in the lookup table, and consequently built different tables
in some cases.

Fix this by removing lazy building of DeclContext name lookup tables. In
practice, the laziness was frequently not worthwhile in C++, because we
performed lookup into most DeclContexts. In C, it had a bit more value,
since there is no qualified lookup.

In the place of lazy lookup table building, we simply don't build lookup tables
for function DeclContexts at all. Such name lookup tables are not useful, since
they don't capture the scoping information required to correctly perform name
lookup in a function scope.

The resulting performance delta is within the noise on my testing, but appears
to be a very slight win for C++ and a very slight loss for C. The C performance
can probably be recovered (if it is a measurable problem) by avoiding building
the lookup table for the translation unit.

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

12 years ago[libclang] When there's a file error when saving the PCH, make sure to
Argyrios Kyrtzidis [Tue, 13 Mar 2012 02:17:06 +0000 (02:17 +0000)]
[libclang] When there's a file error when saving the PCH, make sure to
clear the error from raw_fd_ostream, otherwise we will crash.

rdar://10976410

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

12 years agoMake the error about assigning to lambda-captured variables
John McCall [Tue, 13 Mar 2012 01:10:51 +0000 (01:10 +0000)]
Make the error about assigning to lambda-captured variables
clearer, and mention the existence of mutable lambdas.

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

12 years ago[Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators...
Argyrios Kyrtzidis [Tue, 13 Mar 2012 01:09:41 +0000 (01:09 +0000)]
[Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators instead of
ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use
even if the caller did not check that the interface is a definition.

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

12 years agoFix crash at @implementation with a forward reference as base class.
Argyrios Kyrtzidis [Tue, 13 Mar 2012 01:09:36 +0000 (01:09 +0000)]
Fix crash at @implementation with a forward reference as base class.

rdar://11020003

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

12 years agoAlternate fix to PR12248: put Sema in charge of special-casing
John McCall [Tue, 13 Mar 2012 00:37:01 +0000 (00:37 +0000)]
Alternate fix to PR12248:  put Sema in charge of special-casing
the diagnostic for assigning to a copied block capture.  This has
the pleasant side-effect of letting us special-case the diagnostic
for assigning to a copied lambda capture as well, without introducing
a new non-modifiable enumerator for it.

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

12 years ago[msvc] Honor %INCLUDE%. It should know essential search paths with vcvarsall.bat.
NAKAMURA Takumi [Tue, 13 Mar 2012 00:02:21 +0000 (00:02 +0000)]
[msvc] Honor %INCLUDE%. It should know essential search paths with vcvarsall.bat.

FYI,

On VS10, %INCLUDE% contains;
(VS10)\VC\INCLUDE
(VS10)\VC\ATLMFC\INCLUDE
(SDK70A)\include

On VS11,
(VS11)\VC\INCLUDE
(VS11)\VC\ATLMFC\INCLUDE
(SDK80)\include\shared
(SDK80)\include\um
(SDK80)\include\winrt

FIXME: It may be enabled also on mingw.

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

12 years agomodern objective-c translator. @try/@catch translation. wip.
Fariborz Jahanian [Mon, 12 Mar 2012 23:58:28 +0000 (23:58 +0000)]
modern objective-c translator. @try/@catch translation. wip.

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

12 years agoAdd new analyzer diagnostic mode where plists can have bugs that span multiple files.
Ted Kremenek [Mon, 12 Mar 2012 23:14:53 +0000 (23:14 +0000)]
Add new analyzer diagnostic mode where plists can have bugs that span multiple files.

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

12 years ago[analyzer] Include inlining call stack depth in plist output.
Ted Kremenek [Mon, 12 Mar 2012 22:10:57 +0000 (22:10 +0000)]
[analyzer] Include inlining call stack depth in plist output.

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

12 years agoAddress some of the concerns by Chandler.
Bill Wendling [Mon, 12 Mar 2012 22:10:06 +0000 (22:10 +0000)]
Address some of the concerns by Chandler.

* s/AddDirectoryList/addDirectoryList/
* Move the call to ::getenv into the function.
* FileCheck-ize the testcase.

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

12 years agoUpdate FIXME.
Bill Wendling [Mon, 12 Mar 2012 21:24:57 +0000 (21:24 +0000)]
Update FIXME.

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

12 years agoHave clang pay attention to the LIBRARY_PATH environment variable.
Bill Wendling [Mon, 12 Mar 2012 21:22:35 +0000 (21:22 +0000)]
Have clang pay attention to the LIBRARY_PATH environment variable.

The LIBRARY_PATH environment variable should be honored by clang. Have the
driver pass the directories to the linker.
<rdar://problem/9743567> and PR10296.

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

12 years agoC++11 [temp.deduct.call]p6 tweak: when given a set of overlaoded
Douglas Gregor [Mon, 12 Mar 2012 21:09:16 +0000 (21:09 +0000)]
C++11 [temp.deduct.call]p6 tweak: when given a set of overlaoded
functions that includes an explicit template argument list, perform
an inner deduction against each of the function templates in that list
and, if successful, use the result of that deduction for the outer
template argument deduction. Fixes PR11713.

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

12 years agoMake sure we treat variables captured by reference in lambda as modifiable lvalues...
Eli Friedman [Mon, 12 Mar 2012 20:57:19 +0000 (20:57 +0000)]
Make sure we treat variables captured by reference in lambda as modifiable lvalues.  Regression from r152491.  Fixes PR12248.

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

12 years ago[Sema] -Add an invalid objc category to the DeclContext so that it can be
Argyrios Kyrtzidis [Mon, 12 Mar 2012 18:34:26 +0000 (18:34 +0000)]
[Sema] -Add an invalid objc category to the DeclContext so that it can be
serialized
-Don't add methods of invalid objc containers to the global method pool.
 This protects us from trying to serialize a method whose container was not
 serialized.

Part of rdar://11007039.

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

12 years agoObjCBoolLiterals (__objc_yes/__objc_no) behave like C++ booleans (true/false). They...
Jordy Rose [Mon, 12 Mar 2012 17:53:02 +0000 (17:53 +0000)]
ObjCBoolLiterals (__objc_yes/__objc_no) behave like C++ booleans (true/false). They are NOT objects.

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

12 years agoobjective-c modern translator: ivar offset symbols
Fariborz Jahanian [Mon, 12 Mar 2012 16:46:58 +0000 (16:46 +0000)]
objective-c modern translator: ivar offset symbols
will reside in .objc_ivar$B sections. // rdar://11023490

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

12 years agoFix a crash-on-invalid found by -Wlogical-op-parentheses.
David Blaikie [Mon, 12 Mar 2012 15:39:49 +0000 (15:39 +0000)]
Fix a crash-on-invalid found by -Wlogical-op-parentheses.

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

12 years agoUse ZeroLengthBitfieldAlignment for AAPCS, as well as APCS-GNU.
James Molloy [Mon, 12 Mar 2012 09:14:10 +0000 (09:14 +0000)]
Use ZeroLengthBitfieldAlignment for AAPCS, as well as APCS-GNU.

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

12 years agoFix parsing of trailing-return-type. Types are syntactically prohibited from
Richard Smith [Mon, 12 Mar 2012 08:56:40 +0000 (08:56 +0000)]
Fix parsing of trailing-return-type. Types are syntactically prohibited from
being defined here: [] () -> struct S {} does not define struct S.

In passing, implement DR1318 (syntactic disambiguation of 'final').

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

12 years agoFix parsing of type-specifier-seq's. Types are syntactically allowed to be
Richard Smith [Mon, 12 Mar 2012 07:56:15 +0000 (07:56 +0000)]
Fix parsing of type-specifier-seq's. Types are syntactically allowed to be
defined here, but not semantically, so

  new struct S {};

is always ill-formed, even if there is a struct S in scope.

We also had a couple of bugs in ParseOptionalTypeSpecifier caused by it being
under-loved (due to it only being used in a few places) so merge it into
ParseDeclarationSpecifiers with a new DeclSpecContext. To avoid regressing, this
required improving ParseDeclarationSpecifiers' diagnostics in some cases. This
also required teaching ParseSpecifierQualifierList about constexpr... which
incidentally fixes an issue where we'd allow the constexpr specifier in other
bad places.

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

12 years agoFix typo in comment, 'langauge' -> 'language'.
Nick Lewycky [Sun, 11 Mar 2012 23:14:21 +0000 (23:14 +0000)]
Fix typo in comment, 'langauge' -> 'language'.

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

12 years agoobjective-c modern abi rewriter: provide section pragmas for
Fariborz Jahanian [Sun, 11 Mar 2012 19:41:56 +0000 (19:41 +0000)]
objective-c modern abi rewriter: provide section pragmas for
statically writter metadata.
// rdar://11023490

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

12 years agoDocument the weak-linking behavior of the availability attribute
Douglas Gregor [Sun, 11 Mar 2012 17:21:03 +0000 (17:21 +0000)]
Document the weak-linking behavior of the availability attribute

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

12 years agoUpdate library dependencies to add clangEdit on c-index-test and c-arcmt-test.
NAKAMURA Takumi [Sun, 11 Mar 2012 08:04:40 +0000 (08:04 +0000)]
Update library dependencies to add clangEdit on c-index-test and c-arcmt-test.

To link with -static -lclang, linker tries to seek not libclang.so, clang.dll nor libclang.dll.a, but libclang.a. USEDLIBS should have correct dependencies for -static.
(In contrast, USEDLIBS=libclang.so might be enough w/o -static)

FYI, cygwin build (in buildbot) is using -static, due to avoiding weirdness of extremely slower startup lag of clang.exe.

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

12 years agoUnify naming of LangOptions variable/get function across the Clang stack (Lex to...
David Blaikie [Sun, 11 Mar 2012 07:00:24 +0000 (07:00 +0000)]
Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

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

12 years agollvm::SwitchInst
Stepan Dyatkovskiy [Sun, 11 Mar 2012 06:09:37 +0000 (06:09 +0000)]
llvm::SwitchInst
Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default.
Added some notes relative to case iterators.

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

12 years agoDocument the availability attribute
Douglas Gregor [Sun, 11 Mar 2012 04:53:21 +0000 (04:53 +0000)]
Document the availability attribute

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

12 years agoWhen template argument deduction is ignoring qualifiers, perform deep
Douglas Gregor [Sun, 11 Mar 2012 03:29:50 +0000 (03:29 +0000)]
When template argument deduction is ignoring qualifiers, perform deep
structural comparison of non-dependent types. Otherwise, we end up
rejecting cases where the non-dependent types don't match due to
qualifiers in, e.g., a pointee type. Fixes PR12132.

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

12 years agocxx_status: No compiler changes are required for 'minimal support for garbage
Richard Smith [Sun, 11 Mar 2012 03:06:00 +0000 (03:06 +0000)]
cxx_status: No compiler changes are required for 'minimal support for garbage
collection'. Keep it in the table to match gcc's table, but mark it N/A.

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

12 years agoAdd a missing 'template' keyword.
Douglas Gregor [Sun, 11 Mar 2012 02:23:56 +0000 (02:23 +0000)]
Add a missing 'template' keyword.

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

12 years ago[analyzer] Replace a static helper with existing logic. No functionality change.
Jordy Rose [Sun, 11 Mar 2012 00:08:24 +0000 (00:08 +0000)]
[analyzer] Replace a static helper with existing logic. No functionality change.

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

12 years agoWhen determining whether an identifier followed by a '<' in a member
Douglas Gregor [Sat, 10 Mar 2012 23:52:41 +0000 (23:52 +0000)]
When determining whether an identifier followed by a '<' in a member
access expression is the start of a template-id, ignore function
templates found in the context of the entire postfix-expression. Fixes
PR11856.

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

12 years agoFix crash & accepts-invalid for array of arrays of user defined type.
David Blaikie [Sat, 10 Mar 2012 23:40:02 +0000 (23:40 +0000)]
Fix crash & accepts-invalid for array of arrays of user defined type.

Test case/other help by Richard Smith.
Code review by John McCall.

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

12 years agoUpdated the test so that it checks for ms-compatibility in addition to ms-extensions.
Aaron Ballman [Sat, 10 Mar 2012 22:52:10 +0000 (22:52 +0000)]
Updated the test so that it checks for ms-compatibility in addition to ms-extensions.

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

12 years agoAdding namespace qualifiers to the visualizers and improving their behavior.
Aaron Ballman [Sat, 10 Mar 2012 22:28:45 +0000 (22:28 +0000)]
Adding namespace qualifiers to the visualizers and improving their behavior.

Patch thanks to Nikola Smiljanic

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

12 years ago[clang.py] Implement Cursor.objc_type_encoding
Gregory Szorc [Sat, 10 Mar 2012 22:23:27 +0000 (22:23 +0000)]
[clang.py] Implement Cursor.objc_type_encoding

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

12 years agoNo longer defining GNUC mode when compiling for Microsoft compatibility. This allows...
Aaron Ballman [Sat, 10 Mar 2012 22:21:14 +0000 (22:21 +0000)]
No longer defining GNUC mode when compiling for Microsoft compatibility.  This allows people's cross-platform compiler-specific macros to work properly.

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

12 years agoClarify even further that the lambda-to-block-pointer conversion is only available...
Douglas Gregor [Sat, 10 Mar 2012 22:20:11 +0000 (22:20 +0000)]
Clarify even further that the lambda-to-block-pointer conversion is only available in Objective-C++

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

12 years ago[clang.py] Refactor get_tu and get_cursor test helper functions into util.py
Gregory Szorc [Sat, 10 Mar 2012 22:19:05 +0000 (22:19 +0000)]
[clang.py] Refactor get_tu and get_cursor test helper functions into util.py

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

12 years agoPR12225: The requirement that literal operators be namespace-scope functions
Richard Smith [Sat, 10 Mar 2012 22:18:57 +0000 (22:18 +0000)]
PR12225: The requirement that literal operators be namespace-scope functions
does not imply that such functions can't be declared at block scope.

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

12 years agoUse VersionTuple to manage macosx versions in the driver. No functionality change.
Benjamin Kramer [Sat, 10 Mar 2012 20:55:36 +0000 (20:55 +0000)]
Use VersionTuple to manage macosx versions in the driver. No functionality change.

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

12 years agoSimplify code. No functionality change.
Benjamin Kramer [Sat, 10 Mar 2012 20:38:56 +0000 (20:38 +0000)]
Simplify code. No functionality change.

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

12 years agoobjective-c modern rewriter: add __declspec(dllexport) to forward
Fariborz Jahanian [Sat, 10 Mar 2012 18:25:06 +0000 (18:25 +0000)]
objective-c modern rewriter: add __declspec(dllexport) to forward
declaration of class metadata when they are defined later.

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

12 years agoobjc modern rewriter: Define __OBJC2__ in written file.
Fariborz Jahanian [Sat, 10 Mar 2012 17:45:38 +0000 (17:45 +0000)]
objc modern rewriter: Define __OBJC2__ in written file.
// rdar://11024543

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

12 years agoReplace a map of boolean values with a set.
Benjamin Kramer [Sat, 10 Mar 2012 15:08:09 +0000 (15:08 +0000)]
Replace a map of boolean values with a set.

No functionality change.

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

12 years agoThe type of a definition should not increase its visibility. Fixes PR12221.
Rafael Espindola [Sat, 10 Mar 2012 13:01:40 +0000 (13:01 +0000)]
The type of a definition should not increase its visibility. Fixes PR12221.

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

12 years agoRemove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
John McCall [Sat, 10 Mar 2012 09:33:50 +0000 (09:33 +0000)]
Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context.  I'm amenable to suggestions about the exact meaning
of this bit.

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

12 years agoSlightly tweak this condition. "isTransparentContext()" was checking whether an
Nick Lewycky [Sat, 10 Mar 2012 07:47:07 +0000 (07:47 +0000)]
Slightly tweak this condition. "isTransparentContext()" was checking whether an
enum is scoped or not, which is not relevant here. Instead, phrase the loop in
the same terms that the standard uses, instead of this awkward set of
conditions that is *nearly* equal.

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

12 years agoCould not find this in C99. Perhaps this rule comes from a DR, but in any case
Nick Lewycky [Sat, 10 Mar 2012 07:45:33 +0000 (07:45 +0000)]
Could not find this in C99. Perhaps this rule comes from a DR, but in any case
please annotate it with a note explaining why this wrong-seeming behaviour is
correct.

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

12 years agoOnly make a call to a copy constructor elidable if in fact we are
Douglas Gregor [Sat, 10 Mar 2012 06:53:13 +0000 (06:53 +0000)]
Only make a call to a copy constructor elidable if in fact we are
doing a copy. Fixes PR12139.

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

12 years ago[Sema] A tag decl that is marked as invalid and is used in a decl-spec,
Argyrios Kyrtzidis [Sat, 10 Mar 2012 03:20:58 +0000 (03:20 +0000)]
[Sema] A tag decl that is marked as invalid and is used in a decl-spec,
should not impede creating a proper TypeLoc info for the decl-spec.

This improves our semantic error recovery.

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

12 years agoRemove the part of test/Sema/pragma-pack-2.c that has irregular "#pragma pack"s.
Argyrios Kyrtzidis [Sat, 10 Mar 2012 03:20:52 +0000 (03:20 +0000)]
Remove the part of test/Sema/pragma-pack-2.c that has irregular "#pragma pack"s.

Before r151307 this part worked without compiler errors but now it only verifies
that our handling of irregular pragmas is broken compared to gcc, it has no
practical usefulness; it creates invalid structs that cannot be used for 'offsetof' testing.

If we later decide to handle irregular pragmas without compiler errors we can
put back this part.

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

12 years agoUnify the BlockDeclRefExpr and DeclRefExpr paths so that
John McCall [Sat, 10 Mar 2012 03:05:10 +0000 (03:05 +0000)]
Unify the BlockDeclRefExpr and DeclRefExpr paths so that
we correctly emit loads of BlockDeclRefExprs even when they
don't qualify as ODR-uses.  I think I'm adequately convinced
that BlockDeclRefExpr can die.

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

12 years agoFix the dumping of BlockExprs.
John McCall [Sat, 10 Mar 2012 03:04:55 +0000 (03:04 +0000)]
Fix the dumping of BlockExprs.

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

12 years agotest/Rewriter/rewrite-modern-ivars-2.mm: Add "-triple i386-apple-darwin9".
NAKAMURA Takumi [Sat, 10 Mar 2012 03:02:29 +0000 (03:02 +0000)]
test/Rewriter/rewrite-modern-ivars-2.mm: Add "-triple i386-apple-darwin9".

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

12 years agoFix a use of the C99 PRI format macros not to conflict with C++11 UDLs.
Benjamin Kramer [Sat, 10 Mar 2012 02:06:27 +0000 (02:06 +0000)]
Fix a use of the C99 PRI format macros not to conflict with C++11 UDLs.

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

12 years agoMake sure the accessors for overridden methods don't return inherited constructors...
Eli Friedman [Sat, 10 Mar 2012 01:39:01 +0000 (01:39 +0000)]
Make sure the accessors for overridden methods don't return inherited constructors.  Fixes PR12219.

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

12 years agoobjc modern rewriter: don't export @package ivar symbols.
Fariborz Jahanian [Sat, 10 Mar 2012 01:34:42 +0000 (01:34 +0000)]
objc modern rewriter: don't export @package ivar symbols.

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

12 years ago[analyzer] fix regression in analyzer of NOT actually aborting on Stmts it doesn...
Ted Kremenek [Sat, 10 Mar 2012 01:34:17 +0000 (01:34 +0000)]
[analyzer] fix regression in analyzer of NOT actually aborting on Stmts it doesn't understand.  We registered
as aborted, but didn't treat such cases as sinks in the ExplodedGraph.

Along the way, add basic support for CXXCatchStmt, expanding the set of code we actually analyze (hopefully correctly).

Fixes: <rdar://problem/10892489>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152468 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.
Daniel Dunbar [Sat, 10 Mar 2012 01:03:58 +0000 (01:03 +0000)]
IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.

 - We do this when it is easy to determine that the backend will pass them on
   the stack properly by itself.

Currently LLVM codegen is really bad in some cases with byval, for example, on
the test case here (which is derived from Sema code, which likes to pass
SourceLocations around)::

  struct s47 { unsigned a; };
  void f47(int,int,int,int,int,int,struct s47);
  void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); }

we used to emit code like this::

  ...
  movl %esi, -8(%rbp)
  movl -8(%rbp), %ecx
  movl %ecx, (%rsp)
  ...

to handle moving the struct onto the stack, which is just appalling.

Now we generate::

  movl %esi, (%rsp)

which seems better, no?

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

12 years agoMinor change to my last rewrite patch.
Fariborz Jahanian [Sat, 10 Mar 2012 00:53:02 +0000 (00:53 +0000)]
Minor change to my last rewrite patch.

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

12 years agoobjc modern rewriter: Mark class and ivar definitions with __declspec(dllexport)
Fariborz Jahanian [Sat, 10 Mar 2012 00:39:34 +0000 (00:39 +0000)]
objc modern rewriter: Mark class and ivar definitions with __declspec(dllexport)
// rdar://11023563

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

12 years agoQualifiers on a canonical array type go on the outermost type, not the
Douglas Gregor [Sat, 10 Mar 2012 00:29:33 +0000 (00:29 +0000)]
Qualifiers on a canonical array type go on the outermost type, not the
innermost type. Fixes PR12142.

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

12 years agoAssign APValues by swapping from a temporary. Removes a bunch of unnecessary
Richard Smith [Sat, 10 Mar 2012 00:28:11 +0000 (00:28 +0000)]
Assign APValues by swapping from a temporary. Removes a bunch of unnecessary
copy-construction, which Daniel Dunbar reports as giving a 0.75% speedup on
403.gcc/combine.c. The performance differences on my constexpr torture tests
are below the noise floor.

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

12 years agoobjective-c modern rewriter. More fixes related to rewriting
Fariborz Jahanian [Fri, 9 Mar 2012 23:46:23 +0000 (23:46 +0000)]
objective-c modern rewriter. More fixes related to rewriting
ivars in the modern rewriter.

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

12 years agoTeach RetainCountChecker about mixing method families with explicit annotations....
Ted Kremenek [Fri, 9 Mar 2012 23:34:08 +0000 (23:34 +0000)]
Teach RetainCountChecker about mixing method families with explicit annotations.  Fixes <rdar://problem/10824732>.

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

12 years agoDocument the conversion from a lambda closure type to a block pointer
Douglas Gregor [Fri, 9 Mar 2012 23:24:48 +0000 (23:24 +0000)]
Document the conversion from a lambda closure type to a block pointer
in Objective-C++.

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

12 years agoImprove diagnostics for UCNs referring to control characters and members of the
Richard Smith [Fri, 9 Mar 2012 22:27:51 +0000 (22:27 +0000)]
Improve diagnostics for UCNs referring to control characters and members of the
basic source character set in C++98. Add -Wc++98-compat diagnostics for same in
literals in C++11. Extend such support to cover string literals as well as
character literals, and mark N2170 as done.

This seems too minor to warrant a release note to me. Let me know if you disagree.

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

12 years ago[Sema] Fix a diag change to include a range that appeared intended, but never
Daniel Dunbar [Fri, 9 Mar 2012 21:38:22 +0000 (21:38 +0000)]
[Sema] Fix a diag change to include a range that appeared intended, but never
actually happened.

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

12 years agoUpdate comment after r152140. Clarify a bit too.
Nico Weber [Fri, 9 Mar 2012 21:19:44 +0000 (21:19 +0000)]
Update comment after r152140. Clarify a bit too.

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

12 years ago[analyzer] Add support for NoRedundancy inlining mode.
Anna Zaks [Fri, 9 Mar 2012 21:14:01 +0000 (21:14 +0000)]
[analyzer] Add support for NoRedundancy inlining mode.

We do not reanalyze a function, which has already been analyzed as an
inlined callee. As per PRELIMINARY testing, this gives over
50% run time reduction on some benchmarks without decreasing of the
number of bugs found.

Turning the mode on by default.

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

12 years agoCallGraph: Add getNode() method, constify.
Anna Zaks [Fri, 9 Mar 2012 21:13:53 +0000 (21:13 +0000)]
CallGraph: Add getNode() method, constify.

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

12 years agoAllow serializing an invalid ParmVarDecl and don't set access to public for
Argyrios Kyrtzidis [Fri, 9 Mar 2012 21:09:04 +0000 (21:09 +0000)]
Allow serializing an invalid ParmVarDecl and don't set access to public for
invalid ParmVarDecls.

Part of rdar://11007039.

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

12 years agoRevert r152430 "[AST] Mark ASTContext::getTypeInfo and some friends as
Daniel Dunbar [Fri, 9 Mar 2012 20:41:19 +0000 (20:41 +0000)]
Revert r152430 "[AST] Mark ASTContext::getTypeInfo and some friends as
LLVM_READONLY.", getTypeInfo() is totally not READONLY, which I should have
probably noticed given that I made it so mere hours ago. Oops.

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

12 years agoAdd a helper to get a CXXConstructExpr from a CXXNewExpr.
Matt Beaumont-Gay [Fri, 9 Mar 2012 20:36:34 +0000 (20:36 +0000)]
Add a helper to get a CXXConstructExpr from a CXXNewExpr.

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

12 years agoImprove our semantic error recovery.
Argyrios Kyrtzidis [Fri, 9 Mar 2012 20:10:30 +0000 (20:10 +0000)]
Improve our semantic error recovery.

When an error made a record member invalid, the record would stay as "isBeingDefined" and
not "completeDefinition". Even easily recoverable errors ended up propagating records in
such "beingDefined" state, for example:

struct A {
  ~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
};
struct B : A {}; // A & B would stay as "not complete definition" and "being defined".

This weird state was impending lookups in the records and hitting assertion in the ASTWriter.

Part of rdar://11007039

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

12 years ago[AST] Mark Expr::Ignore*() functions as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 20:02:56 +0000 (20:02 +0000)]
[AST] Mark Expr::Ignore*() functions as LLVM_READONLY.

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

12 years ago[AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 20:02:54 +0000 (20:02 +0000)]
[AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY.

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

12 years ago[AST] Mark Expr::getExprLoc() as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 20:02:51 +0000 (20:02 +0000)]
[AST] Mark Expr::getExprLoc() as LLVM_READONLY.

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

12 years ago[Sema] Remove dead getSourceRange() call, caught by Clang after marking
Daniel Dunbar [Fri, 9 Mar 2012 20:02:47 +0000 (20:02 +0000)]
[Sema] Remove dead getSourceRange() call, caught by Clang after marking
LLVM_READONLY.

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

12 years ago[AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
Daniel Dunbar [Fri, 9 Mar 2012 19:35:29 +0000 (19:35 +0000)]
[AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
 - The theory here is that we have these functions sprinkled in all over the
   place. This should allow the optimizer to at least realize it can still do
   load CSE across these calls.
 - I blindly marked all instances as such, even though the optimizer can infer
   this attribute in some instances (some of the inline ones) as that was easier
   and also, when given the choice between thinking and not thinking, I prefer
   the latter.

You might think this is mere frivolity, but actually this is good for a .7 -
1.1% speedup on 403.gcc/combine.c, JSC/Interpreter.cpp,
OGF/NSBezierPath-OAExtensions.m.

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

12 years agoAdd user-defined literals to release notes.
Richard Smith [Fri, 9 Mar 2012 19:09:47 +0000 (19:09 +0000)]
Add user-defined literals to release notes.

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

12 years agolldb support: under debugger support flag, when sending message
Fariborz Jahanian [Fri, 9 Mar 2012 18:47:16 +0000 (18:47 +0000)]
lldb support: under debugger support flag, when sending message
to forward class, and assigning to an 'id' type var, message
sends default to 'id'. // rdar"//10988847

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

12 years ago[AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
Daniel Dunbar [Fri, 9 Mar 2012 18:35:03 +0000 (18:35 +0000)]
[AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
 - getSourceRange().getBegin() is about as awesome a pattern as .copy().size().

I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.

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

12 years ago[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc...
Daniel Dunbar [Fri, 9 Mar 2012 18:34:54 +0000 (18:34 +0000)]
[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.

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

12 years ago[AST] Define a few more key getLocStart() implementations.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:24 +0000 (15:39 +0000)]
[AST] Define a few more key getLocStart() implementations.
 - This cuts the # of getSourceRange calls by 60% on
   OGF/NSBezierPath-OAExtensions.m.

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

12 years ago[AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:19 +0000 (15:39 +0000)]
[AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.
 - getSourceRange() can be very expensive, we should try to avoid it if at all possible.

In conjunction with the previous commit I measured a ~2% speedup on 403.gcc/combine.c and a 3% speedup on OmniGroupFrameworks/NSBezierPath-OAExtensions.m.

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

12 years ago[AST] Add {DeclRefExpr,MemberExpr,ImplicitCastExpr}::{getLocStart,getLocEnd} methods.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:15 +0000 (15:39 +0000)]
[AST] Add {DeclRefExpr,MemberExpr,ImplicitCastExpr}::{getLocStart,getLocEnd} methods.
 - There are probably a lot more of these worth adding, but these are a start at hitting some of the exprs for which getSourceRange().getBegin() is a poor substitute for getLocStart().

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

12 years ago[AST] Add DeclaratioName::getLoc{Start,End} for consistency.
Daniel Dunbar [Fri, 9 Mar 2012 15:39:11 +0000 (15:39 +0000)]
[AST] Add DeclaratioName::getLoc{Start,End} for consistency.

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