]> granicus.if.org Git - clang/log
clang
13 years agoBasic/Diagnostics: Add an isDefaultMappingAsError method, and switch TextDiagnosticPr...
Daniel Dunbar [Thu, 29 Sep 2011 01:01:08 +0000 (01:01 +0000)]
Basic/Diagnostics: Add an isDefaultMappingAsError method, and switch TextDiagnosticPrinter to use that instead of extracting the current mapping via getDiagnosticLevel, which fixes one class of corner cases w.r.t. printing the "-Werror" diagnostic option marker.
 - The TextDiagnosticPrinter code is still fragile as it is just "reverse engineering" what the diagnostic engine is doing. Not my current priority to fix though.

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

13 years agoFix 80-col viola.
Daniel Dunbar [Thu, 29 Sep 2011 00:53:50 +0000 (00:53 +0000)]
Fix 80-col viola.

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

13 years agoAttempt to fix unit tests
Douglas Gregor [Thu, 29 Sep 2011 00:53:49 +0000 (00:53 +0000)]
Attempt to fix unit tests

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

13 years agoBasic/Diagnostic: Factor out
Daniel Dunbar [Thu, 29 Sep 2011 00:53:47 +0000 (00:53 +0000)]
Basic/Diagnostic: Factor out
DiagnosticsEngine::setDiagnosticGroup{ErrorAsFatal,WarningAsError} methods which
more accurately model the correct API -- no internal change to the diagnostics
engine yet though.
 - Also, stop honoring -Werror=everything (etc.) as a valid (but oddly behaved) option.

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

13 years agoIntroduce an opt-in warning when a module is being implicitly built
Douglas Gregor [Thu, 29 Sep 2011 00:52:27 +0000 (00:52 +0000)]
Introduce an opt-in warning when a module is being implicitly built
from sources.

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

13 years agoIntroduce a pure virtual clone() method to DiagnosticConsumer, so that
Douglas Gregor [Thu, 29 Sep 2011 00:38:00 +0000 (00:38 +0000)]
Introduce a pure virtual clone() method to DiagnosticConsumer, so that
we have the ability to create a new, distict diagnostic consumer when
we go off and build a module. This avoids the currently horribleness
where the same diagnostic consumer sees diagnostics for multiple
translation units (and multiple SourceManagers!) causing all sorts of havok.

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

13 years agoBasic/Diagnostics: Split out the default warning "no-Werror" and
Daniel Dunbar [Thu, 29 Sep 2011 00:34:06 +0000 (00:34 +0000)]
Basic/Diagnostics: Split out the default warning "no-Werror" and
"show-in-system-header" bits, which is part of teasing them apart from the
diagnostic mapping kind.

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

13 years agoChange "Regions" to be "LexicalBlocks" since that's what they
Eric Christopher [Thu, 29 Sep 2011 00:00:45 +0000 (00:00 +0000)]
Change "Regions" to be "LexicalBlocks" since that's what they
correspond to.

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

13 years agoRename EmitStopPoint in CGDebugInfo to EmitLocation. "stop points" don't
Eric Christopher [Thu, 29 Sep 2011 00:00:41 +0000 (00:00 +0000)]
Rename EmitStopPoint in CGDebugInfo to EmitLocation. "stop points" don't
exist anymore.

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

13 years agoReorder functions in the file.
Eric Christopher [Thu, 29 Sep 2011 00:00:37 +0000 (00:00 +0000)]
Reorder functions in the file.

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

13 years agoCall UpdateLineDirectiveRegion every time we want to emit a stop
Eric Christopher [Thu, 29 Sep 2011 00:00:35 +0000 (00:00 +0000)]
Call UpdateLineDirectiveRegion every time we want to emit a stop
point in the code. Ensures that we don't miss any places and the
check is reasonably cheap.

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

13 years agoUpdate comment.
Eric Christopher [Thu, 29 Sep 2011 00:00:31 +0000 (00:00 +0000)]
Update comment.

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

13 years ago[driver] Add basic support for escaping XML characters in CC_LOG_DIAGNOSTICS
Chad Rosier [Wed, 28 Sep 2011 23:05:07 +0000 (23:05 +0000)]
[driver] Add basic support for escaping XML characters in CC_LOG_DIAGNOSTICS
strings.
rdar://9696709

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

13 years agoobjc arc: Diagnose block pointer type mismatch when
Fariborz Jahanian [Wed, 28 Sep 2011 21:52:05 +0000 (21:52 +0000)]
objc arc: Diagnose block pointer type mismatch when
some arguments types are ns_consumed and some otherwise
matching types are not. This is objc side of
// rdar://10187884

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

13 years agoCheck for empty predecessors for walking them.
Ted Kremenek [Wed, 28 Sep 2011 21:20:00 +0000 (21:20 +0000)]
Check for empty predecessors for walking them.

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

13 years agoobjc++ arc: Diagnose block pointer type mismatch when
Fariborz Jahanian [Wed, 28 Sep 2011 20:22:05 +0000 (20:22 +0000)]
objc++ arc: Diagnose block pointer type mismatch when
some arguments types are ns_consumed and some otherwise
matching types are not. This fixes the objc++ side only *auch*.
// rdar://10187884

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

13 years agoFix typo. string-convervion -> string-conversion
Richard Trieu [Wed, 28 Sep 2011 20:13:42 +0000 (20:13 +0000)]
Fix typo.  string-convervion -> string-conversion

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

13 years agoTweak -Wobjc-missing-super-calls to not warning about missing [super dealloc] when...
Ted Kremenek [Wed, 28 Sep 2011 19:32:29 +0000 (19:32 +0000)]
Tweak -Wobjc-missing-super-calls to not warning about missing [super dealloc] when in GC-only mode, and to not warning about missing [super finalize] when not using GC.

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

13 years agoFor __weak/__strong/etc. ownership attributes, don't macro expand them in diagnostics.
Argyrios Kyrtzidis [Wed, 28 Sep 2011 18:35:06 +0000 (18:35 +0000)]
For __weak/__strong/etc. ownership attributes, don't macro expand them in diagnostics.

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

13 years agoFix a typo spotted by Jonathan Sauer.
Chandler Carruth [Wed, 28 Sep 2011 18:17:30 +0000 (18:17 +0000)]
Fix a typo spotted by Jonathan Sauer.

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

13 years agoIntroduce non-const Decl::getParentFunctionOrMethod.
Argyrios Kyrtzidis [Wed, 28 Sep 2011 18:14:24 +0000 (18:14 +0000)]
Introduce non-const Decl::getParentFunctionOrMethod.

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

13 years ago[libclang] Introduce clang_Range_isNull.
Argyrios Kyrtzidis [Wed, 28 Sep 2011 18:14:21 +0000 (18:14 +0000)]
[libclang] Introduce clang_Range_isNull.

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

13 years agoInstall c-index-test also on CMake build, following up r140681.
NAKAMURA Takumi [Wed, 28 Sep 2011 10:50:23 +0000 (10:50 +0000)]
Install c-index-test also on CMake build, following up r140681.

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

13 years agoAttempt to silence the GCC -Wreturn-type warning...
Chandler Carruth [Wed, 28 Sep 2011 10:49:06 +0000 (10:49 +0000)]
Attempt to silence the GCC -Wreturn-type warning...

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

13 years agoGenerate tests for all of the x86 SIMD instruction feature set
Chandler Carruth [Wed, 28 Sep 2011 10:36:46 +0000 (10:36 +0000)]
Generate tests for all of the x86 SIMD instruction feature set
predefines based on the output of GCC as well as the CPU predefines.

Invert tests for __AVX__, Clang's AVX feature is hard coded off still.

Switch Atom from 'SSE3' to 'SSSE3'. This matches GCC's behavior, Intel's
documentation, and ICC's documentation (such as I could dig up).

Switch Athlon and Geode to enable 3dnowa rather than just 3dnow and
nothing (resp.).

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

13 years agoAdd a little banner to this test. This lets my scripts more easily
Chandler Carruth [Wed, 28 Sep 2011 10:17:41 +0000 (10:17 +0000)]
Add a little banner to this test. This lets my scripts more easily
automate the process of updating and generating these tests.

If anyone is really interested, I can check my scripts for generating
this test in, but its a horrible pile of shell... Not sure its really
worth it.

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

13 years agoFix a think-o on my part that got enshrined in a FIXME by setting up the
Chandler Carruth [Wed, 28 Sep 2011 09:54:11 +0000 (09:54 +0000)]
Fix a think-o on my part that got enshrined in a FIXME by setting up the
__tune_...__ define as well.

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

13 years agoMove some of the defines down to more natural locations, consolidating
Chandler Carruth [Wed, 28 Sep 2011 09:54:07 +0000 (09:54 +0000)]
Move some of the defines down to more natural locations, consolidating
the target identifying macros at the top, including subtarget macros.

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

13 years agoTeach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
Chandler Carruth [Wed, 28 Sep 2011 09:45:08 +0000 (09:45 +0000)]
Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
Add 64-bit preprocessor macro tests.

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

13 years agoSimplify the control flow for predefined macro selection by using
Chandler Carruth [Wed, 28 Sep 2011 09:45:05 +0000 (09:45 +0000)]
Simplify the control flow for predefined macro selection by using
fallthrough now that we're working with a switch. Also remove a dubious
"feature" regarding k6 processors and 3dnow and leave a fixme... Not
that anyone is likely to care about correct tuning for k6 processors
with and w/o 3dnow...

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

13 years agoSwitch the X86TargetInfo object from a string representation of the
Chandler Carruth [Wed, 28 Sep 2011 08:55:37 +0000 (08:55 +0000)]
Switch the X86TargetInfo object from a string representation of the
selected CPU model to the enumeration. This parses the string
representation once using a StringSwitch on SetCPU. It returns an error
for strings which are not recognized (yay!). Finally it replaces
ridiculous if-chains with switches that cover all enumerators.

The last change required adding several missing entries to the features
function. These were obvious on inspection. Yay for a pattern that gives
warnings when we miss one.

No new test cases yet, as I want to get the 64-bit errors working first.
I'll then start fleshing out the testing more. Currently I'm primarily
testing on Linux, but I'm hoping check whether there are interesting
differences on darwin before long...

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

13 years agoIntroduce an enumeration for the x86 CPUs recognized by Clang. I've
Chandler Carruth [Wed, 28 Sep 2011 08:55:34 +0000 (08:55 +0000)]
Introduce an enumeration for the x86 CPUs recognized by Clang. I've
tried to give these nice doxyments, but if I've gotten any of my history
wrong, please chime in.

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

13 years agoClean up a bit of the uses of CPU in the TargetInfo classes. This makes
Chandler Carruth [Wed, 28 Sep 2011 05:56:05 +0000 (05:56 +0000)]
Clean up a bit of the uses of CPU in the TargetInfo classes. This makes
it an error if a CPU is provided for a target that doesn't implement
logic handling CPU settings, to match the ABI settings. It also removes
the CPU parameter from the getDefaultFeatures method. This parameter was
always filled in with the same value as setCPU was called with, and at
this point every single target implementation that referenced the CPU
within this function has needed to store the CPU via setCPU anyways in
order to implement other interface points.

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

13 years agoDriver: Fix two bad typos that were breaking the buildbots.
Benjamin Kramer [Wed, 28 Sep 2011 05:33:02 +0000 (05:33 +0000)]
Driver: Fix two bad typos that were breaking the buildbots.

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

13 years agoInstall c-index-test as part of install-clang-c Makefile rule.
Ted Kremenek [Wed, 28 Sep 2011 04:39:41 +0000 (04:39 +0000)]
Install c-index-test as part of install-clang-c Makefile rule.

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

13 years agoBegin fixing Clang's predefined macros for various architectures. This
Chandler Carruth [Wed, 28 Sep 2011 02:59:25 +0000 (02:59 +0000)]
Begin fixing Clang's predefined macros for various architectures. This
is *very* much a WIP that I'll be refining over the next several
commits, but I need to get this checkpoint in place for sanity.

This also adds a much more comprehensive test for architecture macros,
which is roughly generated by inspecting the behavior of a trunk build
of GCC. It still requires some massaging, but eventually I'll even check
in the script that generates these so that others can use it to append
more tests for more architectures, etc.

Next up is a bunch of simplification of the Targets.cpp code, followed
by a lot more test cases once we can reject invalid architectures.

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

13 years agoIntroduce Decl::getParentFunctionOrMethod which if the decl is defined inside
Argyrios Kyrtzidis [Wed, 28 Sep 2011 02:45:33 +0000 (02:45 +0000)]
Introduce Decl::getParentFunctionOrMethod which if the decl is defined inside
a function/method/block it returns the corresponding DeclContext, otherwise it returns null.

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

13 years ago[driver] If no OSX or iOS target has been specified and we're compiling for
Chad Rosier [Wed, 28 Sep 2011 00:46:32 +0000 (00:46 +0000)]
[driver] If no OSX or iOS target has been specified and we're compiling for
armv7, go ahead as assume we're targeting iOS.
rdar://10147774

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

13 years agoPR11002: Make sure we emit sentinel warnings with a valid source location. (Ideally...
Eli Friedman [Tue, 27 Sep 2011 23:46:37 +0000 (23:46 +0000)]
PR11002: Make sure we emit sentinel warnings with a valid source location.  (Ideally, we want to use the location returned by getLocForEndOfToken, but that is not always successful.)

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

13 years agoInclude prefix with default synthesized ivars.
Ted Kremenek [Tue, 27 Sep 2011 23:39:40 +0000 (23:39 +0000)]
Include prefix with default synthesized ivars.

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

13 years agoOnly print _Bool as 'bool' when 'bool' is defined as an object-like
Douglas Gregor [Tue, 27 Sep 2011 23:30:47 +0000 (23:30 +0000)]
Only print _Bool as 'bool' when 'bool' is defined as an object-like
macro whose only replacement token is '_Bool'.

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

13 years agoRemove the egregious hack that made Objective-C++ ARC work with older
Douglas Gregor [Tue, 27 Sep 2011 22:48:19 +0000 (22:48 +0000)]
Remove the egregious hack that made Objective-C++ ARC work with older
versions of libc++. Newer versions of libc++ know how to deal with ARC
properly. Fixes <rdar://problem/10062179>.

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

13 years agoWhen 'bool' is not a built-in type but is defined as a macro, print
Douglas Gregor [Tue, 27 Sep 2011 22:38:19 +0000 (22:38 +0000)]
When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.

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

13 years agoobjcetive-c-arc: When overriding a method, its ns_consumed patameter
Fariborz Jahanian [Tue, 27 Sep 2011 22:35:36 +0000 (22:35 +0000)]
objcetive-c-arc: When overriding a method, its ns_consumed patameter
attribute must match its overriden method. Same also for
ns_returns_retained/not_retained on the result type.
This is one half of // rdar://10187884

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

13 years agoFix a crash in MallocOverflowSecurityChecker. Patch by Lei Zhang.
Anna Zaks [Tue, 27 Sep 2011 22:25:01 +0000 (22:25 +0000)]
Fix a crash in MallocOverflowSecurityChecker. Patch by Lei Zhang.

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

13 years agoCheck for GCC paths that have the target triple in them. This is required for a...
David Chisnall [Tue, 27 Sep 2011 22:03:18 +0000 (22:03 +0000)]
Check for GCC paths that have the target triple in them.  This is required for a lot of cross-compile toolchains.  Also add some slightly better support for -B.

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

13 years agoGet rid of useless helper Sema::CastCategory.
Eli Friedman [Tue, 27 Sep 2011 21:58:52 +0000 (21:58 +0000)]
Get rid of useless helper Sema::CastCategory.

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

13 years agoIf you download clang and delete the test directory, you can end up
Douglas Gregor [Tue, 27 Sep 2011 21:28:10 +0000 (21:28 +0000)]
If you download clang and delete the test directory, you can end up
with the copy line failing with an error, yet the make will complete
successfully. From Greg Clayton!

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

13 years agode-tmpify clang.
Benjamin Kramer [Tue, 27 Sep 2011 21:06:10 +0000 (21:06 +0000)]
de-tmpify clang.

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

13 years ago[analyzer] Remove target triple from the malloc overflow test.
Anna Zaks [Tue, 27 Sep 2011 20:41:53 +0000 (20:41 +0000)]
[analyzer] Remove target triple from the malloc overflow test.

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

13 years agoSome changes to improve compatibility for MSVC-style C++ struct layout. Patch from...
Eli Friedman [Tue, 27 Sep 2011 19:12:27 +0000 (19:12 +0000)]
Some changes to improve compatibility for MSVC-style C++ struct layout. Patch from r4start at gmail.com (with some minor modifications by me).

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

13 years agoDocument the incompatibility that stems from Clang properly implement
Douglas Gregor [Tue, 27 Sep 2011 18:58:27 +0000 (18:58 +0000)]
Document the incompatibility that stems from Clang properly implement
the rule that defines the implicit copy constructor/implicit copy
asssignment operator as deleted when a move constructor or move
assignment operator has been explicitly declared. This has hit a
number of people because Boost 1.47.0's shared_ptr fails to declare a
copy constructor.

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

13 years agoMove test, so it actually tests what it is supposed to (given that we don't have...
Eli Friedman [Tue, 27 Sep 2011 18:55:06 +0000 (18:55 +0000)]
Move test, so it actually tests what it is supposed to (given that we don't have an AST verifier).

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

13 years agoFix examples for r140478. PR11021.
Eli Friedman [Tue, 27 Sep 2011 18:33:47 +0000 (18:33 +0000)]
Fix examples for r140478.  PR11021.

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

13 years ago[libclang] Expose array size and element type, patch by Vinay Sajip!
Argyrios Kyrtzidis [Tue, 27 Sep 2011 17:44:34 +0000 (17:44 +0000)]
[libclang] Expose array size and element type, patch by Vinay Sajip!

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

13 years agoConstant evaluation for pointer CXXScalarValueInitExpr
Peter Collingbourne [Tue, 27 Sep 2011 17:33:05 +0000 (17:33 +0000)]
Constant evaluation for pointer CXXScalarValueInitExpr

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

13 years agoIntroduce a callback to PPCallbacks for lines skipped by the preprocessor.
Argyrios Kyrtzidis [Tue, 27 Sep 2011 17:32:05 +0000 (17:32 +0000)]
Introduce a callback to PPCallbacks for lines skipped by the preprocessor.

Patch by Jason Haslam!

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

13 years agoBreak SourceManager::translateFileLineCol into translateFile, no functionality change.
Argyrios Kyrtzidis [Tue, 27 Sep 2011 17:22:25 +0000 (17:22 +0000)]
Break SourceManager::translateFileLineCol into translateFile, no functionality change.

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

13 years agoWhen parsing a character literal, extract the characters from the
Douglas Gregor [Tue, 27 Sep 2011 17:00:18 +0000 (17:00 +0000)]
When parsing a character literal, extract the characters from the
buffer as an 'unsigned char', so that integer promotion doesn't
sign-extend character values > 127 into oblivion. Fixes
<rdar://problem/10188919>.

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

13 years agoRevert r139989 and r140031, which implemented the Objective-C type
Douglas Gregor [Tue, 27 Sep 2011 16:10:05 +0000 (16:10 +0000)]
Revert r139989 and r140031, which implemented the Objective-C type
system change in <rdar://problem/10109725> that allows conversion from
'self' in class methods to the root of the class's hierarchy. This
conversion rule is a hack that has non-trivial repurcussions
(particularly with overload resolution).

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

13 years agoLet -B work for ld paths on Linux.
David Chisnall [Tue, 27 Sep 2011 13:31:58 +0000 (13:31 +0000)]
Let -B work for ld paths on Linux.

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

13 years agoRevert r140589. It was causing failures during llvm compilation:
Bill Wendling [Tue, 27 Sep 2011 10:09:33 +0000 (10:09 +0000)]
Revert r140589. It was causing failures during llvm compilation:

llvm[1]: Compiling CommandLine.cpp for Debug+Asserts build
if  /Users/void/llvm/llvm-opt.obj/Release+Asserts/bin/clang++ -I/Users/void/llvm/llvm.obj/include -I/Users/void/llvm/llvm.obj/lib/Support -I/Users/void/llvm/llvm.src/include -I/Users/void/llvm/llvm.src/lib/Support  -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual   -m64 -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d" /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp -o /Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o ; \
            then /bin/mv -f "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d"; else /bin/rm "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp"; exit 1; fi
In file included from /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp:25:
/Users/void/llvm/llvm.src/include/llvm/Support/system_error.h:690:14: error: unknown type name 'make_error_condition'; did you mean 'error_condition'?
    {*this = make_error_condition(_e);}
             ^~~~~~~~~~~~~~~~~~~~
             error_condition
...

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

13 years agoMSVC is stuck in the 80s.
Argyrios Kyrtzidis [Tue, 27 Sep 2011 04:14:36 +0000 (04:14 +0000)]
MSVC is stuck in the 80s.

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

13 years agoRenaming PathDiagnosticClients.h to PathDiagnosticConsumers.h (issue 5397)
David Blaikie [Tue, 27 Sep 2011 01:43:33 +0000 (01:43 +0000)]
Renaming PathDiagnosticClients.h to PathDiagnosticConsumers.h (issue 5397)

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

13 years agoPR11009: Fix a FIXME which was leading to an assertion failure with rvalue references.
Eli Friedman [Tue, 27 Sep 2011 01:11:35 +0000 (01:11 +0000)]
PR11009: Fix a FIXME which was leading to an assertion failure with rvalue references.

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

13 years agoAdd typo correction for the type name in C++ "new" statements
Kaelyn Uhrain [Tue, 27 Sep 2011 00:33:13 +0000 (00:33 +0000)]
Add typo correction for the type name in C++ "new" statements

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

13 years ago[libclang] Refactor the important stuff in clang_getCursor into a cxcursor::getCursor...
Argyrios Kyrtzidis [Tue, 27 Sep 2011 00:30:33 +0000 (00:30 +0000)]
[libclang] Refactor the important stuff in clang_getCursor into a cxcursor::getCursor(CXTranslationUnit, SourceLocation) function.

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

13 years ago[libclang] Introduce clang_Cursor_isNull and clang_Cursor_getTranslationUnit functions.
Argyrios Kyrtzidis [Tue, 27 Sep 2011 00:30:30 +0000 (00:30 +0000)]
[libclang] Introduce clang_Cursor_isNull and clang_Cursor_getTranslationUnit functions.

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

13 years agoobjc - don't complain about unimplemented property when conforming
Fariborz Jahanian [Tue, 27 Sep 2011 00:23:52 +0000 (00:23 +0000)]
objc - don't complain about unimplemented property when conforming
protocol declares the property, as well as one of its superclasses.
Property will be implemented in the super class. // rdar://10120691

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

13 years agoFix regression of -Warray-bounds involving varargs functions [PR 11007].
Ted Kremenek [Mon, 26 Sep 2011 23:36:13 +0000 (23:36 +0000)]
Fix regression of -Warray-bounds involving varargs functions [PR 11007].

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

13 years agoAdd a comment in ASTReader::ReadPragmaDiagnosticMappings that the user bit
Argyrios Kyrtzidis [Mon, 26 Sep 2011 23:06:41 +0000 (23:06 +0000)]
Add a comment in ASTReader::ReadPragmaDiagnosticMappings that the user bit
is set by the setDiagnosticMapping call.

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

13 years agoobjc - compare setter/property types using
Fariborz Jahanian [Mon, 26 Sep 2011 22:59:09 +0000 (22:59 +0000)]
objc - compare setter/property types using
hasSameUnqualifiedType in //rdar://10156674

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

13 years agoMove string literal to bool conversion into its own warning flag -Wstring-conversion.
Richard Trieu [Mon, 26 Sep 2011 22:38:21 +0000 (22:38 +0000)]
Move string literal to bool conversion into its own warning flag -Wstring-conversion.

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

13 years agoobjc - in matching setter argument type to its property type,
Fariborz Jahanian [Mon, 26 Sep 2011 22:12:27 +0000 (22:12 +0000)]
objc - in matching setter argument type to its property type,
ingore the type qualifiers. // rdar://10156674

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

13 years agoobjc-arc: mark functions which return types which can't be dealt with
Fariborz Jahanian [Mon, 26 Sep 2011 21:23:35 +0000 (21:23 +0000)]
objc-arc: mark functions which return types which can't be dealt with
in arc mode and are in system headers as unavailable.
// rdar://10186625

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

13 years agoMake necessary changes in AddMIPSTargetArgs for targeting Mips64. Enable use of
Akira Hatanaka [Mon, 26 Sep 2011 21:07:52 +0000 (21:07 +0000)]
Make necessary changes in AddMIPSTargetArgs for targeting Mips64. Enable use of
-mcpu.

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

13 years agoCheckStringInit has side effects; make sure we don't run it in VerifyOnly mode, at...
Eli Friedman [Mon, 26 Sep 2011 19:09:09 +0000 (19:09 +0000)]
CheckStringInit has side effects; make sure we don't run it in VerifyOnly mode, at least for the moment.  <rdar://problem/10185490>.

Sebastian, please take a look at this; I'm not entirely sure it is the right thing to do.

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

13 years ago[libclang] Report implicit objc methods for properties when indexing.
Argyrios Kyrtzidis [Mon, 26 Sep 2011 19:05:37 +0000 (19:05 +0000)]
[libclang] Report implicit objc methods for properties when indexing.

Related to rdar://10087069.

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

13 years agoFix a typo in the new VerifyOnly handling in SemaInit. No visible difference at...
Eli Friedman [Mon, 26 Sep 2011 18:53:43 +0000 (18:53 +0000)]
Fix a typo in the new VerifyOnly handling in SemaInit.  No visible difference at the moment, as far as I can tell.

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

13 years agoAdd a small note to BaseSubobject about where it is actually used.
Eli Friedman [Mon, 26 Sep 2011 18:36:39 +0000 (18:36 +0000)]
Add a small note to BaseSubobject about where it is actually used.

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

13 years agoFix assertion hit when @encoding C++ classes. rdar://10172840 & http://llvm.org/PR10990
Argyrios Kyrtzidis [Mon, 26 Sep 2011 18:14:24 +0000 (18:14 +0000)]
Fix assertion hit when @encoding C++ classes. rdar://10172840 & http://llvm.org/PR10990

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

13 years agoAdd back support for a manually formatted section of the diagnostic
Chandler Carruth [Mon, 26 Sep 2011 16:43:25 +0000 (16:43 +0000)]
Add back support for a manually formatted section of the diagnostic
message. Specifically, we now only line-wrap the first line of te
diagnostic message and assume the remainder is manually formatted. While
adding it back, simplify the logic for doing this.

Finally, add a test that ensures we actually preserve this feature. =D
*Now* its not dead code. Thanks to Doug for the test case.

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

13 years agoUpdate comments.
Eric Christopher [Mon, 26 Sep 2011 15:03:22 +0000 (15:03 +0000)]
Update comments.

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

13 years agoFix comment to reflect reality.
Eric Christopher [Mon, 26 Sep 2011 15:03:19 +0000 (15:03 +0000)]
Fix comment to reflect reality.

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

13 years agoRe-arrange and bitfieldify data members of CXXConstructExpr to save a
Douglas Gregor [Mon, 26 Sep 2011 14:47:03 +0000 (14:47 +0000)]
Re-arrange and bitfieldify data members of CXXConstructExpr to save a
little storage.

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

13 years agoDiagnose attempts to use 'using typename' with a non-identifier name,
Douglas Gregor [Mon, 26 Sep 2011 14:30:28 +0000 (14:30 +0000)]
Diagnose attempts to use 'using typename' with a non-identifier name,
from Stepan Dyatkovskiy. Fixes PR10925.

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

13 years agoHoist and beef up the asserts about the level of infrastructure expected
Chandler Carruth [Mon, 26 Sep 2011 11:38:46 +0000 (11:38 +0000)]
Hoist and beef up the asserts about the level of infrastructure expected
when working with a diagnostic attached to a source location. Also
comment more thoroughly why its important to handle non-location
diagnostic messages separately.

Finally, hoist the creation of the TextDiagnostic object up to the
beginning of the location-based diagnostics. This paves the way for
sinking more and more of the logic into this class. When everything
below this constructor is sunk into the TextDiagnostic class it should
be sufficiently "feature complete" to accomplish my two goals:
1) Have the printing of a macro expansion note use the exact same code
   as any other note.
2) Be able to implement clang_formatDiagnostic in terms of this class.

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

13 years agoSwitch the emission of diagnostics without a source location to
Chandler Carruth [Mon, 26 Sep 2011 11:25:30 +0000 (11:25 +0000)]
Switch the emission of diagnostics without a source location to
a dedicated path. The logic for such diagnostics is much simpler than
for others.

This begins to make an important separation in this routine. We expect
most (and most interesting) textual diagnostics to be made in the
presence of at least *some* source locations and a source manager.
However the DiagnosticConsumer must be prepared to diagnose errors even
when the source manager doesn't (yet) exist or when there is no location
information at all. In order to sink more and more logic into the
TextDiagnostic class while minimizing its complexity, my plan is to
force the DiagnosticConsumer to special case diagnosing any locationless
messages and then hand the rest to the TextDiagnostic class. I'd
appreciate any comments on this design. It requires a bit of code
duplication in order to keep interfaces simple. Alternatively, if we
really need TextDiagnostic to be capable of handling diagnostics even in
the absence of a viable SourceManager, then this split isn't necessary.

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

13 years agoExtract the actual printing of the message string into a helper
Chandler Carruth [Mon, 26 Sep 2011 11:19:35 +0000 (11:19 +0000)]
Extract the actual printing of the message string into a helper
function. Doing this conveniently requires moving the word wrapping to
use a StringRef which seems generally an improvement. There is a lot
that could be simplified in the word wrapping by using StringRef that
I haven't looked at yet...

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

13 years agoGroup the helpers for word wrapping with the primary routine. No
Chandler Carruth [Mon, 26 Sep 2011 10:58:00 +0000 (10:58 +0000)]
Group the helpers for word wrapping with the primary routine. No
functionality changed.

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

13 years agoAdd a test for the display of diagnostic options and categories. This
Chandler Carruth [Mon, 26 Sep 2011 10:42:40 +0000 (10:42 +0000)]
Add a test for the display of diagnostic options and categories. This
would have caught a bug I introduced during refactoring. Silly me
thinking this was all well tested already...

If any of this is already covered by other tests, let me know. I looked
around and didn't see any.

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

13 years agoAssociate the macro arguments location map with a FileID instead
Argyrios Kyrtzidis [Mon, 26 Sep 2011 08:01:50 +0000 (08:01 +0000)]
Associate the macro arguments location map with a FileID instead
of a ContentCache, since multiple FileIDs can have the same ContentCache
but the expanded macro arguments locations will be different.

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

13 years agoRemove SourceManager::getLocation().
Argyrios Kyrtzidis [Mon, 26 Sep 2011 08:01:45 +0000 (08:01 +0000)]
Remove SourceManager::getLocation().

It's not descriptive enough and it's just a call of translateFileLineCol()
followed by a call to getMacroArgExpandedLocation(), which is better to be
called explicitly since it has a certain cost and is not always required.

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

13 years agoDon't map a file:line:col triplet that is inside the preamble range to
Argyrios Kyrtzidis [Mon, 26 Sep 2011 08:01:41 +0000 (08:01 +0000)]
Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble.

Instead, handle specially locations of preprocessed entities:
-When looking up for preprocessed entities, map main file locations inside the
 preamble range to a preamble loaded location.
-When getting the source range of a preprocessing cursor, map preamble loaded
 locations back to main file locations.

Fixes rdar://10175093 & http://llvm.org/PR10999

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

13 years agoProperly initialize Preprocessor::CurLexerKind to avoid use of uninitialized variable.
Zhongxing Xu [Mon, 26 Sep 2011 03:37:43 +0000 (03:37 +0000)]
Properly initialize Preprocessor::CurLexerKind to avoid use of uninitialized variable.

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

13 years agoTurns out we tested for this typo.
Benjamin Kramer [Mon, 26 Sep 2011 02:32:23 +0000 (02:32 +0000)]
Turns out we tested for this typo.

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

13 years agoAdd missing spaces in diagnostic messages.
Benjamin Kramer [Mon, 26 Sep 2011 02:14:16 +0000 (02:14 +0000)]
Add missing spaces in diagnostic messages.

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

13 years agoDon't print a stray ] at the end of diagnostics.
Benjamin Kramer [Mon, 26 Sep 2011 02:14:13 +0000 (02:14 +0000)]
Don't print a stray ] at the end of diagnostics.

Also remove an obsolete utostr call.

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

13 years agoMove VTable builder to AST
Peter Collingbourne [Mon, 26 Sep 2011 01:57:12 +0000 (01:57 +0000)]
Move VTable builder to AST

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

13 years agoHave CodeGenVTables::GenerateConstructionVTable use VTableLayout
Peter Collingbourne [Mon, 26 Sep 2011 01:57:04 +0000 (01:57 +0000)]
Have CodeGenVTables::GenerateConstructionVTable use VTableLayout

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