]> granicus.if.org Git - clang/log
clang
12 years agoInitialize debug info for special cases of functions that lack declarations and are...
Alexey Samsonov [Thu, 25 Oct 2012 10:18:50 +0000 (10:18 +0000)]
Initialize debug info for special cases of functions that lack declarations and are generated by Clang (global initializers/destructors, thunks) . Fixes PR13942.

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

12 years agounittests/ToolingTest.cpp: Suppress newFrontendActionFactory.InjectsEndOfSourceFileCa...
NAKAMURA Takumi [Thu, 25 Oct 2012 09:38:41 +0000 (09:38 +0000)]
unittests/ToolingTest.cpp: Suppress newFrontendActionFactory.InjectsEndOfSourceFileCallback on Win32 for now. Investigating.

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

12 years agoAdds the possibility to inject a callback that's called after each translation unit...
Manuel Klimek [Thu, 25 Oct 2012 08:49:11 +0000 (08:49 +0000)]
Adds the possibility to inject a callback that's called after each translation unit is processed.

This is important when one wants to deduplicate results during one run over a translation unit by pointer identity of AST nodes.

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

12 years ago-fcatch-undefined-behavior checking for appropriate vptr value: Clang CodeGen side.
Richard Smith [Thu, 25 Oct 2012 02:14:12 +0000 (02:14 +0000)]
-fcatch-undefined-behavior checking for appropriate vptr value: Clang CodeGen side.

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

12 years agoTake into account that there may be a BOM at the beginning of the file,
Argyrios Kyrtzidis [Thu, 25 Oct 2012 01:51:45 +0000 (01:51 +0000)]
Take into account that there may be a BOM at the beginning of the file,
when computing the size of the precompiled preamble.

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

12 years agoUpdate warning-flag test
Douglas Gregor [Thu, 25 Oct 2012 00:34:38 +0000 (00:34 +0000)]
Update warning-flag test

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

12 years agoRevert r166647 to rethink the patch...
Bill Wendling [Thu, 25 Oct 2012 00:32:44 +0000 (00:32 +0000)]
Revert r166647 to rethink the patch...

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

12 years agoRemove the old predefines-buffer diffing code completely. It's been
Douglas Gregor [Thu, 25 Oct 2012 00:30:23 +0000 (00:30 +0000)]
Remove the old predefines-buffer diffing code completely. It's been
replaced by the more efficient, cleaner preprocessor-option version
that occurs earlier in PCH validation.

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

12 years agoFix computation of predefines buffer from the preprocessor-option
Douglas Gregor [Thu, 25 Oct 2012 00:25:27 +0000 (00:25 +0000)]
Fix computation of predefines buffer from the preprocessor-option
checking, and disable the old predefines-buffer-diff'ing code path.

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

12 years agoWhen we're devirtualizing a method call, make sure the method has the correct IR...
Eli Friedman [Thu, 25 Oct 2012 00:12:49 +0000 (00:12 +0000)]
When we're devirtualizing a method call, make sure the method has the correct IR type.

Reported in the thread "devirtualisation appears to crash clang on covariant functions on ARM" on cfe-dev.

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

12 years agoASTUnit doesn't actually care about the predefines; don't record them.
Douglas Gregor [Thu, 25 Oct 2012 00:09:28 +0000 (00:09 +0000)]
ASTUnit doesn't actually care about the predefines; don't record them.

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

12 years agoThe the preprocessor option validator to compute suggested
Douglas Gregor [Thu, 25 Oct 2012 00:07:54 +0000 (00:07 +0000)]
The the preprocessor option validator to compute suggested
predefines. We're not quite ready to cut over to these suggested
predefines yet, however.

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

12 years agoAdd some support for diagnosing possibly mismatched constraint, type size and
Bill Wendling [Thu, 25 Oct 2012 00:05:55 +0000 (00:05 +0000)]
Add some support for diagnosing possibly mismatched constraint, type size and
modifiers. (From an idea by Eric...)
<rdar://problem/12284092>

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

12 years ago'constexpr' and 'friend' are both declaration specifiers. Teach the parser this,...
Richard Smith [Thu, 25 Oct 2012 00:00:53 +0000 (00:00 +0000)]
'constexpr' and 'friend' are both declaration specifiers. Teach the parser this, for better error recovery.

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

12 years agoPR14171: Don't crash if we hit one of the paths where GetFullTypeForDeclarator
Richard Smith [Wed, 24 Oct 2012 23:51:56 +0000 (23:51 +0000)]
PR14171: Don't crash if we hit one of the paths where GetFullTypeForDeclarator
rebuilds a function type, and that function type has parens around its name.

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

12 years agoTeach the PCH validator to check the preprocessor options, especially
Douglas Gregor [Wed, 24 Oct 2012 23:41:50 +0000 (23:41 +0000)]
Teach the PCH validator to check the preprocessor options, especially
the macros that are #define'd or #undef'd on the command line. This
checking happens much earlier than the current macro-definition
checking and is far cleaner, because it does a direct comparison
rather than a diff of the predefines buffers. Moreover, it allows us
to use the result of this check to skip over PCH files within a
directory that have non-matching -D's or -U's on the command
line. Finally, it improves the diagnostics a bit for mismatches,
fixing <rdar://problem/8612222>.

The old predefines-buffer diff'ing will go away in a subsequent commit.

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

12 years agoc-index-test.c: Split a format string. [-Woverlength-strings]
NAKAMURA Takumi [Wed, 24 Oct 2012 22:52:04 +0000 (22:52 +0000)]
c-index-test.c: Split a format string. [-Woverlength-strings]

FIXME: They are still long strings without formatter in printf(3)!

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

12 years ago[ms-inline asm] Test case for r166632.
Chad Rosier [Wed, 24 Oct 2012 22:22:12 +0000 (22:22 +0000)]
[ms-inline asm] Test case for r166632.

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

12 years agoFix false positive in -Wunused-variable when a ctor call make involve cleanups.
David Blaikie [Wed, 24 Oct 2012 21:29:06 +0000 (21:29 +0000)]
Fix false positive in -Wunused-variable when a ctor call make involve cleanups.

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

12 years agoUpdate regression tests for r166617.
Eli Friedman [Wed, 24 Oct 2012 20:28:18 +0000 (20:28 +0000)]
Update regression tests for r166617.

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

12 years agoDon't print scope qualifiers for references to a type defined locally in a function...
Eli Friedman [Wed, 24 Oct 2012 20:21:25 +0000 (20:21 +0000)]
Don't print scope qualifiers for references to a type defined locally in a function.  Patch by Grzegorz Jablonski.

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

12 years agoAdd an additional test for namespaces and -Wmissing-variable-declarations. Move...
Eli Friedman [Wed, 24 Oct 2012 20:14:09 +0000 (20:14 +0000)]
Add an additional test for namespaces and -Wmissing-variable-declarations.  Move C++ test into SemaCXX.

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

12 years ago(De-)serialize the preprocessor options, including macros defined,
Douglas Gregor [Wed, 24 Oct 2012 20:05:57 +0000 (20:05 +0000)]
(De-)serialize the preprocessor options, including macros defined,
-include'd files, etc.

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

12 years agoAdd a test showing that nodebug is accepted in methods too. Patch by
Rafael Espindola [Wed, 24 Oct 2012 18:34:26 +0000 (18:34 +0000)]
Add a test showing that nodebug is accepted in methods too. Patch by
Paul Robinson.

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

12 years ago[libclang] Add "-index-file-full" option that recursively indexes any imported
Argyrios Kyrtzidis [Wed, 24 Oct 2012 18:29:15 +0000 (18:29 +0000)]
[libclang] Add "-index-file-full" option that recursively indexes any imported
modules/PCH files.

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

12 years agoExplicitly specify C++98 when building the C++ precompiled header for this test,...
Douglas Gregor [Wed, 24 Oct 2012 17:49:01 +0000 (17:49 +0000)]
Explicitly specify C++98 when building the C++ precompiled header for this test, so that the test will work on Windows.

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

12 years ago[ms-inline asm] Add test cases for r166451.
Chad Rosier [Wed, 24 Oct 2012 17:48:01 +0000 (17:48 +0000)]
[ms-inline asm] Add test cases for r166451.

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

12 years agoTeach the preprocessor to hold onto the preprocessor options.
Douglas Gregor [Wed, 24 Oct 2012 17:46:57 +0000 (17:46 +0000)]
Teach the preprocessor to hold onto the preprocessor options.

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

12 years ago[ms-inline asm] Add test cases for r166592. The test cases only works if the
Chad Rosier [Wed, 24 Oct 2012 17:23:06 +0000 (17:23 +0000)]
[ms-inline asm] Add test cases for r166592. The test cases only works if the
source operand is a register.

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

12 years agoMove PreprocessorOptions into the Lex library, and make it intrusively
Douglas Gregor [Wed, 24 Oct 2012 17:01:35 +0000 (17:01 +0000)]
Move PreprocessorOptions into the Lex library, and make it intrusively
reference-counted.

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

12 years ago(De-)serialize header search options.
Douglas Gregor [Wed, 24 Oct 2012 16:50:34 +0000 (16:50 +0000)]
(De-)serialize header search options.

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

12 years agoUpdate unit tests for HeaderSearch change
Douglas Gregor [Wed, 24 Oct 2012 16:24:38 +0000 (16:24 +0000)]
Update unit tests for HeaderSearch change

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

12 years agoMove HeaderSearchOptions into the Lex library, make it intrusively
Douglas Gregor [Wed, 24 Oct 2012 16:19:39 +0000 (16:19 +0000)]
Move HeaderSearchOptions into the Lex library, make it intrusively
reference-counted, and hold a reference to it in HeaderSearch.

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

12 years agoUndef SEMANTIC_VALUE_DIAGOPT appropriately
Douglas Gregor [Wed, 24 Oct 2012 15:53:39 +0000 (15:53 +0000)]
Undef SEMANTIC_VALUE_DIAGOPT appropriately

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

12 years ago(De-)serialize the file system options.
Douglas Gregor [Wed, 24 Oct 2012 15:49:58 +0000 (15:49 +0000)]
(De-)serialize the file system options.

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

12 years agoSerialize DiagnosticOptions to the AST file.
Douglas Gregor [Wed, 24 Oct 2012 15:17:15 +0000 (15:17 +0000)]
Serialize DiagnosticOptions to the AST file.

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

12 years agoRemoved an extra blank line.
Mahesha S [Wed, 24 Oct 2012 15:12:40 +0000 (15:12 +0000)]
Removed an extra blank line.

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

12 years agoAdds the possibility to run ASTMatchFinder over arbitrary AST nodes.
Manuel Klimek [Wed, 24 Oct 2012 14:47:44 +0000 (14:47 +0000)]
Adds the possibility to run ASTMatchFinder over arbitrary AST nodes.

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

12 years agoAdd a simple test involving decltype on Objective-C properties and ivars
Douglas Gregor [Wed, 24 Oct 2012 14:13:21 +0000 (14:13 +0000)]
Add a simple test involving decltype on Objective-C properties and ivars

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

12 years agoRemove the HiddenWeakTemplateVTables CodeGen option. It's currently unused.
Douglas Gregor [Wed, 24 Oct 2012 14:11:55 +0000 (14:11 +0000)]
Remove the HiddenWeakTemplateVTables CodeGen option. It's currently unused.

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

12 years agoPass LLVM_ANDROID_TOOLCHAIN_DIR if set.
Evgeniy Stepanov [Wed, 24 Oct 2012 14:05:29 +0000 (14:05 +0000)]
Pass LLVM_ANDROID_TOOLCHAIN_DIR if set.

This lets one build ASan runtime for ARM/Android by running
make -C tools/clang/runtime/ \
  LLVM_ANDROID_TOOLCHAIN_DIR=/path/to/ndk/toolchain
in an existing build tree.

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

12 years agoUpdate docs about TSan availability in CMake build
Alexey Samsonov [Wed, 24 Oct 2012 13:34:53 +0000 (13:34 +0000)]
Update docs about TSan availability in CMake build

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

12 years agoFix some wordings in AddressSanitizer docs.
Alexey Samsonov [Wed, 24 Oct 2012 13:21:51 +0000 (13:21 +0000)]
Fix some wordings in AddressSanitizer docs.

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

12 years agoA number of test cases assume that an "int" parameter or return value
Ulrich Weigand [Wed, 24 Oct 2012 12:22:56 +0000 (12:22 +0000)]
A number of test cases assume that an "int" parameter or return value
will be represented in the IR as a plain "i32" type.  This causes the
tests to spuriously fail on platforms where int is not a 32-bit type,
or where the ABI requires attributes like "signext" or "zeroext" to
be used.

This patch adds -triple or -target parameters to force those tests
to use the i386-unknown-unknown target.

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

12 years agoRevert r166541, "clang/test: Add appropriate requirements as REQUIRES, corresponding...
NAKAMURA Takumi [Wed, 24 Oct 2012 03:59:09 +0000 (03:59 +0000)]
Revert r166541, "clang/test: Add appropriate requirements as REQUIRES, corresponding to r166532."

According to r166543, it is not needed for now.

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

12 years agoClang now attempts to create a TargetMachine whenever a triple is given.
Nadav Rotem [Wed, 24 Oct 2012 03:52:31 +0000 (03:52 +0000)]
Clang now attempts to create a TargetMachine whenever a triple is given.
Many of our tests specify triples that are not built into clang.
In this commit we allow clang to fail loading the triple if we are only
using clang to emit llvm ir.

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

12 years agoclang/test: Add appropriate requirements as REQUIRES, corresponding to r166532.
NAKAMURA Takumi [Wed, 24 Oct 2012 02:57:57 +0000 (02:57 +0000)]
clang/test: Add appropriate requirements as REQUIRES, corresponding to r166532.

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

12 years agoAdd a test for -Warc-abi as requested by Fariborz.
Nico Weber [Wed, 24 Oct 2012 02:37:03 +0000 (02:37 +0000)]
Add a test for -Warc-abi as requested by Fariborz.

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

12 years agoAdd padding inreg registers to cause llvm to skip ecx when needed with
Rafael Espindola [Wed, 24 Oct 2012 01:59:00 +0000 (01:59 +0000)]
Add padding inreg registers to cause llvm to skip ecx when needed with
the x86_fastcallcc calling convention.

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

12 years agoAdd inreg markers with the x86_fastcallcc calling convention.
Rafael Espindola [Wed, 24 Oct 2012 01:58:58 +0000 (01:58 +0000)]
Add inreg markers with the x86_fastcallcc calling convention.

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

12 years agoAddress feedback from Eli Friedman on r166522.
Matt Beaumont-Gay [Wed, 24 Oct 2012 01:14:28 +0000 (01:14 +0000)]
Address feedback from Eli Friedman on r166522.

In particular, we do want to warn on some unused cast subexpressions within
macros.

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

12 years agoChange EmitAssemblyHelper to create the target machine early
Nadav Rotem [Wed, 24 Oct 2012 00:53:38 +0000 (00:53 +0000)]
Change EmitAssemblyHelper to create the target machine early
and use it to initialize the TargetTransformInfo analysis pass.
We need the TTI information for the loop vectorizer.

rdar://12464901

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

12 years ago[analyzer] Handle 'SomeVar.SomeEnumConstant', which is legal in C++.
Jordan Rose [Tue, 23 Oct 2012 23:59:08 +0000 (23:59 +0000)]
[analyzer] Handle 'SomeVar.SomeEnumConstant', which is legal in C++.

This caused assertion failures analyzing LLVM.

<rdar://problem/12560282>

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

12 years ago[analyzer] Replace -analyzer-no-eagerly-trim-egraph with graph-trim-interval.
Jordan Rose [Tue, 23 Oct 2012 23:59:05 +0000 (23:59 +0000)]
[analyzer] Replace -analyzer-no-eagerly-trim-egraph with graph-trim-interval.

After every 1000 CFGElements processed, the ExplodedGraph trims out nodes
that satisfy a number of criteria for being "boring" (single predecessor,
single successor, and more). Rather than controlling this with a cc1 option,
which can only disable this behavior, we now have an analyzer-config option,
'graph-trim-interval', which can change this interval from 1000 to something
else. Setting the value to 0 disables reclamation.

The next commit relies on this behavior to actually test anything.

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

12 years ago[ms-inline asm] Test case for r166526.
Chad Rosier [Tue, 23 Oct 2012 23:42:25 +0000 (23:42 +0000)]
[ms-inline asm] Test case for r166526.

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

12 years ago[ms-inline asm] Update the triple to test r166523.
Chad Rosier [Tue, 23 Oct 2012 23:32:21 +0000 (23:32 +0000)]
[ms-inline asm] Update the triple to test r166523.

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

12 years agoDon't emit -Wunused-value warnings from macro expansions.
Matt Beaumont-Gay [Tue, 23 Oct 2012 23:19:32 +0000 (23:19 +0000)]
Don't emit -Wunused-value warnings from macro expansions.

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

12 years agoTweak include order
Douglas Gregor [Tue, 23 Oct 2012 23:13:50 +0000 (23:13 +0000)]
Tweak include order

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

12 years agoUse a .def file for most of the diagnostic options.
Douglas Gregor [Tue, 23 Oct 2012 23:11:23 +0000 (23:11 +0000)]
Use a .def file for most of the diagnostic options.

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

12 years agoObjective-C: check that when a category method is being implemented,
Fariborz Jahanian [Tue, 23 Oct 2012 23:06:22 +0000 (23:06 +0000)]
Objective-C: check that when a category method is being implemented,
method type in cateogry matches the implementation.
// rdar://12519216

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

12 years agoBuildbot debugging is fun
Douglas Gregor [Tue, 23 Oct 2012 22:55:10 +0000 (22:55 +0000)]
Buildbot debugging is fun

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

12 years agoOne last unit-test fix
Douglas Gregor [Tue, 23 Oct 2012 22:43:37 +0000 (22:43 +0000)]
One last unit-test fix

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

12 years agoMore unit-test fixes
Douglas Gregor [Tue, 23 Oct 2012 22:38:58 +0000 (22:38 +0000)]
More unit-test fixes

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

12 years agoUpdate clang-interpreter example
Douglas Gregor [Tue, 23 Oct 2012 22:36:49 +0000 (22:36 +0000)]
Update clang-interpreter example

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

12 years agoFixup unit tests for DiagnosticOptions change
Douglas Gregor [Tue, 23 Oct 2012 22:31:51 +0000 (22:31 +0000)]
Fixup unit tests for DiagnosticOptions change

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

12 years agoMake DiagnosticOptions intrusively reference-counted, and make sure
Douglas Gregor [Tue, 23 Oct 2012 22:26:28 +0000 (22:26 +0000)]
Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.

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

12 years agoCMake: Fix public header search for generating Xcode/MSVC projects.
Jordan Rose [Tue, 23 Oct 2012 21:54:03 +0000 (21:54 +0000)]
CMake: Fix public header search for generating Xcode/MSVC projects.

Previously, we only had support for one level of library under lib/,
with the existence of the two-level lib/StaticAnalyzer/* hardcoded in
the top-level CMakeLists.txt. This became a problem with split of
libRewrite into several libraries -- with the same sub-names as the
libraries in lib/StaticAnalyzer/.

Now, we match up anything under lib/ to the corresponding directory
in include/clang/.

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

12 years agoFix pretty-printing pseudo-destructor calls. Patch by Grzegorz Jablonski.
Eli Friedman [Tue, 23 Oct 2012 20:26:57 +0000 (20:26 +0000)]
Fix pretty-printing pseudo-destructor calls.  Patch by Grzegorz Jablonski.

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

12 years agoDelete junk that snuck into r166498.
Eli Friedman [Tue, 23 Oct 2012 20:23:23 +0000 (20:23 +0000)]
Delete junk that snuck into r166498.

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

12 years agoAdd a new warning -Wmissing-variable-declarations, to warn about variables
Eli Friedman [Tue, 23 Oct 2012 20:19:32 +0000 (20:19 +0000)]
Add a new warning -Wmissing-variable-declarations, to warn about variables
defined without a previous declaration.  This is similar to
-Wmissing-prototypes, but for variables instead of functions.

Patch by Ed Schouten.

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

12 years agoSwitch CodeGenOptions over to a .def file, like we do with LangOptions.
Douglas Gregor [Tue, 23 Oct 2012 20:05:01 +0000 (20:05 +0000)]
Switch CodeGenOptions over to a .def file, like we do with LangOptions.

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

12 years agoWhen rebuilding a DependentScopeDeclRefExpr, perform a lookup into the scope
Richard Smith [Tue, 23 Oct 2012 19:56:01 +0000 (19:56 +0000)]
When rebuilding a DependentScopeDeclRefExpr, perform a lookup into the scope
even if it's dependent, in case it now names a member of the current instantiation.

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

12 years ago[ms-inline asm] Update for r166433.
Chad Rosier [Tue, 23 Oct 2012 17:44:40 +0000 (17:44 +0000)]
[ms-inline asm] Update for r166433.

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

12 years agoHandle -pthread, -pg and -shared correctly on bitrig.
Rafael Espindola [Tue, 23 Oct 2012 17:07:31 +0000 (17:07 +0000)]
Handle -pthread, -pg and -shared correctly on bitrig.
Patch by David Hill.

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

12 years agoFix some mdoc nits
Sean Silva [Tue, 23 Oct 2012 16:35:44 +0000 (16:35 +0000)]
Fix some mdoc nits

Patch by Eitan Adler!

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

12 years agoMake hasDeclaration() matcher work inside the memberExpr() matcher.
Daniel Jasper [Tue, 23 Oct 2012 15:46:39 +0000 (15:46 +0000)]
Make hasDeclaration() matcher work inside the memberExpr() matcher.

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

12 years agoclang/test/PCH/pch-dir.c: Update a comment for msvc. msvc(*-win32) implies -std=c...
NAKAMURA Takumi [Tue, 23 Oct 2012 10:43:00 +0000 (10:43 +0000)]
clang/test/PCH/pch-dir.c: Update a comment for msvc. msvc(*-win32) implies -std=c++11.

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

12 years agoImplements the thisExpr matcher.
Manuel Klimek [Tue, 23 Oct 2012 10:40:50 +0000 (10:40 +0000)]
Implements the thisExpr matcher.
Patch by Gabor Horvath.

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

12 years agoclang/test/PCH/pch-dir.c: Mark it as XFAIL:msvc. It doesn't fail (virtually xpass...
NAKAMURA Takumi [Tue, 23 Oct 2012 07:47:51 +0000 (07:47 +0000)]
clang/test/PCH/pch-dir.c: Mark it as XFAIL:msvc. It doesn't fail (virtually xpass) on msvc.

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

12 years agoclang/test/PCH/pch-dir.c: Relax expressions of path separators for Win32.
NAKAMURA Takumi [Tue, 23 Oct 2012 07:01:50 +0000 (07:01 +0000)]
clang/test/PCH/pch-dir.c: Relax expressions of path separators for Win32.

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

12 years agoIf the precompiled header named by "-include" is actually a directory,
Douglas Gregor [Tue, 23 Oct 2012 06:18:24 +0000 (06:18 +0000)]
If the precompiled header named by "-include" is actually a directory,
check each of the files within that directory to determine if any of
them is an AST file that matches the language and target options. If
so, the first matching AST file is loaded. This fixes a longstanding
discrepency with GCC's precompiled header implementation.

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

12 years agoFix -Wunused-value to not warn on expressions that have unresolved lookups due
Matt Beaumont-Gay [Tue, 23 Oct 2012 06:15:26 +0000 (06:15 +0000)]
Fix -Wunused-value to not warn on expressions that have unresolved lookups due
to dependent arguments.

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

12 years ago[libclang] Add an environment variable to disable thread background priotity, for...
Argyrios Kyrtzidis [Tue, 23 Oct 2012 04:09:38 +0000 (04:09 +0000)]
[libclang] Add an environment variable to disable thread background priotity, for testing

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

12 years ago[ms-inline-asm] Add handling for errors coming out of the backend.
Eli Friedman [Tue, 23 Oct 2012 02:43:30 +0000 (02:43 +0000)]
[ms-inline-asm] Add handling for errors coming out of the backend.

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

12 years agoDon't try to use inreg with 0 sized structs. Thanks to Eli for reporting the
Rafael Espindola [Tue, 23 Oct 2012 02:04:01 +0000 (02:04 +0000)]
Don't try to use inreg with 0 sized structs. Thanks to Eli for reporting the
regression.

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

12 years ago[Options] Fix two options I mistransformed.
Michael J. Spencer [Tue, 23 Oct 2012 01:25:21 +0000 (01:25 +0000)]
[Options] Fix two options I mistransformed.

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

12 years agoUgly ugly hack for libstdc++-4.6 and libstdc++-4.7 compatibility. These
Richard Smith [Tue, 23 Oct 2012 00:32:41 +0000 (00:32 +0000)]
Ugly ugly hack for libstdc++-4.6 and libstdc++-4.7 compatibility. These
libraries have an incorrect definition of std::common_type (inherited from a
bug in the standard -- see LWG issue 2141), whereby they produce reference
types when they should not.

If we instantiate a typedef named std::common_type<...>::type, which is defined
in a system header as decltype(... ? ... : ...), and the decltype produces a
reference type, convert it to the non-reference type. (This doesn't affect any
LWG2141-conforming implementation of common_type, such as libc++'s, because the
default implementation of common_type<...>::type isn't supposed to produce a
reference type.)

This is horrible. I'm really sorry. :( Better ideas appreciated!

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

12 years agoHandle implicitly-included PCH files the same way as
Douglas Gregor [Mon, 22 Oct 2012 23:59:45 +0000 (23:59 +0000)]
Handle implicitly-included PCH files the same way as
implicitly-included PTH files during initialization, delaying the
mapping down to the "original source file" until after later in the
initialization process.

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

12 years agoAllow clients of the AST reader to specify what kinds of AST load
Douglas Gregor [Mon, 22 Oct 2012 23:51:00 +0000 (23:51 +0000)]
Allow clients of the AST reader to specify what kinds of AST load
failures they know how to tolerate, e.g., out-of-date input files or
configuration/version mismatches. Suppress the corresponding
diagnostics if the client can handle it.

No clients actually use this functionality, yet.

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

12 years agoCollapse ASTReader::ReadSLocEntryRecord() into its only caller,
Douglas Gregor [Mon, 22 Oct 2012 22:53:10 +0000 (22:53 +0000)]
Collapse ASTReader::ReadSLocEntryRecord() into its only caller,
ReadSLocEntry(). No functionality change.

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

12 years agoDistinguish the various kinds of AST file loading failures:
Douglas Gregor [Mon, 22 Oct 2012 22:50:17 +0000 (22:50 +0000)]
Distinguish the various kinds of AST file loading failures:
file corruption, compiler version mismatch, target/language
configuration mismatch, out-of-date AST file. No functionality change
yet.

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

12 years ago[Options] Add prefixes to options.
Michael J. Spencer [Mon, 22 Oct 2012 22:13:48 +0000 (22:13 +0000)]
[Options] Add prefixes to options.

Each option has a set of prefixes. When matching an argument such as
-funroll-loops. First the leading - is removed as it is a prefix. Then
a lower_bound search for "funroll-loops" is done against the option table by
option name. From there each option prefix + option name combination is tested
against the argument.

This allows us to support Microsoft style options where both / and - are valid
prefixes. It also simplifies the cases we already have where options come in
both - and -- forms. Almost every option for gnu-ld happens to have this form.

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

12 years agoASTReader.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Mon, 22 Oct 2012 21:50:39 +0000 (21:50 +0000)]
ASTReader.cpp: Fix a warning. [-Wunused-variable]

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

12 years agoTestcase change for r166440.
Eli Friedman [Mon, 22 Oct 2012 20:50:45 +0000 (20:50 +0000)]
Testcase change for r166440.

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

12 years agoFix for PR13334. This prevents crashes that result from badly formed
Richard Trieu [Mon, 22 Oct 2012 20:28:48 +0000 (20:28 +0000)]
Fix for PR13334.  This prevents crashes that result from badly formed
expressions involving __has_include

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

12 years ago[ms-inline asm] Test case for r166433.
Chad Rosier [Mon, 22 Oct 2012 19:43:17 +0000 (19:43 +0000)]
[ms-inline asm] Test case for r166433.

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

12 years agoFix pre-commit refacto failure.
Daniel Dunbar [Mon, 22 Oct 2012 18:56:43 +0000 (18:56 +0000)]
Fix pre-commit refacto failure.

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

12 years agodriver/Darwin: Follow up to last patch, M-class CPUs are AAPCS but not EABI.
Daniel Dunbar [Mon, 22 Oct 2012 18:51:13 +0000 (18:51 +0000)]
driver/Darwin: Follow up to last patch, M-class CPUs are AAPCS but not EABI.

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

12 years agoEliminate the redundancy between source-file information in the source
Douglas Gregor [Mon, 22 Oct 2012 18:42:04 +0000 (18:42 +0000)]
Eliminate the redundancy between source-file information in the source
manager block and input-file information in the control block. The
source manager entries now point back into the control block. Input
files are now lazily deserialized (if validation is disabled). Reduces
Cocoa's PCH by the ~70k I added when I introduced the redundancy in
r166251.

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

12 years agodriver/Darwin: Default to AAPCS for M-class CPUs.
Daniel Dunbar [Mon, 22 Oct 2012 18:30:51 +0000 (18:30 +0000)]
driver/Darwin: Default to AAPCS for M-class CPUs.

 - This is an assumption that is currently hardwired into the backend, we need
   to do this in order for the frontend and backend to agree.

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