]> granicus.if.org Git - clang/log
clang
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

12 years agoImplement hasParent()-matcher.
Daniel Jasper [Mon, 22 Oct 2012 16:26:51 +0000 (16:26 +0000)]
Implement hasParent()-matcher.

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

12 years agoPR14141 (part of DR1351): An implicitly-deduced "any" exception specification
Richard Smith [Sun, 21 Oct 2012 23:00:34 +0000 (23:00 +0000)]
PR14141 (part of DR1351): An implicitly-deduced "any" exception specification
produces an exception of 'noexcept(false)' and is thus compatible with an
explicit exception specification of 'noexcept(false)'.

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

12 years agoFix typo, make test case slightly more reabable. Thanks to Dmitri Gribenko for
Lang Hames [Sun, 21 Oct 2012 19:56:13 +0000 (19:56 +0000)]
Fix typo, make test case slightly more reabable. Thanks to Dmitri Gribenko for
the suggestions.

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

12 years agoSilence warning about && in ||.
Benjamin Kramer [Sun, 21 Oct 2012 15:21:56 +0000 (15:21 +0000)]
Silence warning about && in ||.

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

12 years agoAdd support of MIPS n32 ABI to the Clang driver. The fix builds correct library/objec...
Simon Atanasyan [Sun, 21 Oct 2012 11:44:57 +0000 (11:44 +0000)]
Add support of MIPS n32 ABI to the Clang driver. The fix builds correct library/object files paths and passes appropriate command line options to the linker if user provides -mabi=n32 option.

The patch reviewed by Rafael Espindola.

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

12 years agoUnrevert r166268, reverted in r166272, with a fix for the issue which Nick
Richard Smith [Sun, 21 Oct 2012 03:28:35 +0000 (03:28 +0000)]
Unrevert r166268, reverted in r166272, with a fix for the issue which Nick
found: if an overloaded operator& is present before a template definition,
the expression &T::foo is represented as a CXXOperatorCallExpr, not as a
UnaryOperator, so we didn't notice that it's permitted to reference a non-static
data member of an unrelated class.

While investigating this, I discovered another problem in this area: we are
treating template default arguments as unevaluated contexts during substitution,
resulting in performing incorrect checks for uses of non-static data members in
C++11. That is not fixed by this patch (I'll look into this soon; it's related
to the failure to correctly instantiate constexpr function templates), but was
resulting in this bug not firing in C++11 mode (except with -Wc++98-compat).

Original message:

PR14124: When performing template instantiation of a qualified-id outside of a
class, diagnose if the qualified-id instantiates to a non-static class member.

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

12 years agoWhen used in a compound expression FP_CONTRACT should proceed all explicit
Lang Hames [Sun, 21 Oct 2012 01:10:01 +0000 (01:10 +0000)]
When used in a compound expression FP_CONTRACT should proceed all explicit
declarations and statements. Emit an error if the FP_CONTRACT is used
later in a compound statement.

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

12 years agoMove private classes into anonymous namespaces.
Benjamin Kramer [Sat, 20 Oct 2012 13:02:06 +0000 (13:02 +0000)]
Move private classes into anonymous namespaces.

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

12 years agoDR1473: Do not require a space between operator"" and the ud-suffix in a
Richard Smith [Sat, 20 Oct 2012 08:41:10 +0000 (08:41 +0000)]
DR1473: Do not require a space between operator"" and the ud-suffix in a
literal-operator-id.

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

12 years agoRework implementation of DR1492: Apply the resolution to operator delete too,
Richard Smith [Sat, 20 Oct 2012 08:26:51 +0000 (08:26 +0000)]
Rework implementation of DR1492: Apply the resolution to operator delete too,
since it also has an implicit exception specification. Downgrade the error to
an extwarn, since at least for operator delete, system headers like to declare
it as 'noexcept' whereas the implicit definition does not have an explicit
exception specification. Move the exception specification for user-declared
'operator delete' functions from the type-as-written into the type, to reflect
reality and to allow us to detect whether there was an implicit exception spec
or not.

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

12 years agoAccept -Wno-arc-abi without warning for a while.
Nico Weber [Sat, 20 Oct 2012 06:18:14 +0000 (06:18 +0000)]
Accept -Wno-arc-abi without warning for a while.

Xcode 4.5 passes -Wno-arc-abi to clang, which makes a clang newer than
r163917 warn that it doesn't understand -Wno-arc-abi. I asked if adding
this is ok at
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20121015/066433.html
and nobody objected.

Adding this makes life a bit easier for the chromium project. If you think
this is a burden on for clang, shout, and I'll revert this.

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

12 years agoFix __builtin_va_arg assertion failure in ARM AAPCS.
Logan Chien [Sat, 20 Oct 2012 06:11:33 +0000 (06:11 +0000)]
Fix __builtin_va_arg assertion failure in ARM AAPCS.

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

12 years ago[analyzer] Assume 'new' never returns NULL if it could throw an exception.
Jordan Rose [Sat, 20 Oct 2012 02:32:51 +0000 (02:32 +0000)]
[analyzer] Assume 'new' never returns NULL if it could throw an exception.

This is actually required by the C++ standard in
[basic.stc.dynamic.allocation]p3:

  If an allocation function declared with a non-throwing
  exception-specification fails to allocate storage, it shall return a
  null pointer. Any other allocation function that fails to allocate
  storage shall indicate failure only by throwing an exception of a type
  that would match a handler of type std::bad_alloc.

We don't bother checking for the specific exception type, but just go off
the operator new prototype. This should help with a certain class of lazy
initalization false positives.

<rdar://problem/12115221>

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

12 years agoDR1472: A reference isn't odr-used if it has preceding initialization,
Richard Smith [Sat, 20 Oct 2012 01:38:33 +0000 (01:38 +0000)]
DR1472: A reference isn't odr-used if it has preceding initialization,
initialized by a reference constant expression.

Our odr-use modeling still needs work here: we don't yet implement the 'set of
potential results of an expression' DR.

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

12 years agoWhen associating file ranges of macro arguments with their
Argyrios Kyrtzidis [Sat, 20 Oct 2012 00:51:32 +0000 (00:51 +0000)]
When associating file ranges of macro arguments with their
macro expansion ranges, make sure to check all the FileID
entries that are contained in the spelling range of the
expansion for the macro argument.

Fixes rdar://12537982

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

12 years ago[ms-inline asm] Update test case for r166357.
Chad Rosier [Sat, 20 Oct 2012 00:47:32 +0000 (00:47 +0000)]
[ms-inline asm] Update test case for r166357.

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

12 years ago[ms-inline asm] Test case for r166349 and r166352.
Chad Rosier [Fri, 19 Oct 2012 23:16:17 +0000 (23:16 +0000)]
[ms-inline asm] Test case for r166349 and r166352.

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

12 years ago[Options] Make Option non clang specific.
Michael J. Spencer [Fri, 19 Oct 2012 22:37:06 +0000 (22:37 +0000)]
[Options] Make Option non clang specific.

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