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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 years ago[Options] make Option a value type.
Michael J. Spencer [Fri, 19 Oct 2012 22:36:40 +0000 (22:36 +0000)]
[Options] make Option a value type.

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

11 years agoremove noreturn attribute from __builtin_debugtrap
Shuxin Yang [Fri, 19 Oct 2012 22:21:42 +0000 (22:21 +0000)]
remove noreturn attribute from __builtin_debugtrap

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

11 years ago[ms-inline asm] Update testcase for r166316.
Chad Rosier [Fri, 19 Oct 2012 20:57:37 +0000 (20:57 +0000)]
[ms-inline asm] Update testcase for r166316.

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

11 years ago[ms-inline asm] Revert accidental commit. Sorry for the churn.
Chad Rosier [Fri, 19 Oct 2012 20:38:09 +0000 (20:38 +0000)]
[ms-inline asm] Revert accidental commit. Sorry for the churn.

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

11 years agoPretty-print a ParenListExpr in a variable initializer correctly. Patch by Grzegorz...
Eli Friedman [Fri, 19 Oct 2012 20:36:44 +0000 (20:36 +0000)]
Pretty-print a ParenListExpr in a variable initializer correctly.  Patch by Grzegorz Jablonski.

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

11 years ago[ms-inline asm] Set the SemaCallback in the TargetAsmParser.
Chad Rosier [Fri, 19 Oct 2012 20:36:37 +0000 (20:36 +0000)]
[ms-inline asm] Set the SemaCallback in the TargetAsmParser.

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

11 years agotests: Fix two tests to just use -triple instead of XFAIL+XTARGET.
Daniel Dunbar [Fri, 19 Oct 2012 20:28:44 +0000 (20:28 +0000)]
tests: Fix two tests to just use -triple instead of XFAIL+XTARGET.

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

11 years agotests: Stop mangling '-vg' into the triple, we don't use this currently.
Daniel Dunbar [Fri, 19 Oct 2012 20:11:46 +0000 (20:11 +0000)]
tests: Stop mangling '-vg' into the triple, we don't use this currently.
 - Also, lit is going to get a valgrind feature, instead.

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

11 years agoIRgen: Initialize TargetLoweringInfo with a triple.
Daniel Dunbar [Fri, 19 Oct 2012 20:10:10 +0000 (20:10 +0000)]
IRgen: Initialize TargetLoweringInfo with a triple.

 - We create two TargetLoweringInfo instances for different pass managers, and
   they weren't consistent (the one for codegen didn't have the right info). I'm
   not sure this mattered anywhere in practice.

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

11 years agoadd __builtin_debugtrap
Shuxin Yang [Fri, 19 Oct 2012 20:09:33 +0000 (20:09 +0000)]
add __builtin_debugtrap

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

11 years agoClarify wording of -Wshift-op-parentheses.
David Blaikie [Fri, 19 Oct 2012 18:26:06 +0000 (18:26 +0000)]
Clarify wording of -Wshift-op-parentheses.

Suggestion from Matt Beaumont-Gay reviewing r165283.

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

11 years ago[ms-inline asm] Set the MCTargetAsmParser as paring MS-style inline asm.
Chad Rosier [Fri, 19 Oct 2012 17:58:45 +0000 (17:58 +0000)]
[ms-inline asm] Set the MCTargetAsmParser as paring MS-style inline asm.

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

11 years agoRemove const_casts by propagating constness down to called functions.
Dmitri Gribenko [Fri, 19 Oct 2012 16:51:38 +0000 (16:51 +0000)]
Remove const_casts by propagating constness down to called functions.

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

11 years agoAllow objc_requires_super to be used to check class methods as well.
Jordan Rose [Fri, 19 Oct 2012 16:05:26 +0000 (16:05 +0000)]
Allow objc_requires_super to be used to check class methods as well.

Also, unify ObjCShouldCallSuperDealloc and ObjCShouldCallSuperFinalize.
The two have identical behavior and will never be active at the same time.

There's one last simplification now, which is that if we see a call to
[super foo] and we are currently in a method named 'foo', we will
/unconditionally/ clear the ObjCShouldCallSuper flag, rather than check
first to see if we're in a method where calling super is required. There's
no reason to pay the extra lookup price here.

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

11 years agoChange VerifyDiagnosticConsumer so that it *must* contain at least one "expected...
Andy Gibbs [Fri, 19 Oct 2012 12:49:32 +0000 (12:49 +0000)]
Change VerifyDiagnosticConsumer so that it *must* contain at least one "expected-*" directive.  As a result, for test-cases that are not expected to generate any diagnostics, an additional directive "expected-no-diagnostics" has been implemented which can then be included in such test-cases.  This new directive may not be used in conjunction with any other "expected-*" directive.

This change was initially proposed as a solution to the problem highlighted by check-in r164677, i.e. that -verify will not cause a test-case failure where the compile command does not actually reference the file.

Patch reviewed by David Blaikie.

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

11 years agoPrior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsum...
Andy Gibbs [Fri, 19 Oct 2012 12:44:48 +0000 (12:44 +0000)]
Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.

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

11 years agoFix directive parsing in VerifyDiagnosticConsumer so that it ensures that "expected...
Andy Gibbs [Fri, 19 Oct 2012 12:36:49 +0000 (12:36 +0000)]
Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that "expected" is at the start of the word and will no longer accept typos such as "junkexpected-*" as a valid "expected-*" directive.  A very few test-cases had to be amended to adhere to the new rule.

Patch reviewed by David Blaikie.

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

11 years agoRevert r166268, this fix for a crash-on-invalid introduced a rejects-valid.
Nick Lewycky [Fri, 19 Oct 2012 08:08:02 +0000 (08:08 +0000)]
Revert r166268, this fix for a crash-on-invalid introduced a rejects-valid.
Richard has an unreduced testcase to work with.

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

11 years ago[asan] update asan docs to explain more about linking and to mention full support...
Kostya Serebryany [Fri, 19 Oct 2012 07:00:46 +0000 (07:00 +0000)]
[asan] update asan docs to explain more about linking and to mention full support for i386 Linux

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

11 years agoDR1511: A const volatile global does not implicitly get internal linkage like a
Richard Smith [Fri, 19 Oct 2012 06:37:48 +0000 (06:37 +0000)]
DR1511: A const volatile global does not implicitly get internal linkage like a
const non-volatile global does.

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

11 years agoPR14124: When performing template instantiation of a qualified-id outside of a
Richard Smith [Fri, 19 Oct 2012 06:32:17 +0000 (06:32 +0000)]
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@166268 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix handling of the regparm attribute in the presence of classes with copy
Rafael Espindola [Fri, 19 Oct 2012 05:04:37 +0000 (05:04 +0000)]
Fix handling of the regparm attribute in the presence of classes with copy
constructors.

When I first moved regparm support to TargetInfo.cpp I tried to isolate it
in classifyArgumentTypeWithReg, but it is actually a lot easier to flip the
code around and check for regparm at the end of the decision tree.

Without this refactoring classifyArgumentTypeWithReg would have to duplicate
the logic about when to use non-byval indirect arguments.

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

11 years agoTeach getColumnNumber to use the line cache to get the start of the line if its on...
Craig Topper [Fri, 19 Oct 2012 04:40:38 +0000 (04:40 +0000)]
Teach getColumnNumber to use the line cache to get the start of the line if its on the same line as the last call to getLineNumber. Prevents needing to scan backwards for the new line. Fixes PR14106.

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

11 years agoReintroduce the TargetTransformInfo to the clang pass manager.
Nadav Rotem [Fri, 19 Oct 2012 04:15:32 +0000 (04:15 +0000)]
Reintroduce the TargetTransformInfo to the clang pass manager.

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

11 years agoclang/test/Index/annotate-comments.cpp: Relax the expression to be matched to -fms...
NAKAMURA Takumi [Fri, 19 Oct 2012 03:27:50 +0000 (03:27 +0000)]
clang/test/Index/annotate-comments.cpp: Relax the expression to be matched to -fms-compatibility. Then XFAIL can be removed.

FYI, it can be reproduced with "c-index-test -std=c++11 -fms-compatibility".

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

11 years agoASTWriter.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Fri, 19 Oct 2012 01:53:57 +0000 (01:53 +0000)]
ASTWriter.cpp: Fix a warning. [-Wunused-variable]

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

11 years agoHandle diamond inheritance in -Woverloaded-virtual.
David Blaikie [Fri, 19 Oct 2012 00:53:08 +0000 (00:53 +0000)]
Handle diamond inheritance in -Woverloaded-virtual.

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

11 years agoFix typo in comment.
Nick Lewycky [Fri, 19 Oct 2012 00:47:07 +0000 (00:47 +0000)]
Fix typo in comment.

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

11 years agoDescribe the new input-files block and its record, for llvm-bcanalyzer.
Douglas Gregor [Fri, 19 Oct 2012 00:45:00 +0000 (00:45 +0000)]
Describe the new input-files block and its record, for llvm-bcanalyzer.

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

11 years agoMove the set of files to be validated in an AST file into the control
Douglas Gregor [Fri, 19 Oct 2012 00:38:02 +0000 (00:38 +0000)]
Move the set of files to be validated in an AST file into the control
block, so the input files are validated early on, before we've
committed to loading the AST file. This (accidentally) fixed a but
wherein the main file used to generate the AST file would *not* be
validated by the existing validation logic.

At the moment, this leads to some duplication of filenames between the
source manager block and input-file blocks, as well as validation
logic. This will be handled via an upcoming patch.

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

11 years agoclang/test/Index/annotate-comments.cpp: Mark this as XFAIL on msvc. Investigating.
NAKAMURA Takumi [Fri, 19 Oct 2012 00:22:54 +0000 (00:22 +0000)]
clang/test/Index/annotate-comments.cpp: Mark this as XFAIL on msvc. Investigating.

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