]> granicus.if.org Git - clang/log
clang
13 years agoCorrectly store and keep track of the FileSystemOptions in ASTUnit and in clang_codeC...
Anders Carlsson [Fri, 18 Mar 2011 18:22:40 +0000 (18:22 +0000)]
Correctly store and keep track of the FileSystemOptions in ASTUnit and in clang_codeCompleteAt.

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

13 years agoAdd an opt-in -Wheader-hygiene, which current diagnoses the use of
Douglas Gregor [Fri, 18 Mar 2011 16:10:52 +0000 (16:10 +0000)]
Add an opt-in -Wheader-hygiene, which current diagnoses the use of
global using directives in C++ headers, from Elliot Glaysher!

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

13 years agoOn !Darwin, do use the integrated as with -static.
Rafael Espindola [Fri, 18 Mar 2011 15:50:12 +0000 (15:50 +0000)]
On !Darwin, do use the integrated as with -static.

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

13 years agoDefined friend functions are *implicitly* inlined, unless the inline specifier occurs...
Abramo Bagnara [Fri, 18 Mar 2011 15:21:59 +0000 (15:21 +0000)]
Defined friend functions are *implicitly* inlined, unless the inline specifier occurs explicitly.

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

13 years agoFixed inconsistency when adding TemplateParameterListsInfo.
Abramo Bagnara [Fri, 18 Mar 2011 15:16:37 +0000 (15:16 +0000)]
Fixed inconsistency when adding TemplateParameterListsInfo.

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

13 years agotest/CodeGenCXX/apple-kext-guard-variable.cpp: May I appease non-darwin hosts?
NAKAMURA Takumi [Fri, 18 Mar 2011 04:46:08 +0000 (04:46 +0000)]
test/CodeGenCXX/apple-kext-guard-variable.cpp: May I appease non-darwin hosts?

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

13 years agoImprove the documentation for some of the analyzer attributes I added
John McCall [Fri, 18 Mar 2011 03:51:49 +0000 (03:51 +0000)]
Improve the documentation for some of the analyzer attributes I added
a while back.

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

13 years agoConstruct 'Sema' object on the stack, so that crash recovery can recovery it's associ...
Ted Kremenek [Fri, 18 Mar 2011 03:44:21 +0000 (03:44 +0000)]
Construct 'Sema' object on the stack, so that crash recovery can recovery it's associated resources without walking over dead stack space.

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

13 years agowww/hacking.html: Add blurb of LLVM_LIT_TOOLS_DIR.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:44 +0000 (03:21 +0000)]
www/hacking.html: Add blurb of LLVM_LIT_TOOLS_DIR.

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

13 years agowww/hacking.html: Cosmetic change, to detabify, eliminate whitespace, and add proper...
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:38 +0000 (03:21 +0000)]
www/hacking.html: Cosmetic change, to detabify, eliminate whitespace, and add proper slashes to URL.

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

13 years agotest/Driver/sysroot-flags.c: Tweak for Mingw MSYS bash.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:33 +0000 (03:21 +0000)]
test/Driver/sysroot-flags.c: Tweak for Mingw MSYS bash.

MSYS substitutes path (that begins with "/") to de-mounted Windows path, even if it were nonexistent.
"/foo/bar" might be substituted to "C:/msysgit/foo/bar".

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

13 years agotest/Driver/darwin-cc.c: FileCheck-ize and tweak for Mingw MSYS bash.
NAKAMURA Takumi [Fri, 18 Mar 2011 03:21:26 +0000 (03:21 +0000)]
test/Driver/darwin-cc.c: FileCheck-ize and tweak for Mingw MSYS bash.

MSYS substitutes path (that begins with "/") to de-mounted Windows path.
"/tmp" might be substituted as "C:/DOCUME~1/chapuni/LOCALS~1/Temp".

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

13 years agoThe Darwin kernel does not provide useful guard variable support.
John McCall [Fri, 18 Mar 2011 02:56:14 +0000 (02:56 +0000)]
The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error;  it's not really worthwhile doing this
"right", i.e. in Sema, because IR gen knows a lot of tricks beyond
what the constant evaluator knows.

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

13 years agoUse CrashRecoveryContextCleanup objects to recover an ASTUnit if we crash in ASTUnit...
Ted Kremenek [Fri, 18 Mar 2011 02:06:56 +0000 (02:06 +0000)]
Use CrashRecoveryContextCleanup objects to recover an ASTUnit if we crash in ASTUnit::LoadFromCommandLine() and ASTUnit::LoadFromCompilerInvocation().

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

13 years agoUse CrashRecoveryContextCleanup objects to release resources associated with Sema...
Ted Kremenek [Fri, 18 Mar 2011 02:06:53 +0000 (02:06 +0000)]
Use CrashRecoveryContextCleanup objects to release resources associated with Sema during a crash while parsing.

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

13 years agoConvert alignment values to CharUnits. No change in functionality intended.
Ken Dyck [Fri, 18 Mar 2011 01:26:17 +0000 (01:26 +0000)]
Convert alignment values to CharUnits. No change in functionality intended.

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

13 years agoConvert getSizeInBytes() to getSizeInChars(), which returns its result in
Ken Dyck [Fri, 18 Mar 2011 01:12:13 +0000 (01:12 +0000)]
Convert getSizeInBytes() to getSizeInChars(), which returns its result in
CharUnits. No change in functionality intended.

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

13 years agoConvert variables to CharUnits in ConvertStructToPacked(). No change in
Ken Dyck [Fri, 18 Mar 2011 00:55:06 +0000 (00:55 +0000)]
Convert variables to CharUnits in ConvertStructToPacked(). No change in
functionality intended.

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

13 years agoDriver/Obj-C: Be compatible with GCC behavior in that -fno-exceptions *does not*
Daniel Dunbar [Thu, 17 Mar 2011 23:28:31 +0000 (23:28 +0000)]
Driver/Obj-C: Be compatible with GCC behavior in that -fno-exceptions *does not*
disable Obj-C exceptions.

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

13 years agoFix some issues with include directories: remove a duplicate and put
Oscar Fuentes [Thu, 17 Mar 2011 19:03:04 +0000 (19:03 +0000)]
Fix some issues with include directories: remove a duplicate and put
Clang binary and source directories first (on that order).

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

13 years agoDriver/Darwin: These are command line options, not target features.
Daniel Dunbar [Thu, 17 Mar 2011 18:29:04 +0000 (18:29 +0000)]
Driver/Darwin: These are command line options, not target features.

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

13 years agoDriver/Darwin: Suppress spurious warning about -force_cpusubtype_ALL.
Daniel Dunbar [Thu, 17 Mar 2011 17:37:29 +0000 (17:37 +0000)]
Driver/Darwin: Suppress spurious warning about -force_cpusubtype_ALL.

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

13 years agoDriver/Darwin/ARM: Kernel/kext code has more strict alignment requirements.
Daniel Dunbar [Thu, 17 Mar 2011 17:10:06 +0000 (17:10 +0000)]
Driver/Darwin/ARM: Kernel/kext code has more strict alignment requirements.

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

13 years agoFix PR9488: 'auto' type substitution can fail (for instance, if it creates a referenc...
Richard Smith [Thu, 17 Mar 2011 16:11:59 +0000 (16:11 +0000)]
Fix PR9488: 'auto' type substitution can fail (for instance, if it creates a reference-to-void type). Don't crash if it does.
Also fix an issue where type source information for the resulting type was being lost.

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

13 years agoRemove code that was intentionally generating bad code on the GNU runtime for no...
David Chisnall [Thu, 17 Mar 2011 14:19:08 +0000 (14:19 +0000)]
Remove code that was intentionally generating bad code on the GNU runtime for no reason (failing to emit .cxx_constructor / .cxx_destructor methods).

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

13 years agoFix test to test the right thing.
Ted Kremenek [Thu, 17 Mar 2011 05:34:58 +0000 (05:34 +0000)]
Fix test to test the right thing.

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

13 years agoDon't construct two CFGs just to run -Wuninitialized. While this causes new warnings...
Ted Kremenek [Thu, 17 Mar 2011 05:29:57 +0000 (05:29 +0000)]
Don't construct two CFGs just to run -Wuninitialized.  While this causes new warnings to be flagged under -Wconditional-uninitialized, this is something we
can improve over time.

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

13 years agoMake test more portable.
Ted Kremenek [Thu, 17 Mar 2011 04:16:45 +0000 (04:16 +0000)]
Make test more portable.

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

13 years agoTeach VariadicMethodTypeChecker about pointers attributed as 'NSObject'.
Ted Kremenek [Thu, 17 Mar 2011 04:10:25 +0000 (04:10 +0000)]
Teach VariadicMethodTypeChecker about pointers attributed as 'NSObject'.

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

13 years agoTeach VariadicMethodTypeChecker that CF references are valid arguments to variadic...
Ted Kremenek [Thu, 17 Mar 2011 04:01:35 +0000 (04:01 +0000)]
Teach VariadicMethodTypeChecker that CF references are valid arguments to variadic Objective-C methods.

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

13 years agoTweak RegionStore's handling of lazy compound values to use the 'Default' versus...
Ted Kremenek [Thu, 17 Mar 2011 03:51:51 +0000 (03:51 +0000)]
Tweak RegionStore's handling of lazy compound values to use the 'Default' versus 'Direct' binding key, thus allowing specific elements of an array/struct to be overwritten without
invalidating the entire binding.  Fixes PR 9455.

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

13 years agoExtend -Wuninitialized to support vector types.
Ted Kremenek [Thu, 17 Mar 2011 03:06:11 +0000 (03:06 +0000)]
Extend -Wuninitialized to support vector types.

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

13 years agoRename -Wuninitialized-maybe to -Wconditional-uninitialized.
Ted Kremenek [Thu, 17 Mar 2011 03:06:07 +0000 (03:06 +0000)]
Rename -Wuninitialized-maybe to -Wconditional-uninitialized.

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

13 years agoConvert NextOffsetInBytes to CharUnits and rename to NextOffsetInChars. No
Ken Dyck [Thu, 17 Mar 2011 01:33:18 +0000 (01:33 +0000)]
Convert NextOffsetInBytes to CharUnits and rename to NextOffsetInChars. No
change in functionality intended.

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

13 years agoPolitely inform GCC that we will never fall off the end of that switch.
Matt Beaumont-Gay [Thu, 17 Mar 2011 00:46:34 +0000 (00:46 +0000)]
Politely inform GCC that we will never fall off the end of that switch.

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

13 years agoDriver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this
Daniel Dunbar [Thu, 17 Mar 2011 00:07:34 +0000 (00:07 +0000)]
Driver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this
not being consistent at all with other parts of the GCC implementation.

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

13 years agoWhen libclang visits a translation unit via clang_visitChildren(),
Douglas Gregor [Wed, 16 Mar 2011 23:23:30 +0000 (23:23 +0000)]
When libclang visits a translation unit via clang_visitChildren(),
walk the preprocessing record *before* walking the declarations, so
they we pretend that we actually respect the phases of translation.

We still walk the preprocessing record after the declarations when
performing token annotation or finding the cursor at a location, since
those routines depend on those semantics.

Fixes <rdar://problem/9137195>.

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

13 years agoUse C as fallback type if in C preprocessor mode.
Joerg Sonnenberger [Wed, 16 Mar 2011 22:45:02 +0000 (22:45 +0000)]
Use C as fallback type if in C preprocessor mode.

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

13 years agoPR9494: Get rid of bitcast which was both unnecessary and written incorrectly.
Eli Friedman [Wed, 16 Mar 2011 22:34:09 +0000 (22:34 +0000)]
PR9494: Get rid of bitcast which was both unnecessary and written incorrectly.

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

13 years agoCompress argument processing in ccc-analyzer. No functionality change.
Ted Kremenek [Wed, 16 Mar 2011 21:10:42 +0000 (21:10 +0000)]
Compress argument processing in ccc-analyzer.  No functionality change.

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

13 years agoUse ElaboratedType also for C.
Abramo Bagnara [Wed, 16 Mar 2011 20:16:18 +0000 (20:16 +0000)]
Use ElaboratedType also for C.

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

13 years agoRefactor program name logic. Extend it to infer the target triple from
Joerg Sonnenberger [Wed, 16 Mar 2011 20:15:43 +0000 (20:15 +0000)]
Refactor program name logic. Extend it to infer the target triple from
the program name, if it includes it as proper prefix. This makes calling
clang with -ccc-host-triple x86_64-linux the same as calling it with the
name x86_64-linux-clang.

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

13 years agoDetect attempts to provide a specialization of a function within a
Douglas Gregor [Wed, 16 Mar 2011 19:27:09 +0000 (19:27 +0000)]
Detect attempts to provide a specialization of a function within a
dependent scope and produce an error (rather than crashing). Fixes PR8979.

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

13 years agoHaving FileManager::getFile always open the file, brought much consternation and...
Argyrios Kyrtzidis [Wed, 16 Mar 2011 19:17:25 +0000 (19:17 +0000)]
Having FileManager::getFile always open the file, brought much consternation and leaking of file descriptors.

Add 'openFile' bool to FileManager::getFile to specify whether we want to have the file opened or not, have it
false by default, and enable it only in HeaderSearch.cpp where the open+fstat optimization matters.

Fixes rdar://9139899.

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

13 years agoClean up our handling of template-ids that resolve down to a single
Douglas Gregor [Wed, 16 Mar 2011 19:16:25 +0000 (19:16 +0000)]
Clean up our handling of template-ids that resolve down to a single
overload, so that we actually do the resolution for full expressions
and emit more consistent, useful diagnostics. Also fixes an IRGen
crasher, where Sema wouldn't diagnose a resolvable bound member
function template-id used in a full-expression (<rdar://problem/9108698>).

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

13 years agoFix duplicate argument processing
Sandeep Patel [Wed, 16 Mar 2011 19:14:34 +0000 (19:14 +0000)]
Fix duplicate argument processing

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

13 years agoSupport for printing/dumping static asserts
Peter Collingbourne [Wed, 16 Mar 2011 18:37:27 +0000 (18:37 +0000)]
Support for printing/dumping static asserts

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

13 years agoRemove a duplicate language feature
Peter Collingbourne [Wed, 16 Mar 2011 18:35:34 +0000 (18:35 +0000)]
Remove a duplicate language feature

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

13 years agoAdd a 'RawPath' parameter to the PPCallbacks interface. This allows
Chandler Carruth [Wed, 16 Mar 2011 18:34:36 +0000 (18:34 +0000)]
Add a 'RawPath' parameter to the PPCallbacks interface. This allows
clients to observe the exact path through which an #included file was
located. This is very useful when trying to record and replay inclusion
operations without it beind influenced by the aggressive caching done
inside the FileManager to avoid redundant system calls and filesystem
operations.

The work to compute and return this is only done in the presence of
callbacks, so it should have no effect on normal compilation.

Patch by Manuel Klimek.

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

13 years agoDon't indescriminately print overload candidates when we have invalid
Douglas Gregor [Wed, 16 Mar 2011 18:21:05 +0000 (18:21 +0000)]
Don't indescriminately print overload candidates when we have invalid
operands to a binary expression; it doesn't make sense in all
contexts. The right answer would be to see if the user forgot at ().

Fixes <rdar://problem/9136502>.

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

13 years agoAllow function calls to dereferenced member pointers of
Douglas Gregor [Wed, 16 Mar 2011 17:42:23 +0000 (17:42 +0000)]
Allow function calls to dereferenced member pointers of
pointer-to-function type. Fixes <rdar://problem/9065289>.

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

13 years agoMake sure that we always pop a function's scope *before* we call
Douglas Gregor [Wed, 16 Mar 2011 17:05:57 +0000 (17:05 +0000)]
Make sure that we always pop a function's scope *before* we call
ActOnFinishFunctionBody/ActOnBlockStmtExpr. This way, we ensure that
we diagnose undefined labels before the jump-scope checker gets run,
since the jump-scope checker requires (as its invariant) that all of
the GotoStmts be wired up correctly.

Fixes PR9495.

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

13 years agoWhen we're inserting a synthesized label declaration for a
Douglas Gregor [Wed, 16 Mar 2011 16:39:03 +0000 (16:39 +0000)]
When we're inserting a synthesized label declaration for a
forward-looking "goto" statement, make sure to insert it *after* the
last declaration in the identifier resolver's declaration chain that
is either outside of the function/block/method's scope or that is
declared in that function/block/method's specific scope. Previously,
we could end up inserting the label ahead of declarations in inner
scopes, confusing C++ name lookup.

Fixes PR9491/<rdar://problem/9140426> and <rdar://problem/9135994>.

Note that the crash-on-invalid PR9495 is *not* fixed. That's a
separate issue.

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

13 years agoFix foreign exception handling (GNU runtime).
David Chisnall [Wed, 16 Mar 2011 15:44:28 +0000 (15:44 +0000)]
Fix foreign exception handling (GNU runtime).

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

13 years agoAdded missing methods to get Designators source range.
Abramo Bagnara [Wed, 16 Mar 2011 15:08:46 +0000 (15:08 +0000)]
Added missing methods to get Designators source range.

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

13 years agotest/Driver/hello.c: Tweak for cygming.
NAKAMURA Takumi [Wed, 16 Mar 2011 13:51:46 +0000 (13:51 +0000)]
test/Driver/hello.c: Tweak for cygming.

  - Driver's name may be "clang(-\d.\d).exe".
  - Emitted executable file is named as "%t.exe". It must be harmless on other OS.

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

13 years agoTeach CFGBuilder that the 'default' branch of a switch statement is dead if all enum...
Ted Kremenek [Wed, 16 Mar 2011 04:32:01 +0000 (04:32 +0000)]
Teach CFGBuilder that the 'default' branch of a switch statement is dead if all enum values in a switch conditioned are handled.

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

13 years agoDon't emit read barriers for reading __weak __block variables
John McCall [Wed, 16 Mar 2011 02:53:38 +0000 (02:53 +0000)]
Don't emit read barriers for reading __weak __block variables
in non-GC mode.

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

13 years agoVariadicMethodTypeChecker: don't warn for null pointer constants passed to variadic...
Ted Kremenek [Wed, 16 Mar 2011 00:22:51 +0000 (00:22 +0000)]
VariadicMethodTypeChecker: don't warn for null pointer constants passed to variadic Objective-C methods.

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

13 years agoc-index-test shouldn't crash when a goto has no matching label. Fixes <rdar://proble...
Ted Kremenek [Tue, 15 Mar 2011 23:47:49 +0000 (23:47 +0000)]
c-index-test shouldn't crash when a goto has no matching label.  Fixes <rdar://problem/9123493>.

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

13 years agoRemove warning for null characters in CFString literals. Clang handles them just...
Ted Kremenek [Tue, 15 Mar 2011 21:18:52 +0000 (21:18 +0000)]
Remove warning for null characters in CFString literals.  Clang handles them just fine, and GCC 4.2 doesn't warn here either.

We added this warning back in 2007 when we were comparing against GCC 4.0.

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

13 years agoDon't warn about null characters in Objective-C format string literals.
Ted Kremenek [Tue, 15 Mar 2011 21:18:48 +0000 (21:18 +0000)]
Don't warn about null characters in Objective-C format string literals.

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

13 years agoReorganize the emission of (unfoldable) constant casts a bit, and
John McCall [Tue, 15 Mar 2011 21:17:48 +0000 (21:17 +0000)]
Reorganize the emission of (unfoldable) constant casts a bit, and
make sure that upcasts of member pointer types are covered as constants.
Fixed rdar://problem/9130221

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

13 years agoCreate __has_feature(cxx_noexcept) and mark it as working.
Sebastian Redl [Tue, 15 Mar 2011 21:17:12 +0000 (21:17 +0000)]
Create __has_feature(cxx_noexcept) and mark it as working.
Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented.
This completes noexcept specification work.

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

13 years agoFix test case.
Sebastian Redl [Tue, 15 Mar 2011 21:15:06 +0000 (21:15 +0000)]
Fix test case.

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

13 years agoExtend the noexcept expression test to test noexcept specification functions.
Sebastian Redl [Tue, 15 Mar 2011 20:45:42 +0000 (20:45 +0000)]
Extend the noexcept expression test to test noexcept specification functions.

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

13 years agoMore robust check for the special C++0x operator new workaround.
Sebastian Redl [Tue, 15 Mar 2011 20:41:09 +0000 (20:41 +0000)]
More robust check for the special C++0x operator new workaround.

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

13 years agoImplement a hack to work around the changing exception specification of operator...
Sebastian Redl [Tue, 15 Mar 2011 19:52:30 +0000 (19:52 +0000)]
Implement a hack to work around the changing exception specification of operator new in C++0x.

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

13 years agoRemove bogus assertion in IdempotentOperationsChecker.
Ted Kremenek [Tue, 15 Mar 2011 19:27:57 +0000 (19:27 +0000)]
Remove bogus assertion in IdempotentOperationsChecker.

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

13 years agoReintroduce r127617: "Code generation for noexcept." with fixes.
Sebastian Redl [Tue, 15 Mar 2011 18:42:48 +0000 (18:42 +0000)]
Reintroduce r127617: "Code generation for noexcept." with fixes.

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

13 years agoDon't poke into redefined 'id' type looking for a property
Fariborz Jahanian [Tue, 15 Mar 2011 17:27:48 +0000 (17:27 +0000)]
Don't poke into redefined 'id' type looking for a property
declaration as this results in a confusing error message,
instead of message related to missing property declaration.
// rdar://9106929

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

13 years agoAppease GCC. I'm surprised Clang accepted this.
Ted Kremenek [Tue, 15 Mar 2011 05:30:12 +0000 (05:30 +0000)]
Appease GCC.  I'm surprised Clang accepted this.

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

13 years agoRemove duplicate group definition that snuck in due to a merge conflict.
Ted Kremenek [Tue, 15 Mar 2011 05:25:02 +0000 (05:25 +0000)]
Remove duplicate group definition that snuck in due to a merge conflict.

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

13 years agoTake 2: merge -Wuninitialized-experimental into -Wuninitialized. Only *must-be-unini...
Ted Kremenek [Tue, 15 Mar 2011 05:22:33 +0000 (05:22 +0000)]
Take 2: merge -Wuninitialized-experimental into -Wuninitialized.  Only *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag.  I await any fallout/comments/feedback, although hopefully this will produce no noise for users.

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

13 years agoSplit warnings from -Wuninitialized-experimental into "must-be-initialized" and ...
Ted Kremenek [Tue, 15 Mar 2011 05:22:28 +0000 (05:22 +0000)]
Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

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

13 years agoSplit warnings from -Wuninitialized-experimental into "must-be-initialized" and ...
Ted Kremenek [Tue, 15 Mar 2011 04:57:38 +0000 (04:57 +0000)]
Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

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

13 years agoUninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVec...
Ted Kremenek [Tue, 15 Mar 2011 04:57:32 +0000 (04:57 +0000)]
UninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVector.  No real functionality change, but this is a stepping stone to moving to tri-state logic.

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

13 years agoUninitializedValues: wrap BitVector references in a new class ValueVector. No functi...
Ted Kremenek [Tue, 15 Mar 2011 04:57:29 +0000 (04:57 +0000)]
UninitializedValues: wrap BitVector references in a new class ValueVector.  No functionality change.  This defines the minimum interface that ValueVector needs to support when we no longer base it strictly on a direct interpretation of BitVector.

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

13 years agoSubstitue term "BitVector" with "ValueVector" to prep for further revisions. No...
Ted Kremenek [Tue, 15 Mar 2011 04:57:27 +0000 (04:57 +0000)]
Substitue term "BitVector" with "ValueVector" to prep for further revisions.  No functionality change.

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

13 years agoRename UninitializedValuesV2 to UninitializedValues.
Ted Kremenek [Tue, 15 Mar 2011 03:17:07 +0000 (03:17 +0000)]
Rename UninitializedValuesV2 to UninitializedValues.

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

13 years agoRemove old UninitializedValues analysis.
Ted Kremenek [Tue, 15 Mar 2011 03:17:01 +0000 (03:17 +0000)]
Remove old UninitializedValues analysis.

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

13 years agolib/Basic/Targets.cpp: __declspec(attr) should be provided on mingw as macro, alias...
NAKAMURA Takumi [Tue, 15 Mar 2011 02:32:50 +0000 (02:32 +0000)]
lib/Basic/Targets.cpp: __declspec(attr) should be provided on mingw as macro, alias of __attribute__.

On mingw without -fms-extensions, we can provide "as-is" __declspec.

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

13 years agolib/Headers/mm_malloc.h: On Windows, we can expect _mm_malloc would be provided as...
NAKAMURA Takumi [Tue, 15 Mar 2011 02:32:43 +0000 (02:32 +0000)]
lib/Headers/mm_malloc.h: On Windows, we can expect _mm_malloc would be provided as macro by <malloc.h>.

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

13 years agolib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64...
NAKAMURA Takumi [Tue, 15 Mar 2011 02:32:36 +0000 (02:32 +0000)]
lib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64-w64-mingw32.

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

13 years agoIntroduce a CharUnits FieldOffsetInChars variable in AppendField() to
Ken Dyck [Tue, 15 Mar 2011 01:09:02 +0000 (01:09 +0000)]
Introduce a CharUnits FieldOffsetInChars variable in AppendField() to
replace some uses of FieldOffsetInBytes. The remaining uses of
FieldOffsetInBytes will be replaced once NextFieldOffsetInBytes is converted
to CharUnits. No change in functionality intended.

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

13 years agoStop leaking file descriptors.
Argyrios Kyrtzidis [Tue, 15 Mar 2011 00:47:44 +0000 (00:47 +0000)]
Stop leaking file descriptors.

After the open+fstat optimization, files were already opened for FileManager::getBufferForFile() and we closed them after reading them.
The problem was that when -working-directory was passed, the code path that actually reuses & closes the already opened file descriptor
was not followed.

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

13 years agoRevert r127617: "Code generation for noexcept."
Jakob Stoklund Olesen [Tue, 15 Mar 2011 00:18:21 +0000 (00:18 +0000)]
Revert r127617: "Code generation for noexcept."

The tests fail in a -Asserts build.

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

13 years agoDisable 'auto' type deduction in Objective-C. It likes 'id' a bit too
Douglas Gregor [Mon, 14 Mar 2011 21:43:30 +0000 (21:43 +0000)]
Disable 'auto' type deduction in Objective-C. It likes 'id' a bit too
much to be useful.

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

13 years agoSort
Joerg Sonnenberger [Mon, 14 Mar 2011 21:20:46 +0000 (21:20 +0000)]
Sort

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

13 years agoWhen synthesizing a label declaration based on a goto statement that
Douglas Gregor [Mon, 14 Mar 2011 21:19:51 +0000 (21:19 +0000)]
When synthesizing a label declaration based on a goto statement that
cannot yet be resolved, be sure to push the new label declaration into
the right place within the identifier chain. Otherwise, name lookup in
C++ gets confused when searching for names that are lexically closer
than the label. Fixes PR9463.

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

13 years agoSwitch from internal to linker_private linkage, it is sufficient to please the new...
Rafael Espindola [Mon, 14 Mar 2011 21:08:19 +0000 (21:08 +0000)]
Switch from internal to linker_private linkage, it is sufficient to please the new linker.

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

13 years agoCode generation for noexcept.
Sebastian Redl [Mon, 14 Mar 2011 20:33:20 +0000 (20:33 +0000)]
Code generation for noexcept.

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

13 years ago__clear_cache() is varargs and people will occasionally write it without
Eric Christopher [Mon, 14 Mar 2011 20:30:34 +0000 (20:30 +0000)]
__clear_cache() is varargs and people will occasionally write it without
arguments. Process only the arguments that people write, but process
all of them.

Fixes rdar://8900346

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

13 years agoTweak VariadicMethodTypeChecker to only create one ExplodedNode when issuing multiple...
Ted Kremenek [Mon, 14 Mar 2011 19:50:37 +0000 (19:50 +0000)]
Tweak VariadicMethodTypeChecker to only create one ExplodedNode when issuing multiple warnings for the same message expression.

Also add a test case showing that we correctly report multiple warnings for the same message expression.

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

13 years agoIncorporate source ranges for RangeBugReport when coelescing reports into equivalence...
Ted Kremenek [Mon, 14 Mar 2011 19:50:34 +0000 (19:50 +0000)]
Incorporate source ranges for RangeBugReport when coelescing reports into equivalence classes.

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

13 years agoImplement instantiation of noexcept spec and add a test case.
Sebastian Redl [Mon, 14 Mar 2011 18:51:50 +0000 (18:51 +0000)]
Implement instantiation of noexcept spec and add a test case.

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

13 years agoAdd another, pretty trivial, exception spec test case.
Sebastian Redl [Mon, 14 Mar 2011 18:51:44 +0000 (18:51 +0000)]
Add another, pretty trivial, exception spec test case.

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

13 years agoMake deallocation functions implicitly noexcept in C++0x.
Sebastian Redl [Mon, 14 Mar 2011 18:08:30 +0000 (18:08 +0000)]
Make deallocation functions implicitly noexcept in C++0x.

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

13 years agoFix link of libxul with LTO and the linker in xcode4. It is not clear if this
Rafael Espindola [Mon, 14 Mar 2011 17:55:00 +0000 (17:55 +0000)]
Fix link of libxul with LTO and the linker in xcode4. It is not clear if this
is working around a bug in ld or if the new linker has a reasonable reason
for wanting the string constant to be linker visible.

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

13 years ago-fwritable-strings should silence warnings about the deprecated string
Douglas Gregor [Mon, 14 Mar 2011 16:13:32 +0000 (16:13 +0000)]
-fwritable-strings should silence warnings about the deprecated string
-literal to char* conversion. Make it so.

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