]> granicus.if.org Git - clang/log
clang
11 years agoSort all of Clang's files under 'lib', and fix up the broken headers
Chandler Carruth [Tue, 4 Dec 2012 09:13:33 +0000 (09:13 +0000)]
Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

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

11 years agoASTTests, ASTMatchersTests: Move clangEdit before clangAst in USEDLIB.
NAKAMURA Takumi [Tue, 4 Dec 2012 08:20:41 +0000 (08:20 +0000)]
ASTTests, ASTMatchersTests: Move clangEdit before clangAst in USEDLIB.

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

11 years agoUntabify (in USEDLIBS, Makefile(s)).
NAKAMURA Takumi [Tue, 4 Dec 2012 08:20:35 +0000 (08:20 +0000)]
Untabify (in USEDLIBS, Makefile(s)).

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

11 years agoclang/Lex: [CMake] Update CMakefiles since r169229.
NAKAMURA Takumi [Tue, 4 Dec 2012 07:40:33 +0000 (07:40 +0000)]
clang/Lex: [CMake] Update CMakefiles since r169229.

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

11 years agoDon't test for ASM output but for IR output.
Bill Wendling [Tue, 4 Dec 2012 07:33:40 +0000 (07:33 +0000)]
Don't test for ASM output but for IR output.

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

11 years agoRefactor recording the preprocessor conditional directive regions out of
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:27:05 +0000 (07:27 +0000)]
Refactor recording the preprocessor conditional directive regions out of
PreprocessingRecord and into its own class, PPConditionalDirectiveRecord.

Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord
without needing a PreprocessingRecord.

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

11 years agoIn the PreprocessingRecord, to identify the different conditional directive regions
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:26:53 +0000 (07:26 +0000)]
In the PreprocessingRecord, to identify the different conditional directive regions
use the SourceLocation at the start of the respective region, instead of a unique integer.

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

11 years ago[libclang] Avoid copying the CompileCommand related strings when wrapping them to...
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:26:48 +0000 (07:26 +0000)]
[libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.

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

11 years agoIntroduce CompilationDatabase::getAllCompileCommands() that returns all
Argyrios Kyrtzidis [Tue, 4 Dec 2012 07:26:44 +0000 (07:26 +0000)]
Introduce CompilationDatabase::getAllCompileCommands() that returns all
compile commands of the database and expose it via the libclang API.

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

11 years agoclang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp: Add explicit triple, x86_64...
NAKAMURA Takumi [Tue, 4 Dec 2012 06:58:05 +0000 (06:58 +0000)]
clang/test/CodeGenCXX/debug-info-zero-length-arrays.cpp: Add explicit triple, x86_64-unknown-unknown. It was incompatible to i686.

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

11 years agoAdd a 'count' field to the DWARF subrange.
Bill Wendling [Tue, 4 Dec 2012 06:21:27 +0000 (06:21 +0000)]
Add a 'count' field to the DWARF subrange.

The count field is necessary because there isn't a difference between the 'lo'
and 'hi' attributes for a one-element array and a zero-element array. When the
count is '0', we know that this is a zero-element array. When it's >=1, then
it's a normal constant sized array. When it's -1, then the array is unbounded.

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

11 years agoDocument the existence of -fsanitize=bounds.
Richard Smith [Tue, 4 Dec 2012 02:48:16 +0000 (02:48 +0000)]
Document the existence of -fsanitize=bounds.

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

11 years agoclang/test/Index/comment-objc-decls.m: Try to fix r169193, to add x86_64-darwin.
NAKAMURA Takumi [Tue, 4 Dec 2012 01:03:31 +0000 (01:03 +0000)]
clang/test/Index/comment-objc-decls.m: Try to fix r169193, to add x86_64-darwin.

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

11 years agoTesting objective-C declarations embedded in
Fariborz Jahanian [Tue, 4 Dec 2012 00:47:33 +0000 (00:47 +0000)]
Testing objective-C declarations embedded in
<declaration> tag of Comment XML and fixed a
missing declaration of ivars private to @implementation
as result of the testing. // rdar://12378714

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

11 years agoHave clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly modes...
Michael Ilseman [Tue, 4 Dec 2012 00:36:06 +0000 (00:36 +0000)]
Have clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly modes. Test cases included.

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

11 years agoremove trailing whitespace
Michael Ilseman [Tue, 4 Dec 2012 00:29:55 +0000 (00:29 +0000)]
remove trailing whitespace

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

11 years agoclang/test/Driver/fsanitize-blacklist.c: Mark it as XFAIL:cygming, due to PR12920.
NAKAMURA Takumi [Mon, 3 Dec 2012 23:29:49 +0000 (23:29 +0000)]
clang/test/Driver/fsanitize-blacklist.c: Mark it as XFAIL:cygming, due to PR12920.

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

11 years agoFix test failure when building Clang with g++4.7 -- don't use a Twine temporary
Richard Smith [Mon, 3 Dec 2012 22:39:14 +0000 (22:39 +0000)]
Fix test failure when building Clang with g++4.7 -- don't use a Twine temporary
after its lifetime has ended!

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

11 years agoFixes a compile warning and crash in the tests.
Manuel Klimek [Mon, 3 Dec 2012 20:55:42 +0000 (20:55 +0000)]
Fixes a compile warning and crash in the tests.

The necessity of this fix points to a problem with the design
of the addToken during the optimiation phase, which we need to address
in a much more principled way.

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

11 years agoAdd Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag...
Alexey Samsonov [Mon, 3 Dec 2012 19:12:58 +0000 (19:12 +0000)]
Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object.

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

11 years agolibclangFormat is not libclangTooling, but it depends on it.
Benjamin Kramer [Mon, 3 Dec 2012 18:28:52 +0000 (18:28 +0000)]
libclangFormat is not libclangTooling, but it depends on it.

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

11 years agoFix PR14474: don't emit debug info for interface types in -gline-tables-only mode.
Alexey Samsonov [Mon, 3 Dec 2012 18:28:12 +0000 (18:28 +0000)]
Fix PR14474: don't emit debug info for interface types in -gline-tables-only mode.

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

11 years agoInitial version of formatting library.
Daniel Jasper [Mon, 3 Dec 2012 18:12:45 +0000 (18:12 +0000)]
Initial version of formatting library.

This formatting library will be used by a stand-alone clang-format tool
and can also be used when writing other refactorings.

Manuel's original design document:
https://docs.google.com/a/google.com/document/d/1gpckL2U_6QuU9YW2L1ABsc4Fcogn5UngKk7fE5dDOoA/edit

The library can already successfully format itself.

Review: http://llvm-reviews.chandlerc.com/D80

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

11 years agoMake hasDeclaration work for enums.
Daniel Jasper [Mon, 3 Dec 2012 15:43:25 +0000 (15:43 +0000)]
Make hasDeclaration work for enums.

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

11 years agoAdd -fsanitize=memory.
Evgeniy Stepanov [Mon, 3 Dec 2012 13:20:43 +0000 (13:20 +0000)]
Add -fsanitize=memory.

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

11 years ago[ubsan] Add flag to enable recovery from checks when possible.
Will Dietz [Sun, 2 Dec 2012 19:50:33 +0000 (19:50 +0000)]
[ubsan] Add flag to enable recovery from checks when possible.

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

11 years agoMake helper classes anonymous. Make helper functions static instead of private member...
Benjamin Kramer [Sat, 1 Dec 2012 20:58:01 +0000 (20:58 +0000)]
Make helper classes anonymous. Make helper functions static instead of private members so the anonymous class doesn't leak out.

No functionality change.

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

11 years ago[MIPS] Add -mxgot/-mno-xgot command line options
Simon Atanasyan [Sat, 1 Dec 2012 18:27:21 +0000 (18:27 +0000)]
[MIPS] Add -mxgot/-mno-xgot command line options
to enable/disable support of GOT larger than 64k.

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

11 years agoAdd raw_ostream include to pacify MSVC.
Benjamin Kramer [Sat, 1 Dec 2012 17:54:07 +0000 (17:54 +0000)]
Add raw_ostream include to pacify MSVC.

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

11 years agoUpdate unit tests not to rely on transitive includes.
Benjamin Kramer [Sat, 1 Dec 2012 17:22:05 +0000 (17:22 +0000)]
Update unit tests not to rely on transitive includes.

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

11 years agoInclude pruning and general cleanup.
Benjamin Kramer [Sat, 1 Dec 2012 17:12:56 +0000 (17:12 +0000)]
Include pruning and general cleanup.

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

11 years agoDon't include Type.h in DeclarationName.h.
Benjamin Kramer [Sat, 1 Dec 2012 16:35:25 +0000 (16:35 +0000)]
Don't include Type.h in DeclarationName.h.

Recursively prune some includes.

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

11 years agoMake ASTVector.h standalone without including all of ASTContext.
Benjamin Kramer [Sat, 1 Dec 2012 15:18:03 +0000 (15:18 +0000)]
Make ASTVector.h standalone without including all of ASTContext.

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

11 years agoPull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull...
Benjamin Kramer [Sat, 1 Dec 2012 15:09:41 +0000 (15:09 +0000)]
Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull in all the generated Attr code.

Required to pull some functions out of line, but this shouldn't have a perf impact.
No functionality change.

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

11 years agoFix a test that was redefining FileCheck variables while referencing old ones.
Eli Bendersky [Sat, 1 Dec 2012 13:50:51 +0000 (13:50 +0000)]
Fix a test that was redefining FileCheck variables while referencing old ones.

In preparation for the FileCheck enhancement to support backreferences.

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

11 years agoSwitch to using -### as mentioned by chandlerc.
Joey Gouly [Sat, 1 Dec 2012 13:07:22 +0000 (13:07 +0000)]
Switch to using -### as mentioned by chandlerc.

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

11 years agoAdd -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approv...
Joey Gouly [Sat, 1 Dec 2012 12:15:28 +0000 (12:15 +0000)]
Add -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approved by d0k.

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

11 years agoAdd .arcconfig to the repository. Useful if someone wants to use phabricator's comman...
Benjamin Kramer [Sat, 1 Dec 2012 12:08:08 +0000 (12:08 +0000)]
Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool.

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

11 years agoFix a typo in comment.
Michael Han [Sat, 1 Dec 2012 04:35:48 +0000 (04:35 +0000)]
Fix a typo in comment.

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

11 years agoMake these functions more clearly express the test they are performing. No functional...
Richard Smith [Sat, 1 Dec 2012 03:15:03 +0000 (03:15 +0000)]
Make these functions more clearly express the test they are performing. No functionality change.

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

11 years agoConsistently use 'needsImplicit<special member>' to determine whether we need
Richard Smith [Sat, 1 Dec 2012 02:35:44 +0000 (02:35 +0000)]
Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.

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

11 years agoTry to make the source location information for token pastes a bit more consistent.
Eli Friedman [Sat, 1 Dec 2012 01:15:54 +0000 (01:15 +0000)]
Try to make the source location information for token pastes a bit more consistent.

Fixes a crash printing diagnostics on the gcc testsuite, and also makes
diagnostic range printing print nicer results for token pastes.

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

11 years agoRemove restriction on combining ubsan with asan or tsan. This has worked for a while.
Richard Smith [Sat, 1 Dec 2012 01:02:45 +0000 (01:02 +0000)]
Remove restriction on combining ubsan with asan or tsan. This has worked for a while.

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

11 years agoFix the determination of whether a capture refers to an enclosing
Douglas Gregor [Sat, 1 Dec 2012 01:01:09 +0000 (01:01 +0000)]
Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>.

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

11 years agoDon't emit a warning with an input/output parameter. We assume the user knows what...
Bill Wendling [Fri, 30 Nov 2012 23:46:56 +0000 (23:46 +0000)]
Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.

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

11 years agoFix test for Windows path separators
Douglas Gregor [Fri, 30 Nov 2012 23:40:49 +0000 (23:40 +0000)]
Fix test for Windows path separators

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

11 years agoTeach the serialized diagnostic writer to clone() itself, sharing
Douglas Gregor [Fri, 30 Nov 2012 23:32:31 +0000 (23:32 +0000)]
Teach the serialized diagnostic writer to clone() itself, sharing
state so that all of the various clones end up rendering their
diagnostics into the same serialized-diagnostics file. This is
important when we actually want failures during module build to be
reported back to the translation unit that tried to import the
not-yet-built or out-of-date module. <rdar://problem/12565727>

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

11 years agoDon't warn if the input size is less than the register size. Also don't warn if
Bill Wendling [Fri, 30 Nov 2012 23:18:12 +0000 (23:18 +0000)]
Don't warn if the input size is less than the register size. Also don't warn if
the output size is greater than the register size. No truncation occurs with
those. Reword warning to make it clearer what's the problem is.

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

11 years agoMake -Wtautological-constant-out-of-range-compare behave sanely for enums with a...
Eli Friedman [Fri, 30 Nov 2012 23:09:29 +0000 (23:09 +0000)]
Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>.

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

11 years agoRename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!
Douglas Gregor [Fri, 30 Nov 2012 22:11:57 +0000 (22:11 +0000)]
Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!

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

11 years agoWhen we're emitting a diagnostic with a source location in an imported
Douglas Gregor [Fri, 30 Nov 2012 21:58:49 +0000 (21:58 +0000)]
When we're emitting a diagnostic with a source location in an imported
module, provide a module import stack similar to what we would get for
an include stack, e.g.,

In module 'DependsOnModule' imported from build-fail-notes.m:4:
In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1:
Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here
@interface Module

<rdar://problem/12696425>

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

11 years agoFixing a precedence issue with my previous commit.
Aaron Ballman [Fri, 30 Nov 2012 21:44:01 +0000 (21:44 +0000)]
Fixing a precedence issue with my previous commit.

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

11 years agoFixing an MSVC warning about an unsafe mixture of Boolean and unsigned types in a...
Aaron Ballman [Fri, 30 Nov 2012 21:15:20 +0000 (21:15 +0000)]
Fixing an MSVC warning about an unsafe mixture of Boolean and unsigned types in a logical operator.

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

11 years agoComments: no need to escape any characters in \code ... \endcode.
Dmitri Gribenko [Fri, 30 Nov 2012 20:04:39 +0000 (20:04 +0000)]
Comments: no need to escape any characters in \code ... \endcode.

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

11 years agoSupport for #pragma region/endregion for MSVC compatibility. Patch thanks to pravic!
Aaron Ballman [Fri, 30 Nov 2012 19:52:30 +0000 (19:52 +0000)]
Support for #pragma region/endregion for MSVC compatibility.  Patch thanks to pravic!

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

11 years agoActually keep track of the source locations at which particular module
Douglas Gregor [Fri, 30 Nov 2012 19:28:05 +0000 (19:28 +0000)]
Actually keep track of the source locations at which particular module
files are loaded.

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

11 years agoWhen an error occurs while building a module on demand, provide "While
Douglas Gregor [Fri, 30 Nov 2012 18:38:50 +0000 (18:38 +0000)]
When an error occurs while building a module on demand, provide "While
building module 'Foo' imported from..." notes (the same we we provide
"In file included from..." notes) in the diagnostic, so that we know
how this module got included in the first place. This is part of
<rdar://problem/12696425>.

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

11 years agoAllow matchers to access the ASTContext.
Manuel Klimek [Fri, 30 Nov 2012 13:45:19 +0000 (13:45 +0000)]
Allow matchers to access the ASTContext.

Patch by Edwin Vane.

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

11 years agoUpdate to reflect the change of macro name in r168993.
Chandler Carruth [Fri, 30 Nov 2012 11:04:44 +0000 (11:04 +0000)]
Update to reflect the change of macro name in r168993.

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

11 years agoFix the computation of highlight ranges so we produce something sane when
Eli Friedman [Fri, 30 Nov 2012 06:19:40 +0000 (06:19 +0000)]
Fix the computation of highlight ranges so we produce something sane when
the beginning and end of the range are in different macro arguments.
PR14399.

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

11 years agoRefactor to reduce duplication in handling of special member functions. No functional...
Richard Smith [Fri, 30 Nov 2012 05:11:39 +0000 (05:11 +0000)]
Refactor to reduce duplication in handling of special member functions. No functionality change.

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

11 years agoAdd a test case for the new cortex-a5 switch
Quentin Colombet [Fri, 30 Nov 2012 01:34:36 +0000 (01:34 +0000)]
Add a test case for the new cortex-a5 switch

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

11 years agoUse the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues.
Jordan Rose [Fri, 30 Nov 2012 01:15:32 +0000 (01:15 +0000)]
Use the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues.

If 'x' is a temporary, x.getAs<Foo>() may not be safe if the result is
supposed to persist (if its address is stored somewhere). Since getAs()
can return a null value, the result is almost always stored into a
variable, which of course is not safe when the original value dies.

This has caused several bugs with GCC's "Temporaries May Vanish Sooner Than
You Expect" optimization; in C++11 builds, at least, we'll be able to catch
these problems now.

I would suggest applying these to other getAs() and get*As() methods
(castAs is "better" because sometimes the result is used directly, which
means the temporary will still be live), but these two have both caused
trouble in the analyzer in the past.

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

11 years agoFix unit tests for ModuleLoader change in r168961.
Douglas Gregor [Fri, 30 Nov 2012 00:01:57 +0000 (00:01 +0000)]
Fix unit tests for ModuleLoader change in r168961.

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

11 years agoKeep track of modules that have failed to build. If we encounter an
Douglas Gregor [Thu, 29 Nov 2012 23:55:25 +0000 (23:55 +0000)]
Keep track of modules that have failed to build. If we encounter an
import of that module elsewhere, don't try to build the module again:
it won't work, and the experience is quite dreadful. We track this
information somewhat globally, shared among all of the related
CompilerInvocations used to build modules on-the-fly, so that a
particular Clang instance will only try to build a given module once.

Fixes <rdar://problem/12552849>.

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

11 years agoFix a small calling-convention bug for x86-32. PR14453.
Eli Friedman [Thu, 29 Nov 2012 23:21:04 +0000 (23:21 +0000)]
Fix a small calling-convention bug for x86-32.  PR14453.

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

11 years agoAdd ARM cortex-a5 subtarget
Quentin Colombet [Thu, 29 Nov 2012 23:15:27 +0000 (23:15 +0000)]
Add ARM cortex-a5 subtarget

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

11 years agoRemove out-of-date comment.
Richard Smith [Thu, 29 Nov 2012 23:09:57 +0000 (23:09 +0000)]
Remove out-of-date comment.

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

11 years agoRevert commit revision r168953, to change the commit message, which was empty
Quentin Colombet [Thu, 29 Nov 2012 23:07:08 +0000 (23:07 +0000)]
Revert commit revision r168953, to change the commit message, which was empty

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

11 years agogit-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168953 91177308-0d34-0410...
Quentin Colombet [Thu, 29 Nov 2012 22:58:40 +0000 (22:58 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168953 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis patch exposes to Clang users three more sanitizers are experimental features...
Alexey Samsonov [Thu, 29 Nov 2012 22:36:21 +0000 (22:36 +0000)]
This patch exposes to Clang users three more sanitizers are experimental features of ASan:
1) init-order sanitizer: initialization-order checker.
Status: usable, but may produce false positives w/o proper blacklisting.
2) use-after-return sanitizer
Status: implemented, but heavily understed.
Should be optional, as it significanlty slows program down.
3) use-after-scope sanitizer
Status: in progress.

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

11 years agoMake the test less sensitive to DWARF emission implementation details.
Eli Bendersky [Thu, 29 Nov 2012 20:01:14 +0000 (20:01 +0000)]
Make the test less sensitive to DWARF emission implementation details.

Note: the ":" goes into the regex because FileCheck wrongly complains about
unbalanced brackets otherwise.

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

11 years agoMake sure that we put the rest of the sanitizer libraries on the link line
Eric Christopher [Thu, 29 Nov 2012 18:51:05 +0000 (18:51 +0000)]
Make sure that we put the rest of the sanitizer libraries on the link line
before libstdc++ like we do with ubsan.

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

11 years agoUse newer command line option here.
Eric Christopher [Thu, 29 Nov 2012 18:08:24 +0000 (18:08 +0000)]
Use newer command line option here.

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

11 years agoRemove duplicate test run lines.
Eric Christopher [Thu, 29 Nov 2012 18:08:22 +0000 (18:08 +0000)]
Remove duplicate test run lines.

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

11 years agoNow that the underlying problem has been fixed, add r168411 back.
Rafael Espindola [Thu, 29 Nov 2012 16:38:22 +0000 (16:38 +0000)]
Now that the underlying problem has been fixed, add r168411 back.
Original commit message:

Remove redundant code.

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

11 years agoMerge function types in C.
Rafael Espindola [Thu, 29 Nov 2012 16:09:03 +0000 (16:09 +0000)]
Merge function types in C.

Among other differences, GCC accepts

  typedef int IA[];
  typedef int A10[10];
  static A10 *f(void);
  static IA  *f(void);
  void g(void) {
    (void)sizeof(*f());
  }

but clang used to reject it with:

  invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []')

The intention of c99's 6.2.7 seems to be that we should use the composite type
and accept as gcc does.

Doing the type merging required some extra fixes:
  * Use the type from the function type in initializations, even if an parameter
    is available.
  * Fix the merging of the noreturn attribute in function types.
  * Make CodeGen  handle the fact that an parameter type can be different from
    the corresponding type in the function type.

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

11 years agoASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Remove i128 stuff. Conditi...
NAKAMURA Takumi [Thu, 29 Nov 2012 10:22:40 +0000 (10:22 +0000)]
ASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Remove i128 stuff. Conditioning-out in macro argument was not accepted on MS cl.exe.

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

11 years agoASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Suppress i128 according...
NAKAMURA Takumi [Thu, 29 Nov 2012 09:57:11 +0000 (09:57 +0000)]
ASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Suppress i128 according to r168856, for now.

I think "i128", that I conditioned out, could be completely removed.
MS Compiler doesn't accept i128. We can assume no one would use i128.

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

11 years ago[-cxx-abi microsoft] Also spill the argument-back-references context when mangling...
Timur Iskhodzhanov [Thu, 29 Nov 2012 08:58:47 +0000 (08:58 +0000)]
[-cxx-abi microsoft] Also spill the argument-back-references context when mangling templates

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

11 years agoReject uses of __int128 on platforms that don't support it. Also move the ugly
Richard Smith [Thu, 29 Nov 2012 05:41:51 +0000 (05:41 +0000)]
Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.

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

11 years agoFix sentence construction-o.
Nico Weber [Thu, 29 Nov 2012 05:29:23 +0000 (05:29 +0000)]
Fix sentence construction-o.

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

11 years agoFix crash-on-invalid. <rdar://problem/12765391>.
Eli Friedman [Thu, 29 Nov 2012 03:13:49 +0000 (03:13 +0000)]
Fix crash-on-invalid.  <rdar://problem/12765391>.

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

11 years agoThe declaration of a special member can require overload resolution to be
Richard Smith [Thu, 29 Nov 2012 01:34:07 +0000 (01:34 +0000)]
The declaration of a special member can require overload resolution to be
performed, to determine whether that special member is deleted or constexpr.
That overload resolution process can in turn trigger the instantiation of a
template, which can do anything, including triggering the declaration of that
very same special member function. When this happens, do not try to recursively
declare the special member -- that's impossible. Instead, only try to realise
the truth. There is no special member.

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

11 years agoChange SValBuilder::getConditionType() to return BoolTy in C++. Fixes <rdar://proble...
Ted Kremenek [Thu, 29 Nov 2012 01:03:10 +0000 (01:03 +0000)]
Change SValBuilder::getConditionType() to return BoolTy in C++.  Fixes <rdar://problem/12772656>.

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

11 years agoCorrectly handle IntegralToBool casts in C++ in the static analyzer. Fixes <rdar...
Ted Kremenek [Thu, 29 Nov 2012 00:50:20 +0000 (00:50 +0000)]
Correctly handle IntegralToBool casts in C++ in the static analyzer.  Fixes <rdar://problem/12759044>.

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

11 years ago[driver] -mkernel implies -mstrict-align; don't add the redundant option.
Chad Rosier [Thu, 29 Nov 2012 00:42:06 +0000 (00:42 +0000)]
[driver] -mkernel implies -mstrict-align; don't add the redundant option.
rdar://12771737

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

11 years agoImplement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to...
Michael Han [Wed, 28 Nov 2012 23:17:40 +0000 (23:17 +0000)]
Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition.

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

11 years agoobjective-C blocks: Make sure that identical logic is used
Fariborz Jahanian [Wed, 28 Nov 2012 23:12:17 +0000 (23:12 +0000)]
objective-C blocks: Make sure that identical logic is used
in deciding a copy/dispose field is needed in a byref structure
and when generating the copy/dispose helpers. In certain
cases, these fields were being added but no copy/dispose was
being generated. This was uncovered in ARC, but not in MRR.
// rdar://12759433

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

11 years agoPer C++11 [except.spec]p2, rvalue references are not permitted in exception specifica...
Richard Smith [Wed, 28 Nov 2012 22:52:42 +0000 (22:52 +0000)]
Per C++11 [except.spec]p2, rvalue references are not permitted in exception specifications.

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

11 years agoPR14388: An array or function type in an exception specification should be
Richard Smith [Wed, 28 Nov 2012 22:33:28 +0000 (22:33 +0000)]
PR14388: An array or function type in an exception specification should be
decayed to a pointer type. Patch by WenHan Gu, with a little tweaking and
additional testcases by me.

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

11 years agoABI: comments from Eli on r168820.
Manman Ren [Wed, 28 Nov 2012 22:29:41 +0000 (22:29 +0000)]
ABI: comments from Eli on r168820.

rdar://12723368

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

11 years agoABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store of
Manman Ren [Wed, 28 Nov 2012 22:08:52 +0000 (22:08 +0000)]
ABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store of
the original parameter or return type.

Since we do not accurately represent the data fields of a union, we should not
directly load or store a union type.

As an exmple, if we have i8,i8, i32, i32 as one field type and i32,i32 as
another field type, the first field type will be chosen to represent the union.
If we load with the union's type, the 3rd byte and the 4th byte will be skipped.

rdar://12723368

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

11 years agoPR13098: If we're instantiating an overloaded binary operator and we could
Richard Smith [Wed, 28 Nov 2012 21:47:39 +0000 (21:47 +0000)]
PR13098: If we're instantiating an overloaded binary operator and we could
determine which member function would be the callee from within the template
definition, don't pass that function as a "non-member function" to
CreateOverloadedBinOp. Instead, just rely on it to select the member function
for itself.

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

11 years ago[analyzer] scan-build: Don't forget to close our temp file for Clang's output.
Jordan Rose [Wed, 28 Nov 2012 19:12:44 +0000 (19:12 +0000)]
[analyzer] scan-build: Don't forget to close our temp file for Clang's output.

Also, minor whitespace/indentation fixes.

Patch by Peeter Joot!

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

11 years ago[analyzer] scan-build: Treat '.C' files as C++.
Jordan Rose [Wed, 28 Nov 2012 19:12:29 +0000 (19:12 +0000)]
[analyzer] scan-build: Treat '.C' files as C++.

Part of PR14443.

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

11 years agoRefactor -fsanitize, -f*-sanitizer arguments parsing. Provide a more careful diagnost...
Alexey Samsonov [Wed, 28 Nov 2012 17:34:24 +0000 (17:34 +0000)]
Refactor -fsanitize, -f*-sanitizer arguments parsing. Provide a more careful diagnostic for invalid sets of sanitizers

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

11 years ago[asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), Clang part.
Kostya Serebryany [Wed, 28 Nov 2012 10:32:11 +0000 (10:32 +0000)]
[asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), Clang part.

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

11 years agoRemove obsolete comment missed by r162937
Andy Gibbs [Wed, 28 Nov 2012 08:14:36 +0000 (08:14 +0000)]
Remove obsolete comment missed by r162937

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

11 years agoTeach Lexer::getSpelling about raw string literals. Specifically, if a raw
Richard Smith [Wed, 28 Nov 2012 07:29:00 +0000 (07:29 +0000)]
Teach Lexer::getSpelling about raw string literals. Specifically, if a raw
string literal needs cleaning (because it contains line-splicing in the
encoding prefix or in the ud-suffix), do not clean the section between the
double-quotes -- that's the "raw" bit!

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