]> granicus.if.org Git - clang/log
clang
13 years agoExtend the ASTContext constructor to delay the initialization of
Douglas Gregor [Fri, 2 Sep 2011 00:18:52 +0000 (00:18 +0000)]
Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).

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

13 years agoAllow the preprocessor to be constructed without performing target-
Douglas Gregor [Thu, 1 Sep 2011 23:39:15 +0000 (23:39 +0000)]
Allow the preprocessor to be constructed without performing target-
and language-specific initialization. Use this to allow ASTUnit to
create a preprocessor object *before* loading the AST file. No actual
functionality change.

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

13 years agoRefactor CheckAdditionOperands(), CheckSubtractionOperands(), and CheckIncrementDecre...
Richard Trieu [Thu, 1 Sep 2011 22:53:23 +0000 (22:53 +0000)]
Refactor CheckAdditionOperands(), CheckSubtractionOperands(), and CheckIncrementDecrementOperand() in SemaExpr.cpp to move reused code to separate functions.

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

13 years agoDon't try keeping a 'LeadingEmptyMacroLoc' in NullStmt. This fails
Argyrios Kyrtzidis [Thu, 1 Sep 2011 21:53:45 +0000 (21:53 +0000)]
Don't try keeping a 'LeadingEmptyMacroLoc' in NullStmt. This fails
in the face of buffering C++/ObjC method bodies.

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

13 years ago[arcmt] Clear out temporary dirs in the tests or we may get failures because of lefto...
Argyrios Kyrtzidis [Thu, 1 Sep 2011 21:53:39 +0000 (21:53 +0000)]
[arcmt] Clear out temporary dirs in the tests or we may get failures because of leftovers.

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

13 years agoDon't try to emit unsupported templated friend declarations. They're unsupported
Nick Lewycky [Thu, 1 Sep 2011 21:49:51 +0000 (21:49 +0000)]
Don't try to emit unsupported templated friend declarations. They're unsupported
and may very well be dependent-types, triggering an assertion in debug info
codegen.

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

13 years agoExtend the self-reference warning to catch when a constructor references itself upon...
Richard Trieu [Thu, 1 Sep 2011 21:44:13 +0000 (21:44 +0000)]
Extend the self-reference warning to catch when a constructor references itself upon initialization, such as using itself within its own copy constructor.

struct S {};
S s(s);

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

13 years ago[arcmt] Fix test/ARCMT/remove-statements.m regression due to
Argyrios Kyrtzidis [Thu, 1 Sep 2011 20:53:18 +0000 (20:53 +0000)]
[arcmt] Fix test/ARCMT/remove-statements.m regression due to
Objective-C method buffering(rdar://10056942)

Turned out the same issue existed for C++ inline methods.

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

13 years agoTeach ASTContext and Preprocessor to hold on to references to the same
Douglas Gregor [Thu, 1 Sep 2011 20:23:19 +0000 (20:23 +0000)]
Teach ASTContext and Preprocessor to hold on to references to the same
LangOptions, rather than making distinct copies of
LangOptions. Granted, LangOptions doesn't actually get modified, but
this will eventually make it easier to construct ASTContext and
Preprocessor before we know all of the LangOptions.

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

13 years agodefault property synthesis is off by default
Fariborz Jahanian [Thu, 1 Sep 2011 20:23:17 +0000 (20:23 +0000)]
default property synthesis is off by default
for now.

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

13 years agoMake test slightly trickier
Douglas Gregor [Thu, 1 Sep 2011 19:02:18 +0000 (19:02 +0000)]
Make test slightly trickier

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

13 years agoobjective-c: Make auto synthesis of properties the default.
Fariborz Jahanian [Thu, 1 Sep 2011 17:50:05 +0000 (17:50 +0000)]
objective-c: Make auto synthesis of properties the default.
This concludes //rdar://8843851

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

13 years agoModules hide macro definitions by default, so that silly things like
Douglas Gregor [Thu, 1 Sep 2011 17:04:32 +0000 (17:04 +0000)]
Modules hide macro definitions by default, so that silly things like
include guards don't show up as macro definitions in every translation
unit that imports a module. Macro definitions can, however, be
exported with the intentionally-ugly #__export_macro__
directive. Implement this feature by not even bothering to serialize
non-exported macros to a module, because clients of that module need
not (should not) know that these macros even exist.

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

13 years agoEnable -fdelayed-template-parsing by default on Win32.
Francois Pichet [Thu, 1 Sep 2011 16:38:08 +0000 (16:38 +0000)]
Enable -fdelayed-template-parsing by default on Win32.
I had to force -fno-delayed-template-parsing on some Index tests because delayed template parsing will change the output of some tests.

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

13 years agoFix PR10744 by adding the toolchain path to the regular program path
Rafael Espindola [Thu, 1 Sep 2011 16:25:49 +0000 (16:25 +0000)]
Fix PR10744 by adding the toolchain path to the regular program path
and doing a simple search. Before we would manually check for the linker
before the -B options were searched.

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

13 years agoAdd 4.4.6 to GccVersions[] in lib/Driver/ToolChains.cpp.
Hans Wennborg [Thu, 1 Sep 2011 14:41:39 +0000 (14:41 +0000)]
Add 4.4.6 to GccVersions[] in lib/Driver/ToolChains.cpp.

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

13 years agoIf size was equal to 0, either NULL or a pointer suitable to be passed to
Zhongxing Xu [Thu, 1 Sep 2011 04:53:59 +0000 (04:53 +0000)]
If size was equal to 0, either NULL or a pointer suitable to be passed to
free() is returned by realloc(). Most code expect NULL.

And we only need to transfer one final ProgramState.

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

13 years agoFix "multi-line comment" compiler error.
Argyrios Kyrtzidis [Thu, 1 Sep 2011 03:07:11 +0000 (03:07 +0000)]
Fix "multi-line comment" compiler error.

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

13 years agoWhen defining the implicit move assignment operator, don't perform
Douglas Gregor [Thu, 1 Sep 2011 02:09:07 +0000 (02:09 +0000)]
When defining the implicit move assignment operator, don't perform
semantic analysis when taking the address of an xvalue. Instead, just
build the unary operator directly, since it's safe to do so (from the
IRgen and AST perspectives) for any glvalue. Fixes PR10822.

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

13 years agoSupport importing of ObjC categories from modules.
Argyrios Kyrtzidis [Thu, 1 Sep 2011 00:58:55 +0000 (00:58 +0000)]
Support importing of ObjC categories from modules.

The initial incentive was to fix a crash when PCH chaining categories
to an interface, but the fix was done in the "modules way" that I hear
is popular with the kids these days.

Each module stores the local chain of categories and we combine them
when the interface is loaded. We also warn if non-dependent modules
introduce duplicate named categories.

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

13 years agoCreate a CaretDiagnostic class to hold the logic for emitting
Chandler Carruth [Wed, 31 Aug 2011 23:59:23 +0000 (23:59 +0000)]
Create a CaretDiagnostic class to hold the logic for emitting
(unsurprisingly) caret diagnostics. This is designed to bring some
organization to the monstrous EmitCaretDiagnostic function, and allow
factoring it more easily and with less mindless parameter passing.

Currently this just lifts the existing function into a method, and
splits off the obviously invariant arguments to be class members. No
functionality is changed, and there are still lots of warts to let
existing code continue functioning as-is. Definitely WIP, more cleanups
to follow.

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

13 years agoSink all of the include stack printing logic into its member function.
Chandler Carruth [Wed, 31 Aug 2011 23:59:19 +0000 (23:59 +0000)]
Sink all of the include stack printing logic into its member function.

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

13 years ago[analyzer] Revert a regression introduced in r133104(The ARC Migration Tool..) due...
Anna Zaks [Wed, 31 Aug 2011 23:53:24 +0000 (23:53 +0000)]
[analyzer] Revert a regression introduced in r133104(The ARC Migration Tool..) due to a merge error.

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

13 years agoTest for default property synthesis.
Fariborz Jahanian [Wed, 31 Aug 2011 23:32:48 +0000 (23:32 +0000)]
Test for default property synthesis.

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

13 years agoobjective-c: this patch (re)introduces objective-c's default property
Fariborz Jahanian [Wed, 31 Aug 2011 22:24:06 +0000 (22:24 +0000)]
objective-c: this patch (re)introduces objective-c's default property
synthesis. This new feature is currently placed under
-fobjc-default-synthesize-properties option
and is off by default pending further testing.
It will become the default feature soon.
// rdar://8843851

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

13 years agoSwitch the "no module found" default-fatal warning to a default-fatal error.
Douglas Gregor [Wed, 31 Aug 2011 21:52:21 +0000 (21:52 +0000)]
Switch the "no module found" default-fatal warning to a default-fatal error.

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

13 years agoDon't assert when diagnosing a missing cast of an unknown-anytype
John McCall [Wed, 31 Aug 2011 20:57:36 +0000 (20:57 +0000)]
Don't assert when diagnosing a missing cast of an unknown-anytype
message send to an unknown method.

rdar://problem/9416370, redux.

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

13 years ago[driver] If no -miphoneos-version-min is specified on the command line *and*
Chad Rosier [Wed, 31 Aug 2011 20:56:25 +0000 (20:56 +0000)]
[driver] If no -miphoneos-version-min is specified on the command line *and*
IPHONEOS_DEPLOYMENT_TARGET if undefined, set -miphoneos-version-min based on
isysroot.

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

13 years agoMake sure to initialize field. Hopefully this will fix some test failures on Windows.
Eli Friedman [Wed, 31 Aug 2011 18:45:31 +0000 (18:45 +0000)]
Make sure to initialize field.  Hopefully this will fix some test failures on Windows.

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

13 years agoDon't verify the name of the driver executable. It's not really relevent
Chandler Carruth [Wed, 31 Aug 2011 18:39:20 +0000 (18:39 +0000)]
Don't verify the name of the driver executable. It's not really relevent
to this test, and doesn't always start with 'clang' when fully resolved
on some build systems.

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

13 years ago[analyzer] Fix varargs helper to only use POD types even for named arguments. Thanks...
Jordy Rose [Wed, 31 Aug 2011 18:33:45 +0000 (18:33 +0000)]
[analyzer] Fix varargs helper to only use POD types even for named arguments. Thanks, Joerg.

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

13 years agoSwitch __import__ over to __import_module__, so we don't conflict with
Douglas Gregor [Wed, 31 Aug 2011 18:19:09 +0000 (18:19 +0000)]
Switch __import__ over to __import_module__, so we don't conflict with
existing practice with Python extension modules. Not that Python
extension modules should be using a double-underscored identifier
anyway, but...

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

13 years agoobjective-c - This patch buffers method implementations
Fariborz Jahanian [Wed, 31 Aug 2011 17:37:55 +0000 (17:37 +0000)]
objective-c - This patch buffers method implementations
and does the Sema on their body after the entire
class/category @implementation is seen. This change allows messaging
of forward private methods, as well as, access to
synthesized ivars of properties with foward synthesize
declarations; among others. In effect, this patch removes
several restrictions placed on objective-c due to in-place
semantics processing of methods.
This is part of // rdar://8843851.

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

13 years agoUpdate libclang to have APIs corresponding to the new 'expansion' naming
Chandler Carruth [Wed, 31 Aug 2011 16:53:37 +0000 (16:53 +0000)]
Update libclang to have APIs corresponding to the new 'expansion' naming
system for macro-backed source locations. The old APIs are preserved for
legacy users.

This was intended to land with the main work of instantiation ->
expansion, but despite running it by Doug over a month ago, I forgot to
commit it. Very sorry for that...

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

13 years agoSerialize the new bits in CXXRecordDecl::DefinitionData.
Sebastian Redl [Wed, 31 Aug 2011 13:59:56 +0000 (13:59 +0000)]
Serialize the new bits in CXXRecordDecl::DefinitionData.

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

13 years agoImprove the diagnostic text for -Wmissing-noreturn to include the name
Chandler Carruth [Wed, 31 Aug 2011 09:01:53 +0000 (09:01 +0000)]
Improve the diagnostic text for -Wmissing-noreturn to include the name
of the function in question when applicable (that is, not for blocks).
Patch by Joerg Sonnenberger with some stylistic tweaks by me.

When discussing this weth Joerg, streaming the decl directly into the
diagnostic didn't work because we have a pointer-to-const, and the
overload doesn't accept such. In order to make my style tweaks to the
patch, I first changed the overload to accept a pointer-to-const, and
then changed the diagnostic printing layer to also use
a pointer-to-const, cleaning up a gross line of code along the way.

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

13 years agoChange err_pp_file_not_found back to an Error; when it's a Warning, we suppress it...
Eli Friedman [Tue, 30 Aug 2011 23:07:51 +0000 (23:07 +0000)]
Change err_pp_file_not_found back to an Error; when it's a Warning, we suppress it in system headers.  And it is not a good idea to suppress it in system headers.  (This was originally changed in r134996 to implement -MG.)

Fixes <rdar://10041960>.  And also brings down the number of warnings without a flag by one :)

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

13 years agoAllow C99 hexfloats in C++0x mode. This change resolves the standards
Douglas Gregor [Tue, 30 Aug 2011 22:40:35 +0000 (22:40 +0000)]
Allow C99 hexfloats in C++0x mode. This change resolves the standards
collision between C99 hexfloats and C++0x user-defined literals by
giving C99 hexfloats precedence. Also, warning about user-defined
literals that conflict with hexfloats and those that have names that
are reserved by the implementation. Fixes <rdar://problem/9940194>.

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

13 years agoFix PR10694: Boolean conversions can be from pointers, and those conversions
Jeffrey Yasskin [Tue, 30 Aug 2011 22:25:41 +0000 (22:25 +0000)]
Fix PR10694: Boolean conversions can be from pointers, and those conversions
aren't considered narrowing conversions.

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

13 years agoWhen writing out the entries in a lookup table for a DeclContext, make
Douglas Gregor [Tue, 30 Aug 2011 20:49:19 +0000 (20:49 +0000)]
When writing out the entries in a lookup table for a DeclContext, make
sure that all of the CXXConversionDecls go into the same
bucket. Otherwise, name lookup might not find them all. Fixes
<rdar://problem/10041960>.

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

13 years agoDeclare and define implicit move constructor and assignment operator.
Sebastian Redl [Tue, 30 Aug 2011 19:58:05 +0000 (19:58 +0000)]
Declare and define implicit move constructor and assignment operator.

This makes the code duplication of implicit special member handling even worse,
but the cleanup will have to come later. For now, this works.
Follow-up with tests for explicit defaulting and enabling the __has_feature
flag to come.

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

13 years agoRemove a few mutating ObjCCategoryDecl methods.
Argyrios Kyrtzidis [Tue, 30 Aug 2011 19:43:26 +0000 (19:43 +0000)]
Remove a few mutating ObjCCategoryDecl methods.

Remove
  -setClassInterface
  -setNextClassCategory
  -insertNextClassCategory

and combine them in the Create function.

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

13 years agoIn ASTWriter::WriteDeclContextVisibleBlock, don't write empty lookups.
Argyrios Kyrtzidis [Tue, 30 Aug 2011 19:43:23 +0000 (19:43 +0000)]
In ASTWriter::WriteDeclContextVisibleBlock, don't write empty lookups.

Empty lookups can occur in the DeclContext map when we are chaining PCHs, where
the empty lookup indicates that we already looked in ExternalASTSource.

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

13 years agoRemove a couple of unnecessary objc method lookups.
Argyrios Kyrtzidis [Tue, 30 Aug 2011 19:43:21 +0000 (19:43 +0000)]
Remove a couple of unnecessary objc method lookups.

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

13 years ago[libclang] Rename some functions and make sure we don't iterate past the tokens array.
Argyrios Kyrtzidis [Tue, 30 Aug 2011 19:43:19 +0000 (19:43 +0000)]
[libclang] Rename some functions and make sure we don't iterate past the tokens array.

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

13 years agoobjc - fixes a regression in declaring c decls nested in
Fariborz Jahanian [Tue, 30 Aug 2011 17:10:52 +0000 (17:10 +0000)]
objc - fixes a regression in declaring c decls nested in
objective-c containers due to recent changes to objc decl
contexts. // rdar://10041908

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

13 years agoRemove obsolete ObjCInferRelatedReturnType from LangOptions...the correct option...
Jordy Rose [Tue, 30 Aug 2011 01:51:13 +0000 (01:51 +0000)]
Remove obsolete ObjCInferRelatedReturnType from LangOptions...the correct option is ObjCInferRelatedResultType.

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

13 years agoThe size of struct UnwindException varies by platform with no
John McCall [Tue, 30 Aug 2011 01:42:09 +0000 (01:42 +0000)]
The size of struct UnwindException varies by platform with no
apparent general rule.  Just special-case it as appropriate.
PR10789.

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

13 years agoBe sure to emit lvalue-to-rvalue casts for loads from x-values.
John McCall [Tue, 30 Aug 2011 00:57:29 +0000 (00:57 +0000)]
Be sure to emit lvalue-to-rvalue casts for loads from x-values.
Doing this happens to disrupt the pattern that ARC was looking for
for move optimizations, so we need to fix that simultaneously.

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

13 years agoUpdate mingw-w64 part of the user manual, from Ruben Van Boxem!
Douglas Gregor [Tue, 30 Aug 2011 00:40:12 +0000 (00:40 +0000)]
Update mingw-w64 part of the user manual, from Ruben Van Boxem!

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

13 years agoFix a typo when determining whether to strip cv-qualifiers during template argument...
Douglas Gregor [Tue, 30 Aug 2011 00:37:54 +0000 (00:37 +0000)]
Fix a typo when determining whether to strip cv-qualifiers during template argument deduction

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

13 years agoUpdate python testcase for GNU old-style field designator warning,
Douglas Gregor [Tue, 30 Aug 2011 00:16:30 +0000 (00:16 +0000)]
Update python testcase for GNU old-style field designator warning,
from Anders Waldenborg!

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

13 years agoAdd support for Cursor.displayname in python bindings, from Anders Waldenborg!
Douglas Gregor [Tue, 30 Aug 2011 00:15:34 +0000 (00:15 +0000)]
Add support for Cursor.displayname in python bindings, from Anders Waldenborg!

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

13 years agoUpdate the comment on the default-argument conversion fix; thanks to
John McCall [Mon, 29 Aug 2011 23:55:37 +0000 (23:55 +0000)]
Update the comment on the default-argument conversion fix;  thanks to
Johannes Schaub for talking me around to sense.

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

13 years agoThread safety: Adding a name to the thread safety diagnostic group to prevent typos
Caitlin Sadowski [Mon, 29 Aug 2011 23:33:18 +0000 (23:33 +0000)]
Thread safety: Adding a name to the thread safety diagnostic group to prevent typos

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

13 years agoDo not warn about [super finalize] in arc mode.
Nico Weber [Mon, 29 Aug 2011 22:59:14 +0000 (22:59 +0000)]
Do not warn about [super finalize] in arc mode.

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

13 years agoClang/PNaCl: Improve test coverage for PNaClTargetInfo (type aligns), fixes nits:
Ivan Krasin [Mon, 29 Aug 2011 22:39:12 +0000 (22:39 +0000)]
Clang/PNaCl: Improve test coverage for PNaClTargetInfo (type aligns), fixes nits:
- wrong alignment for double (it was 4, but 8 is desired),
- added checks for _REENTRANT define,
- fixed the issue that defines were not tested (because the check for inside #ifdef).

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

13 years agoThread safety: added basic handling for pt_guarded_by/var and guarded_by/var annotati...
Caitlin Sadowski [Mon, 29 Aug 2011 22:27:51 +0000 (22:27 +0000)]
Thread safety: added basic handling for pt_guarded_by/var and guarded_by/var annotations. We identify situations where we are accessing (reading or writing) guarded variables, and report an error if the appropriate locks are not held.

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

13 years agoFix a rewriter bug caused by recent changes in objc's
Fariborz Jahanian [Mon, 29 Aug 2011 22:21:46 +0000 (22:21 +0000)]
Fix a rewriter bug caused by recent changes in objc's
group decls.

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

13 years agoAdd missing function _mm_ucomige_sd to emmintrin.h. PR10803.
Eli Friedman [Mon, 29 Aug 2011 21:26:24 +0000 (21:26 +0000)]
Add missing function _mm_ucomige_sd to emmintrin.h. PR10803.

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

13 years ago[analyzer] MacOSKeychainAPIChecker: Simplify getSymbolForRegion by using existing...
Anna Zaks [Mon, 29 Aug 2011 21:10:00 +0000 (21:10 +0000)]
[analyzer] MacOSKeychainAPIChecker: Simplify getSymbolForRegion by using existing API. Thanks Jordy.

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

13 years agoFix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement on the...
Anna Zaks [Mon, 29 Aug 2011 20:43:37 +0000 (20:43 +0000)]
Fix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement on the previous commit.)

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

13 years agoFix bug 10797: Crash: "cast<Ty>() argument of incompatible type!" assert when analyzi...
Anna Zaks [Mon, 29 Aug 2011 20:05:54 +0000 (20:05 +0000)]
Fix bug 10797: Crash: "cast<Ty>() argument of incompatible type!" assert when analyzing ICU.

Patch by Jean-Daniel Dupas. Thanks for spotting and fixing!

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

13 years agoSome minor updates to the Linux search path handling for Slackware. Patch by Will...
Eli Friedman [Mon, 29 Aug 2011 18:56:43 +0000 (18:56 +0000)]
Some minor updates to the Linux search path handling for Slackware.  Patch by Will Dietz. PR10692.

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

13 years agoMinor clean up of objc's decl context stuff.
Fariborz Jahanian [Mon, 29 Aug 2011 17:33:12 +0000 (17:33 +0000)]
Minor clean up of objc's decl context stuff.
No change in functionality.

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

13 years agoAdd and document __has_feature values for the remaining C++0x
Douglas Gregor [Mon, 29 Aug 2011 17:28:38 +0000 (17:28 +0000)]
Add and document __has_feature values for the remaining C++0x
features, so clients can check for the availability of these features
even before we get around to implementing them.

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

13 years agoThread safety: various minor bugfixes, with test cases
Caitlin Sadowski [Mon, 29 Aug 2011 17:12:27 +0000 (17:12 +0000)]
Thread safety: various minor bugfixes, with test cases

This patch is by DeLesley Hutchins.

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

13 years agoFix type mismatch in initialization (caught by -Wliteral-conversion)
Matt Beaumont-Gay [Mon, 29 Aug 2011 16:37:29 +0000 (16:37 +0000)]
Fix type mismatch in initialization (caught by -Wliteral-conversion)

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

13 years agoPrint 'int' instead of 'const int' in the narrowing conversion error, since the
Jeffrey Yasskin [Mon, 29 Aug 2011 15:59:37 +0000 (15:59 +0000)]
Print 'int' instead of 'const int' in the narrowing conversion error, since the
qualification of a type doesn't affect whether a conversion is a narrowing
conversion.
This doesn't work in template cases because SubstTemplateTypeParmType gets in
the way.

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

13 years ago[analyzer] Remove empty obsolete header directories from StaticAnalyzer.
Jordy Rose [Mon, 29 Aug 2011 05:06:08 +0000 (05:06 +0000)]
[analyzer] Remove empty obsolete header directories from StaticAnalyzer.

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

13 years agoWarn on missing [super finalize] calls.
Nico Weber [Sun, 28 Aug 2011 22:35:17 +0000 (22:35 +0000)]
Warn on missing [super finalize] calls.

This matches gcc's logic. Second half of PR10661.

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

13 years ago[analyzer] Header cleanup to decrease coupling (and recompilation). No functionality...
Jordy Rose [Sun, 28 Aug 2011 19:45:32 +0000 (19:45 +0000)]
[analyzer] Header cleanup to decrease coupling (and recompilation). No functionality change.

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

13 years ago[analyzer] Introduce a new callback for checkers, printState, to be used for debug...
Jordy Rose [Sun, 28 Aug 2011 19:11:56 +0000 (19:11 +0000)]
[analyzer] Introduce a new callback for checkers, printState, to be used for debug-printing the contents of a ProgramState.

Unlike the other callbacks, this one is a simple virtual method, since it is only to be used for debugging.

This new callback replaces the old ProgramState::Printer interface, and allows us to move the printing of refcount bindings from CFRefCount to RetainReleaseChecker.

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

13 years ago[analyzer] update bug report url
Nico Weber [Sun, 28 Aug 2011 11:50:56 +0000 (11:50 +0000)]
[analyzer] update bug report url

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

13 years ago[analyzer] Remove the ProgramState argument from ExprEngine::evalBind; we were ignori...
Jordy Rose [Sun, 28 Aug 2011 06:02:28 +0000 (06:02 +0000)]
[analyzer] Remove the ProgramState argument from ExprEngine::evalBind; we were ignoring it anyway. No functionality change.

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

13 years ago[analyzer] Eliminate almost all uses of TransferFuncs from ExprEngine.
Jordy Rose [Sun, 28 Aug 2011 05:54:23 +0000 (05:54 +0000)]
[analyzer] Eliminate almost all uses of TransferFuncs from ExprEngine.

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

13 years ago[analyzer] Migrate argument invalidation from CFRefCount to ExprEngine.
Jordy Rose [Sun, 28 Aug 2011 05:16:28 +0000 (05:16 +0000)]
[analyzer] Migrate argument invalidation from CFRefCount to ExprEngine.

This is a common path for function and C++ method calls, Objective-C messages and property accesses, and C++ construct-exprs.

As support, add message receiver accessors to ObjCMessage and CallOrObjCMessage.

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

13 years ago[analyzer] Change the check::RegionChanges callback to include the regions explicitly...
Jordy Rose [Sat, 27 Aug 2011 22:51:26 +0000 (22:51 +0000)]
[analyzer] Change the check::RegionChanges callback to include the regions explicitly requested for invalidation.

Also, allow CallOrObjCMessage to wrap a CXXConstructExpr as well.

Finally, this allows us to remove the clunky whitelisting system from CFRefCount/RetainReleaseChecker. Slight regression due to CXXNewExprs not yet being handled in post-statement callbacks (PR forthcoming).

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

13 years agoDisable the l-value to r-value conversion on C++ class types passed
John McCall [Sat, 27 Aug 2011 22:06:17 +0000 (22:06 +0000)]
Disable the l-value to r-value conversion on C++ class types passed
to varargs functions in unevaluated contexts.  AFAICT, there is no
standards justification for this, but it matches what other compilers do
and therefore preserves compatibility with certain template metaprogramming
idioms.

Should fix self-host.

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

13 years agoobjective-c - Make warning on unimplemented protocols point
Fariborz Jahanian [Sat, 27 Aug 2011 21:55:47 +0000 (21:55 +0000)]
objective-c - Make warning on unimplemented protocols point
to class implementation where it is supposed to be
implemented. // rdar://10009982.

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

13 years ago[analyzer] Rename current PathDiagnosticClient::HandlePathDiagnostic() to HandlePathD...
Ted Kremenek [Sat, 27 Aug 2011 21:39:14 +0000 (21:39 +0000)]
[analyzer] Rename current PathDiagnosticClient::HandlePathDiagnostic() to HandlePathDiagnosticImpl(), and slot in new HandlePathDiagnostic() for potentially handling concurrent access to PathDiagnosticClients (in the future).

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

13 years ago[analyzer] Pull body of loop in AnalysisConsumer::HandleDeclContext() into its own...
Ted Kremenek [Sat, 27 Aug 2011 21:28:09 +0000 (21:28 +0000)]
[analyzer] Pull body of loop in AnalysisConsumer::HandleDeclContext() into its own method.  No real functionality change.

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

13 years ago[analyzer] Add test case for handling of __bridge_transfer that previously resulted...
Ted Kremenek [Sat, 27 Aug 2011 21:15:48 +0000 (21:15 +0000)]
[analyzer] Add test case for handling of __bridge_transfer that previously resulted in a 'stack address' warning (that was fixed in r138616).  Fixes <rdar://problem/10018376>.

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

13 years agoobjective-c: Treat top-level objective-c declarations
Fariborz Jahanian [Sat, 27 Aug 2011 20:50:59 +0000 (20:50 +0000)]
objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.

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

13 years agoRemove unused variables noticed by GCC.
Benjamin Kramer [Sat, 27 Aug 2011 17:54:32 +0000 (17:54 +0000)]
Remove unused variables noticed by GCC.

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

13 years agoTake an entirely different approach to handling the "parsing" of
Douglas Gregor [Sat, 27 Aug 2011 06:37:51 +0000 (06:37 +0000)]
Take an entirely different approach to handling the "parsing" of
__import__ within the preprocessor, since the prior one foolishly
assumed that Preprocessor::Lex() was re-entrant. We now handle
__import__ at the top level (only), after macro expansion. This should
fix the buildbot failures.

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

13 years ago[arcmt] Xfail the test for windows.
Argyrios Kyrtzidis [Sat, 27 Aug 2011 03:38:05 +0000 (03:38 +0000)]
[arcmt] Xfail the test for windows.

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

13 years agoThe lvalue-to-rvalue on structs in C++ is actually part
John McCall [Sat, 27 Aug 2011 01:09:30 +0000 (01:09 +0000)]
The lvalue-to-rvalue on structs in C++ is actually part
of default argument promotion and needs to happen unconditionally.
This is particularly semantically important in C++0x.

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

13 years agoTwinify.
Benjamin Kramer [Sat, 27 Aug 2011 00:34:29 +0000 (00:34 +0000)]
Twinify.

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

13 years agoXFAIL one of the module tests on win32, until we figure out what's happening
Douglas Gregor [Sat, 27 Aug 2011 00:29:32 +0000 (00:29 +0000)]
XFAIL one of the module tests on win32, until we figure out what's happening

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

13 years agoIn C++0x mode, suggest nullptr as the initializer for an uninitialized
Douglas Gregor [Sat, 27 Aug 2011 00:18:50 +0000 (00:18 +0000)]
In C++0x mode, suggest nullptr as the initializer for an uninitialized
pointer variable. Patch by David Blaikie!

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

13 years agoControl 'invalid conversion specifier' warnings under a subflag (-Wformat-invalid...
Ted Kremenek [Sat, 27 Aug 2011 00:16:45 +0000 (00:16 +0000)]
Control 'invalid conversion specifier' warnings under a subflag (-Wformat-invalid-specifier) of -Wformat.  Fixes <rdar://problem/10031930>.

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

13 years agoImprove caret location for the GNU old-style field designator warning, from David...
Douglas Gregor [Sat, 27 Aug 2011 00:13:16 +0000 (00:13 +0000)]
Improve caret location for the GNU old-style field designator warning, from David Blaikie

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

13 years agoSilence a GCC warning
Douglas Gregor [Sat, 27 Aug 2011 00:10:53 +0000 (00:10 +0000)]
Silence a GCC warning

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

13 years agoRemove the -import-module option. It's no longer useful
Douglas Gregor [Sat, 27 Aug 2011 00:03:05 +0000 (00:03 +0000)]
Remove the -import-module option. It's no longer useful

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

13 years agoTry to unbreak the build on systems where uint64_t isn't something that StringRef...
Douglas Gregor [Fri, 26 Aug 2011 23:57:29 +0000 (23:57 +0000)]
Try to unbreak the build on systems where uint64_t isn't something that StringRef::getAsInteger can handle as its second argument

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

13 years agoIntroduce support for a simple module import declaration, which
Douglas Gregor [Fri, 26 Aug 2011 23:56:07 +0000 (23:56 +0000)]
Introduce support for a simple module import declaration, which
loads the named module. The syntax itself is intentionally hideous and
will be replaced at some later point with something more
palatable. For now, we're focusing on the semantics:
  - Module imports are handled first by the preprocessor (to get macro
  definitions) and then the same tokens are also handled by the parser
  (to get declarations). If both happen (as in normal compilation),
  the second one is redundant, because we currently have no way to
  hide macros or declarations when loading a module. Chris gets credit
  for this mad-but-workable scheme.
  - The Preprocessor now holds on to a reference to a module loader,
  which is responsible for loading named modules. CompilerInstance is
  the only important module loader: it now knows how to create and
  wire up an AST reader on demand to actually perform the module load.
  - We search for modules in the include path, using the module name
  with the suffix ".pcm" (precompiled module) for the file name. This
  is a temporary hack; we hope to improve the situation in the
  future.

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

13 years ago[arcmt] Add a test case for r138671 and improve the loop.
Argyrios Kyrtzidis [Fri, 26 Aug 2011 23:20:23 +0000 (23:20 +0000)]
[arcmt] Add a test case for r138671 and improve the loop.

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

13 years agoFreeBSD (apparently) does not support crash-recovery tests.
Andrew Trick [Fri, 26 Aug 2011 22:46:31 +0000 (22:46 +0000)]
FreeBSD (apparently) does not support crash-recovery tests.

These tests have been failing since the beginning of buildbot time:
crash-recovery-code-complete.c
crash-recovery-reparse.c
crash-recovery.c

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

13 years ago[arcmt] Fix horrible bug where migrating files if there is a space in the paths
Argyrios Kyrtzidis [Fri, 26 Aug 2011 22:40:55 +0000 (22:40 +0000)]
[arcmt] Fix horrible bug where migrating files if there is a space in the paths
of the migrated files. rdar://10022801

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