]> granicus.if.org Git - clang/log
clang
13 years ago[Reapply r128773. This is not the source of the issues Devang was seeing
Ken Dyck [Thu, 7 Apr 2011 01:22:42 +0000 (01:22 +0000)]
[Reapply r128773. This is not the source of the issues Devang was seeing
with debug info.]

Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
change in functionality intended.

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

13 years ago[Reapply r128771. It wasn't the source of the issues Devang saw with debug
Ken Dyck [Thu, 7 Apr 2011 00:59:42 +0000 (00:59 +0000)]
[Reapply r128771. It wasn't the source of the issues Devang saw with debug
info.]

Use CharUnits for the offset type in the ClassNamesAndOffsets map in
dumpLayout(). No change in functionality intended.

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

13 years agoReapply r128770. It's not the cause of the issues Devang saw with debug info.
Ken Dyck [Thu, 7 Apr 2011 00:55:01 +0000 (00:55 +0000)]
Reapply r128770. It's not the cause of the issues Devang saw with debug info.

Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. No
change in functionality intended.

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

13 years agoI can't figure out any reasonable way to make this test non-host-dependent,
John McCall [Wed, 6 Apr 2011 20:46:42 +0000 (20:46 +0000)]
I can't figure out any reasonable way to make this test non-host-dependent,
so I'm killing it.

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

13 years agoWide Pascal strings should be of type wchar_t[] and not unsigned char[].
Anders Carlsson [Wed, 6 Apr 2011 18:42:48 +0000 (18:42 +0000)]
Wide Pascal strings should be of type wchar_t[] and not unsigned char[].

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

13 years agoFix lookup for class messages sent to qualified-class
Fariborz Jahanian [Wed, 6 Apr 2011 18:40:08 +0000 (18:40 +0000)]
Fix lookup for class messages sent to qualified-class
types such that protocols are seached first. Fixes
// rdar://9224670

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

13 years agoAdd support for Fedora16, gcc 4.6.0 and Fedora Rawhide.
Eric Christopher [Wed, 6 Apr 2011 18:22:53 +0000 (18:22 +0000)]
Add support for Fedora16, gcc 4.6.0 and Fedora Rawhide.

Patch by Bobby Powers

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

13 years agoAdded link to LLVM cmake page in Visual Studio section.
John Thompson [Wed, 6 Apr 2011 18:22:12 +0000 (18:22 +0000)]
Added link to LLVM cmake page in Visual Studio section.

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

13 years agoRefine rules for atomic property api to
Fariborz Jahanian [Wed, 6 Apr 2011 16:05:26 +0000 (16:05 +0000)]
Refine rules for atomic property api to
pass a previously failing clang test.
// rdar://8808439

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

13 years agoDo not use IR marker for LLVM intrinsics
Peter Collingbourne [Wed, 6 Apr 2011 12:29:09 +0000 (12:29 +0000)]
Do not use IR marker for LLVM intrinsics

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

13 years agoIf this is an intrinsic function, set the function's attributes to the intrinsic...
Peter Collingbourne [Wed, 6 Apr 2011 12:29:04 +0000 (12:29 +0000)]
If this is an intrinsic function, set the function's attributes to the intrinsic's attributes.

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

13 years agoWhen updating the retain summary based on {cf,ns}_consumed attributes,
John McCall [Wed, 6 Apr 2011 09:02:12 +0000 (09:02 +0000)]
When updating the retain summary based on {cf,ns}_consumed attributes,
be sure to consume the argument index that actually had the attribute
rather than always the first.  rdar://problem/9234108

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

13 years agoMake this a -cc1 test with a triple and a target feature.
John McCall [Wed, 6 Apr 2011 06:48:04 +0000 (06:48 +0000)]
Make this a -cc1 test with a triple and a target feature.

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

13 years agoAnonymify this test.
John McCall [Wed, 6 Apr 2011 04:29:52 +0000 (04:29 +0000)]
Anonymify this test.

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

13 years agoImplement the AVX cmp builtins as macros instead of static inlines.
John McCall [Wed, 6 Apr 2011 03:37:51 +0000 (03:37 +0000)]
Implement the AVX cmp builtins as macros instead of static inlines.
Patch by Syoyo Fujita!  Reviewed by Chris Lattner!  Checked in by me!

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

13 years agoDiagnose a missing ')' on what looks like a statement expression.
John McCall [Wed, 6 Apr 2011 02:35:25 +0000 (02:35 +0000)]
Diagnose a missing ')' on what looks like a statement expression.
A situation where we can get an invalid ExprResult without an error.
Fixes PR8394.  Patch by Justin Bogner!

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

13 years agoFix getLocForEndOfToken to not double-count spurious internal characters
John McCall [Wed, 6 Apr 2011 01:50:22 +0000 (01:50 +0000)]
Fix getLocForEndOfToken to not double-count spurious internal characters
within a token, like trigraphs and escaped newlines.
Patch by Marcin Kowalczyk!

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

13 years agoAdd a test case for r128957. It fixed a bug!
Devang Patel [Wed, 6 Apr 2011 00:01:52 +0000 (00:01 +0000)]
Add a test case for r128957. It fixed a bug!

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

13 years agoSimplify.
Devang Patel [Tue, 5 Apr 2011 23:26:36 +0000 (23:26 +0000)]
Simplify.

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

13 years agoFixes a regression caused by my last patch.
Fariborz Jahanian [Tue, 5 Apr 2011 23:01:27 +0000 (23:01 +0000)]
Fixes a regression caused by my last patch.
As a result, I had to remove a c++ version of a clang
test which requires more scrutiny on my part.

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

13 years agoEmit debug info for function template parameters.
Devang Patel [Tue, 5 Apr 2011 22:54:11 +0000 (22:54 +0000)]
Emit debug info for function template parameters.

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

13 years agoAdd ToolChain support to get Clang to recognize Ubuntu/ppc and Gentoo/ppc64.
Ted Kremenek [Tue, 5 Apr 2011 22:04:27 +0000 (22:04 +0000)]
Add ToolChain support to get Clang to recognize Ubuntu/ppc and Gentoo/ppc64.

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

13 years agoGenerate atomic api for atomic properties (x86 and x86_64
Fariborz Jahanian [Tue, 5 Apr 2011 21:41:23 +0000 (21:41 +0000)]
Generate atomic api for atomic properties (x86 and x86_64
targets) when load/store results in multiple instructions.
// rdar://8808439

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

13 years agoCommit a bit of a hack to fully handle the situation where variables are
Chandler Carruth [Tue, 5 Apr 2011 21:36:30 +0000 (21:36 +0000)]
Commit a bit of a hack to fully handle the situation where variables are
marked explicitly as uninitialized through direct self initialization:

  int x = x;

With r128894 we prevented warnings about this code, and this patch
teaches the analysis engine to continue analyzing subsequent uses of
'x'. This should wrap up PR9624.

There is still an open question of whether we should suppress the
maybe-uninitialized warnings resulting from variables initialized in
this fashion. The definitely-uninitialized uses should always be warned.

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

13 years agoRemove unintentional check-in.
Devang Patel [Tue, 5 Apr 2011 21:05:56 +0000 (21:05 +0000)]
Remove unintentional check-in.

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

13 years agoEnable sse4 and aes for SandyBridge. Leave avx support commented out for now.
Roman Divacky [Tue, 5 Apr 2011 20:32:44 +0000 (20:32 +0000)]
Enable sse4 and aes for SandyBridge. Leave avx support commented out for now.

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

13 years agoFix typo.
Devang Patel [Tue, 5 Apr 2011 20:28:21 +0000 (20:28 +0000)]
Fix typo.

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

13 years agoAdd security syntax checker for strcat() which causes the Static Analyzer to generate...
Lenny Maiorani [Tue, 5 Apr 2011 20:18:46 +0000 (20:18 +0000)]
Add security syntax checker for strcat() which causes the Static Analyzer to generate a warning any time the strcat() function is used with a note suggesting to use a function which provides bounded buffers. CWE-119.

Also, brings the security syntax checker more inline with coding standards.

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

13 years agoUse TemplateParameterList to extract template parameter name.
Devang Patel [Tue, 5 Apr 2011 20:15:06 +0000 (20:15 +0000)]
Use TemplateParameterList to extract template parameter name.

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

13 years agoAdded *hidden* flags -print-options and -print-all-options so
Andrew Trick [Tue, 5 Apr 2011 18:56:55 +0000 (18:56 +0000)]
Added *hidden* flags -print-options and -print-all-options so
developers can see if their driver changed any cl::Option's. The
current implementation isn't perfect but handles most kinds of
options. This is nice to have when decomposing the stages of
compilation and moving between different drivers. It's also a good
sanity check when comparing results produced by different command line
invocations that are expected to produce the comparable results.

Note: This is not an attempt to prolong the life of cl::Option. On the
contrary, it's a placeholder for a feature that must exist when
cl::Option is replaced by a more appropriate framework. A new
framework needs: a central option registry, dynamic name lookup,
non-global containers of option values (e.g. per-module,
per-function), *and* the ability to print options values and their defaults at
any point during compilation.

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

13 years agowhitespace
Andrew Trick [Tue, 5 Apr 2011 18:49:32 +0000 (18:49 +0000)]
whitespace

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

13 years agoSimplify the tracking of when to issue a fixit hint, making the helper
Chandler Carruth [Tue, 5 Apr 2011 18:27:05 +0000 (18:27 +0000)]
Simplify the tracking of when to issue a fixit hint, making the helper
function more clear and obvious in behavior.

Add some comments documenting the behavior of the primary diagnostic helper.

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

13 years agoSeparate the logic for issuing the initialization fixit hint from the
Chandler Carruth [Tue, 5 Apr 2011 18:18:08 +0000 (18:18 +0000)]
Separate the logic for issuing the initialization fixit hint from the
diagnostic emission. The fixit hint, when suggested, typically has
nothing to do with the nature or form of the reference.

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

13 years agoBegin refactoring the uninitialized warning code that I uglied up. This
Chandler Carruth [Tue, 5 Apr 2011 18:18:05 +0000 (18:18 +0000)]
Begin refactoring the uninitialized warning code that I uglied up. This
extracts a function to handle the emission of the diagnostic separately
from the walking over the set of uninitialized uses.

Also updates the naming used within this extracted function to be a bit
more consistent with the rest of Clang's naming patterns.

The next step will be breaking this apart so that we can go through
different functions rather than tracking so many boolean variables.

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

13 years agoFix spelling.
Michael J. Spencer [Tue, 5 Apr 2011 17:57:51 +0000 (17:57 +0000)]
Fix spelling.

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

13 years agoFix PR9624 by explicitly disabling uninitialized warnings for direct self-init:
Chandler Carruth [Tue, 5 Apr 2011 17:41:31 +0000 (17:41 +0000)]
Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:

  int x = x;

GCC disables its warnings on this construct as a way of indicating that
the programmer intentionally wants the variable to be uninitialized.
Only the warning on the initializer is turned off in this iteration.

This makes the code a lot more ugly, but starts commenting the
surprising behavior here. This is a WIP, I want to refactor it
substantially for clarity, and to determine whether subsequent warnings
should be suppressed or not.

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

13 years agoRefactor.
Devang Patel [Tue, 5 Apr 2011 17:30:54 +0000 (17:30 +0000)]
Refactor.

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

13 years agoFix copy-and-paste bug that I introduced while tidying up the code.
David Chisnall [Tue, 5 Apr 2011 17:15:18 +0000 (17:15 +0000)]
Fix copy-and-paste bug that I introduced while tidying up the code.

Does anyone want to buy me a new brain?

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

13 years agoMake this const, there's probably no harm in it and it silences a bunch
Eric Christopher [Tue, 5 Apr 2011 07:54:42 +0000 (07:54 +0000)]
Make this const, there's probably no harm in it and it silences a bunch
of warnings when passing const arguments into the function.

Fixes PR9426

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

13 years agoCleanup the style of some of this code prior to functional changes.
Chandler Carruth [Tue, 5 Apr 2011 06:48:00 +0000 (06:48 +0000)]
Cleanup the style of some of this code prior to functional changes.
I think this moves the code in the desired direction of the new style
recommendations (and style conventional in Clang), but if anyone prefers
the previous style, or has other suggestions just chime in and I'll
follow up.

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

13 years agoRefactor one helper function to merely forward to another so that there
Chandler Carruth [Tue, 5 Apr 2011 06:47:57 +0000 (06:47 +0000)]
Refactor one helper function to merely forward to another so that there
is a single implementation. No functionality change intended.

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

13 years agodocs/UsersManual.html: Fix some inconsistent HTML elements.
NAKAMURA Takumi [Tue, 5 Apr 2011 04:31:31 +0000 (04:31 +0000)]
docs/UsersManual.html: Fix some inconsistent HTML elements.

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

13 years agodocs/UsersManual.html: """ize in a paragraph. A few unpaired quotations might...
NAKAMURA Takumi [Tue, 5 Apr 2011 00:57:02 +0000 (00:57 +0000)]
docs/UsersManual.html: """ize in a paragraph. A few unpaired quotations might confuse HTML-aware text edtors.

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

13 years agoSet AAPCS-VFP calling convention accordingly and hard float ABI command handling.
Sandeep Patel [Tue, 5 Apr 2011 00:23:47 +0000 (00:23 +0000)]
Set AAPCS-VFP calling convention accordingly and hard float ABI command handling.

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

13 years agoFilter our experimental checks in scan-build's checker listing.
Ted Kremenek [Tue, 5 Apr 2011 00:21:49 +0000 (00:21 +0000)]
Filter our experimental checks in scan-build's checker listing.

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

13 years agoFix building with gcc.
Argyrios Kyrtzidis [Tue, 5 Apr 2011 00:14:22 +0000 (00:14 +0000)]
Fix building with gcc.

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

13 years agoFix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG...
Ted Kremenek [Mon, 4 Apr 2011 23:29:12 +0000 (23:29 +0000)]
Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:

1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.

The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.

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

13 years agoEliminate conservative check that is covered by isIncompleteType() check.
Devang Patel [Mon, 4 Apr 2011 23:23:39 +0000 (23:23 +0000)]
Eliminate conservative check that is covered by isIncompleteType() check.

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

13 years agoIncomplete type does not have any size.
Devang Patel [Mon, 4 Apr 2011 23:18:38 +0000 (23:18 +0000)]
Incomplete type does not have any size.

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

13 years agoAlso update CMakeList.txt
Argyrios Kyrtzidis [Mon, 4 Apr 2011 23:17:56 +0000 (23:17 +0000)]
Also update CMakeList.txt

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

13 years agoAdd missing file for my previous commit.
Argyrios Kyrtzidis [Mon, 4 Apr 2011 23:16:36 +0000 (23:16 +0000)]
Add missing file for my previous commit.

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

13 years agoMove Driver::createInvocationFromArgs function to Frontend library to avoid dependenc...
Argyrios Kyrtzidis [Mon, 4 Apr 2011 23:11:45 +0000 (23:11 +0000)]
Move Driver::createInvocationFromArgs function to Frontend library to avoid dependency cycle
between libFrontend and libDriver.

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

13 years agoExplain why layout prefers 32 for small types on Thumb.
Sandeep Patel [Mon, 4 Apr 2011 22:58:12 +0000 (22:58 +0000)]
Explain why layout prefers 32 for small types on Thumb.

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

13 years agoChange test/Analysis/idempotent-operations.c to output the .plist file in the test...
Argyrios Kyrtzidis [Mon, 4 Apr 2011 22:30:01 +0000 (22:30 +0000)]
Change test/Analysis/idempotent-operations.c to output the .plist file in the test output directory.

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

13 years agoIntroduce Driver::createInvocationFromArgs used to create a CompilerInvocation from...
Argyrios Kyrtzidis [Mon, 4 Apr 2011 21:38:51 +0000 (21:38 +0000)]
Introduce Driver::createInvocationFromArgs used to create a CompilerInvocation from command-line args.

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

13 years ago-Wuninitialized: use "self-init" warning when issue uninitialized values warnings...
Ted Kremenek [Mon, 4 Apr 2011 20:56:00 +0000 (20:56 +0000)]
-Wuninitialized: use "self-init" warning when issue uninitialized values warnings from the dataflow analysis that include within the initializer of a variable.

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

13 years agoRevert r128770, r128771, r128773 and r128776 for now. It breaks debug info.
Devang Patel [Mon, 4 Apr 2011 20:36:06 +0000 (20:36 +0000)]
Revert r128770, r128771, r128773 and r128776 for now. It breaks debug info.

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

13 years ago-Wuninitialized: don't warn about uninitialized variables in unreachable code.
Ted Kremenek [Mon, 4 Apr 2011 20:30:58 +0000 (20:30 +0000)]
-Wuninitialized: don't warn about uninitialized variables in unreachable code.

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

13 years ago-Wuninitialized: don't issue fixit for initializer if a variable declaration already...
Ted Kremenek [Mon, 4 Apr 2011 19:43:57 +0000 (19:43 +0000)]
-Wuninitialized: don't issue fixit for initializer if a variable declaration already has an initializer.

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

13 years agoWhen emitting a "too many arguments to function call..." error, also include a note...
Ted Kremenek [Mon, 4 Apr 2011 17:22:27 +0000 (17:22 +0000)]
When emitting a "too many arguments to function call..." error, also include a note with a location for the function prototype.

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

13 years agoChange ARM data layout strings to match llvm-gcc.
Bob Wilson [Mon, 4 Apr 2011 16:53:11 +0000 (16:53 +0000)]
Change ARM data layout strings to match llvm-gcc.
Sandeep Patel noticed that the alignment was wrong for Neon vector types,
and this change is partly derived from his patch.  For the APCS ABI, however,
additional changes were required: the maximum ABI alignment is 32 bits and
the preferred alignment for i64 and f64 types should be 64 bits.

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

13 years agodocs/UsersManual.html: Add cygming notes.
NAKAMURA Takumi [Mon, 4 Apr 2011 15:02:41 +0000 (15:02 +0000)]
docs/UsersManual.html: Add cygming notes.

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

13 years agoPR9585: add __decltype as a keyword. While I'm here, alphabetize the list.
Eli Friedman [Mon, 4 Apr 2011 07:19:40 +0000 (07:19 +0000)]
PR9585: add __decltype as a keyword.  While I'm here, alphabetize the list.

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

13 years agoPR9615: make sure we destroy any temporaries returned by operator->.
Eli Friedman [Mon, 4 Apr 2011 01:18:25 +0000 (01:18 +0000)]
PR9615: make sure we destroy any temporaries returned by operator->.

I'm pretty sure this is the right fix, but I would appreciate it if someone
else would double-check.

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

13 years agoclang has had full and tested support for C++0x trailing-return-type and auto type...
Richard Smith [Sun, 3 Apr 2011 14:12:46 +0000 (14:12 +0000)]
clang has had full and tested support for C++0x trailing-return-type and auto type deduction since r126166. Update the website to reflect this, and add a __has_feature test.

trailing-return-type codegen is not tested yet (name mangling in particular).

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

13 years agoRefactoring the security checker a little bit so that each CallExpr check doesn't...
Lenny Maiorani [Sun, 3 Apr 2011 05:07:11 +0000 (05:07 +0000)]
Refactoring the security checker a little bit so that each CallExpr check doesn't get called for each CallExpr. Instead it does a switch and only runs the check for the proper identifier. Slight speed improvement (probably significant on very large ASTs), and should make it easier and more clear to add more checks for other CallExpr's later.

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

13 years agostatic analyzer: Add a new ProgramPoint PostCondition to represent the post position...
Ted Kremenek [Sun, 3 Apr 2011 04:34:49 +0000 (04:34 +0000)]
static analyzer: Add a new ProgramPoint PostCondition to represent the post position of a branch condition, and a new generateNode method to BranchNodeBuilder using PostCondition ProgramPoint. This method generates a new ExplodedNode but not a new block edge.

Patch by Lei Zhang!

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

13 years agoFix RegionStore bug when doing a field load whose parent is also a field assigned...
Ted Kremenek [Sun, 3 Apr 2011 04:09:15 +0000 (04:09 +0000)]
Fix RegionStore bug when doing a field load whose parent is also a field assigned a LazyCompoundValue.  Fixes <rdar://problem/9163742> and PR 9522.

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

13 years agoMake -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a non-heade...
Nico Weber [Sat, 2 Apr 2011 19:45:15 +0000 (19:45 +0000)]
Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a non-header file.

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

13 years ago[analyzer] Simplify CheckerFn template and use it more to reduce duplication. No...
Argyrios Kyrtzidis [Sat, 2 Apr 2011 19:37:26 +0000 (19:37 +0000)]
[analyzer] Simplify CheckerFn template and use it more to reduce duplication. No functionality change.

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

13 years agoChange the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
Ken Dyck [Sat, 2 Apr 2011 17:52:22 +0000 (17:52 +0000)]
Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
CharUnits. No change in functionality intended.

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

13 years agoUse CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
Ken Dyck [Sat, 2 Apr 2011 17:13:02 +0000 (17:13 +0000)]
Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
change in functionality intended.

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

13 years agoUse CharUnits for the offset type in the ClassNamesAndOffsets map in
Ken Dyck [Sat, 2 Apr 2011 17:03:24 +0000 (17:03 +0000)]
Use CharUnits for the offset type in the ClassNamesAndOffsets map in
dumpLayout(). No change in functionality intended.

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

13 years agoUse CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. No
Ken Dyck [Sat, 2 Apr 2011 16:57:20 +0000 (16:57 +0000)]
Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. No
change in functionality intended.

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

13 years agoApply a bug-fix patch from Marcin Kowalczyk to the source locations for
Chandler Carruth [Sat, 2 Apr 2011 09:47:38 +0000 (09:47 +0000)]
Apply a bug-fix patch from Marcin Kowalczyk to the source locations for
a couple of operator overloads which form interesting expressions in the
AST.

I added test cases for both bugs with the c-index-test's token
annotation feature. Also, thanks to John McCall for confirming that this
is the correct solution.

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

13 years agoRemove a redundant method. We have a const version.
Zhongxing Xu [Sat, 2 Apr 2011 03:20:45 +0000 (03:20 +0000)]
Remove a redundant method. We have a const version.

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

13 years agoTeach IdempotentOperationsChecker about paths aborted because ExprEngine didn't know...
Ted Kremenek [Sat, 2 Apr 2011 02:56:23 +0000 (02:56 +0000)]
Teach IdempotentOperationsChecker about paths aborted because ExprEngine didn't know how to handle a specific Expr type.

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

13 years agostatic analyzer: Rename 'BlocksAborted' to 'BlocksExhausted' to reflect that a given...
Ted Kremenek [Sat, 2 Apr 2011 02:56:17 +0000 (02:56 +0000)]
static analyzer: Rename 'BlocksAborted' to 'BlocksExhausted' to reflect that a given CFGBlock was analyzed too many times.

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

13 years agoConvert BaseOffset::NonVirtualOffset to CharUnits. No change in
Ken Dyck [Sat, 2 Apr 2011 01:32:03 +0000 (01:32 +0000)]
Convert BaseOffset::NonVirtualOffset to CharUnits. No change in
functionality intended.

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

13 years agoConvert offset parameters and return values of VTableComponent methods to
Ken Dyck [Sat, 2 Apr 2011 01:14:48 +0000 (01:14 +0000)]
Convert offset parameters and return values of VTableComponent methods to
CharUnits. No change in functionality intended.

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

13 years agoConvert the offsets in VCallOffsetMap to CharUnits. No change in
Ken Dyck [Sat, 2 Apr 2011 00:51:15 +0000 (00:51 +0000)]
Convert the offsets in VCallOffsetMap to CharUnits. No change in
functionality intended.

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

13 years agoConvert offset parameters of VTableBuilder::IsOverriderUsed() to CharUnits.
Ken Dyck [Sat, 2 Apr 2011 00:44:58 +0000 (00:44 +0000)]
Convert offset parameters of VTableBuilder::IsOverriderUsed() to CharUnits.
No change in functionality intended.

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

13 years agoFixes a rewriter bug rewriting call to a byref
Fariborz Jahanian [Fri, 1 Apr 2011 23:08:13 +0000 (23:08 +0000)]
Fixes a rewriter bug rewriting call to a byref
block pointer nested inside a block. // rdar:// 9204669

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

13 years agoDriver/Darwin: Tweak simulator link logic a bit more to be closer to GCC.
Daniel Dunbar [Fri, 1 Apr 2011 21:02:42 +0000 (21:02 +0000)]
Driver/Darwin: Tweak simulator link logic a bit more to be closer to GCC.

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

13 years agoANother rewrite bug, rewriting a call of
Fariborz Jahanian [Fri, 1 Apr 2011 19:19:28 +0000 (19:19 +0000)]
ANother rewrite bug, rewriting a call of
__byref block. // rdar://9204669

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

13 years agoDo not try calculate the size of forward-declared template type array.
Devang Patel [Fri, 1 Apr 2011 19:02:33 +0000 (19:02 +0000)]
Do not try calculate the size of forward-declared template type array.

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

13 years agoDon't store reports when scan-build's build command matches /autogen/ (same as config...
Ted Kremenek [Fri, 1 Apr 2011 18:47:06 +0000 (18:47 +0000)]
Don't store reports when scan-build's build command matches /autogen/ (same as configure).

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

13 years agoFix an error in TreeTransform where we failed to copy the TemplateName's
Chandler Carruth [Fri, 1 Apr 2011 02:03:23 +0000 (02:03 +0000)]
Fix an error in TreeTransform where we failed to copy the TemplateName's
location into a TemplateSpecializationTypeLoc. These were found using
a hand-written program to inspect every source location in
TemplateSpecializationTypeLocs and Valgrind. I don't know of any way to
test them in Clang's existing test suite sadly.

Example code that triggers the ElaboratedType case:
  template <typename T> struct X1 {
    template <typename U> struct X1_1 {
      int x;
    };
  };

  template <typename T, typename U> struct X2 {
    typename X1<T>::template X1_1<U> B;
  };

  X2<char, int> x2;

The other fix was simply spotted by inspection. I audited all constructions of
[Dependent]TemplateSpecializationTypeLocs in TreeTransform.h, and the rest set
the TemplateNameLoc properly.

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

13 years agoIRgen: Reapply r128691 with a fix to ensure we don't increase alignment past
Daniel Dunbar [Fri, 1 Apr 2011 00:49:43 +0000 (00:49 +0000)]
IRgen: Reapply r128691 with a fix to ensure we don't increase alignment past
that of the array element type.

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

13 years agoRevert r128691, "IRgen: Improve GCC compatibility when dealing with packed
Daniel Dunbar [Fri, 1 Apr 2011 00:13:33 +0000 (00:13 +0000)]
Revert r128691, "IRgen: Improve GCC compatibility when dealing with packed
arrays by propagating", it's breaking test in ways I don't understand yet.

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

13 years agoIRgen: Improve GCC compatibility when dealing with packed arrays by propagating
Daniel Dunbar [Thu, 31 Mar 2011 23:32:15 +0000 (23:32 +0000)]
IRgen: Improve GCC compatibility when dealing with packed arrays by propagating
the array alignment to the array access.
 - This is more or less the best we can do without having alignment present in
   the type system, but is a long way from truly matching how GCC handles this.

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

13 years agoFix couple of rewriter bugs related to rewriting a
Fariborz Jahanian [Thu, 31 Mar 2011 22:49:32 +0000 (22:49 +0000)]
Fix couple of rewriter bugs related to rewriting a
__block block declaration. //rdar://9204669

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

13 years ago-Wuninitialized should not warn about variables captured by blocks as byref.
Ted Kremenek [Thu, 31 Mar 2011 22:32:41 +0000 (22:32 +0000)]
-Wuninitialized should not warn about variables captured by blocks as byref.

Note this can potentially be enhanced to detect if the __block variable
is actually written by the block, or only when the block "escapes" or
is actually used, but that requires more analysis than it is probably worth
for this simple check.

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

13 years agoAdd security syntax checker for strcpy() which causes the Static Analyzer to generate...
Lenny Maiorani [Thu, 31 Mar 2011 22:09:14 +0000 (22:09 +0000)]
Add security syntax checker for strcpy() which causes the Static Analyzer to generate a warning any time the strcpy() function is used with a note suggesting to use a function which provides bounded buffers.

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

13 years agoAdding Static Analyzer checker for mempcpy().
Lenny Maiorani [Thu, 31 Mar 2011 21:36:53 +0000 (21:36 +0000)]
Adding Static Analyzer checker for mempcpy().

Models mempcpy() so that if length is NULL the destination pointer is returned. Otherwise, the source and destination are confirmed not to be NULL and not overlapping. Finally the copy is validated to not cause a buffer overrun and the return value is bound to the address of the byte after the last byte copied.

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

13 years agoFix spelling in a comment. (test commit)
Lenny Maiorani [Thu, 31 Mar 2011 21:26:55 +0000 (21:26 +0000)]
Fix spelling in a comment. (test commit)

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

13 years agoMake ChainedIncludesSource an ExternalSemaSource, otherwise initialization of the...
Sebastian Redl [Thu, 31 Mar 2011 19:29:24 +0000 (19:29 +0000)]
Make ChainedIncludesSource an ExternalSemaSource, otherwise initialization of the ASTReader is incomplete, leading to errors like not realizing std::type_info is already defined.

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

13 years agoTell the diagnostic client about starting and ending source files when automatically...
Sebastian Redl [Thu, 31 Mar 2011 19:29:18 +0000 (19:29 +0000)]
Tell the diagnostic client about starting and ending source files when automatically creating chained PCHs. This way, we don't get a crash whenever a diagnostic is emitted while processing the include.

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

13 years agoDriver/Darwin: Tweak link logic for simulator.
Daniel Dunbar [Thu, 31 Mar 2011 17:12:33 +0000 (17:12 +0000)]
Driver/Darwin: Tweak link logic for simulator.

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

13 years agoWhoops.
John McCall [Thu, 31 Mar 2011 09:19:20 +0000 (09:19 +0000)]
Whoops.

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