]> granicus.if.org Git - clang/log
clang
10 years agoFix the inconsistent order of parameters in the GetVBaseOffsetFromVBPtr definition...
Timur Iskhodzhanov [Sun, 27 Oct 2013 17:10:27 +0000 (17:10 +0000)]
Fix the inconsistent order of parameters in the GetVBaseOffsetFromVBPtr definition and declaration

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

10 years agoFix option typo.
Rafael Espindola [Sun, 27 Oct 2013 14:46:16 +0000 (14:46 +0000)]
Fix option typo.

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

10 years agoFix option spelling.
Rafael Espindola [Sun, 27 Oct 2013 14:11:19 +0000 (14:11 +0000)]
Fix option spelling.

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

10 years agoUse -target instead of triple and use FileCheck.
Rafael Espindola [Sun, 27 Oct 2013 13:59:51 +0000 (13:59 +0000)]
Use -target instead of triple and use FileCheck.

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

10 years agoAdd trunk revision number on the online HTML docs.
Bill Wendling [Sun, 27 Oct 2013 05:00:50 +0000 (05:00 +0000)]
Add trunk revision number on the online HTML docs.

Patch by Vassil Vassilev.
PR13435

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

10 years agoRemove REQUIRES aarch64-registered-target from test
Alp Toker [Sat, 26 Oct 2013 21:42:32 +0000 (21:42 +0000)]
Remove REQUIRES aarch64-registered-target from test

Registered targets don't matter for Sema tests, this passes fine.

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

10 years agoCheck IR and don't use temporary files.
Rafael Espindola [Sat, 26 Oct 2013 20:55:05 +0000 (20:55 +0000)]
Check IR and don't use temporary files.

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

10 years agoclang-format: Fix ObjC method exprs with variadic parameters.
Daniel Jasper [Sat, 26 Oct 2013 17:00:22 +0000 (17:00 +0000)]
clang-format: Fix ObjC method exprs with variadic parameters.

Before:
  _versionLabel.text = [
    NSString stringWithFormat:NSLocalizedString(@"version: %@", @"Label"),
    [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"]
  ];

After:
  _versionLabel.text =
      [NSString stringWithFormat:NSLocalizedString(@"version: %@", @"Label"),
          [NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"]];

This fixed llvm.org/PR17695.

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

10 years agoFileCheckize
Alp Toker [Sat, 26 Oct 2013 15:43:55 +0000 (15:43 +0000)]
FileCheckize

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

10 years agoQuote wildcard in test's grep argument
Alp Toker [Sat, 26 Oct 2013 14:52:48 +0000 (14:52 +0000)]
Quote wildcard in test's grep argument

The * could otherwise cause shell pathname expansion.

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

10 years agoRemove unused diagnostic.
Benjamin Kramer [Sat, 26 Oct 2013 10:12:33 +0000 (10:12 +0000)]
Remove unused diagnostic.

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

10 years agoSema: Emit a nicer diagnostic when IndirectFieldDecls show up inappropriately in...
David Majnemer [Sat, 26 Oct 2013 06:12:44 +0000 (06:12 +0000)]
Sema: Emit a nicer diagnostic when IndirectFieldDecls show up inappropriately in non-type template arguments

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

10 years agoSema: Correctly build pointer-to-member arguments from a template argument with an...
David Majnemer [Sat, 26 Oct 2013 05:02:13 +0000 (05:02 +0000)]
Sema: Correctly build pointer-to-member arguments from a template argument with an IndirectFieldDecl

We only considered FieldDecl and CXXMethodDecl as appropriate which
would cause us to believe the IndirectFieldDecl corresponded to an
argument of it's field type instead of a pointer-to-member type.

This fixes PR17696.

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

10 years agoclang/test/CodeGenCXX/debug-info-namespace.cpp: Suppress this also on msys, for now...
NAKAMURA Takumi [Sat, 26 Oct 2013 02:04:06 +0000 (02:04 +0000)]
clang/test/CodeGenCXX/debug-info-namespace.cpp: Suppress this also on msys, for now since r193116.

Clang confuses among dosish paths. In this case, "Input/foo.cpp" and "Input\foo.cpp" cannot be unified.

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

10 years ago[analyzer] Don't emit an "Assuming x is <OP> y" if it's not a comparison op.
Jordan Rose [Sat, 26 Oct 2013 01:16:26 +0000 (01:16 +0000)]
[analyzer] Don't emit an "Assuming x is <OP> y" if it's not a comparison op.

We could certainly be more precise in many of our diagnostics, but before we
were printing "Assuming x is && y", which is just ridiculous.

<rdar://problem/15167979>

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

10 years agoObjectiveC arc. Warn when an implicitly 'strong' property
Fariborz Jahanian [Sat, 26 Oct 2013 00:35:39 +0000 (00:35 +0000)]
ObjectiveC arc. Warn when an implicitly 'strong' property
is redeclared as 'weak' in class extension.
// rdar://15304886

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

10 years agoDocument that -fsanitize=function is Linux-only.
Peter Collingbourne [Sat, 26 Oct 2013 00:21:57 +0000 (00:21 +0000)]
Document that -fsanitize=function is Linux-only.

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

10 years agoSkip this test when using lit integrated shell
Alp Toker [Fri, 25 Oct 2013 22:30:07 +0000 (22:30 +0000)]
Skip this test when using lit integrated shell

It wasn't passing on UNIX with LIT_USE_INTERNAL_SHELL=1
due to cat globbing.

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

10 years agoMinor performance improvement to not do unnecessary work
Fariborz Jahanian [Fri, 25 Oct 2013 22:04:47 +0000 (22:04 +0000)]
Minor performance improvement to not do unnecessary work
in my last patch. // rdar://14989999

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

10 years agoObjectiveC: under -Wunused-property-ivar warn if property's
Fariborz Jahanian [Fri, 25 Oct 2013 21:44:50 +0000 (21:44 +0000)]
ObjectiveC: under -Wunused-property-ivar warn if property's
backing warning is not used in one of its accessor methods.
// rdar://14989999

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

10 years agoclang-format.py: Make formatting unnamed buffers work again (broke in r190691).
Nico Weber [Fri, 25 Oct 2013 20:06:20 +0000 (20:06 +0000)]
clang-format.py: Make formatting unnamed buffers work again (broke in r190691).

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

10 years agoDon't check for -L options that gcc doesn't use.
Rafael Espindola [Fri, 25 Oct 2013 19:44:29 +0000 (19:44 +0000)]
Don't check for -L options that gcc doesn't use.

GCC on fedora 18 ARM only uses 2 -L options. Clang prints two extra ones, but
we should not include them in the test as they are not required.

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

10 years agoI am about to change llvm::MemoryBuffer::getFile take take a Twine. Change
Rafael Espindola [Fri, 25 Oct 2013 19:00:49 +0000 (19:00 +0000)]
I am about to change llvm::MemoryBuffer::getFile take take a Twine. Change
clang first so that the build still works.

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

10 years agoJust detect a distro as being fedora or not.
Rafael Espindola [Fri, 25 Oct 2013 18:09:41 +0000 (18:09 +0000)]
Just detect a distro as being fedora or not.

We don't have any checks that depend on the version of fedora, so we can
simplify.

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

10 years agoMerge two adjacent ifs.
Rafael Espindola [Fri, 25 Oct 2013 17:06:04 +0000 (17:06 +0000)]
Merge two adjacent ifs.

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

10 years agoAdd -Wstring-plus-char, which warns when adding char literals to C strings.
Jordan Rose [Fri, 25 Oct 2013 16:52:00 +0000 (16:52 +0000)]
Add -Wstring-plus-char, which warns when adding char literals to C strings.

Specifically, this warns when a character literal is added (using '+') to a
variable with type 'char *' (or any other pointer to character type). Like
-Wstring-plus-int, there is a fix-it to change "foo + 'a'" to "&foo['a']"
iff the character literal is on the right side of the string.

Patch by Anders Rönnholm!

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

10 years agoUsed OwningPtr to clean up some memory management in Consumed.cpp.
Chris Wailes [Fri, 25 Oct 2013 15:33:28 +0000 (15:33 +0000)]
Used OwningPtr to clean up some memory management in Consumed.cpp.

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

10 years agoclang-format: Adapt line break penalties for LLVM style.
Daniel Jasper [Fri, 25 Oct 2013 14:29:37 +0000 (14:29 +0000)]
clang-format: Adapt line break penalties for LLVM style.

Specifically make clang-format less eager to break after the opening
parenthesis of a function call.

Before:
  aaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
                        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

Apparently that is preferable. This penalties are adapted
conservatively, we might have to increase them a little bit further.

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

10 years agoSema: Do not allow lambda expressions to appear inside of constant expressions
David Majnemer [Fri, 25 Oct 2013 09:12:52 +0000 (09:12 +0000)]
Sema: Do not allow lambda expressions to appear inside of constant expressions

We would previously not diagnose this which would lead to crashes (on
very strange code).

This fixes PR17675.

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

10 years agoRemove dead variables.
Benjamin Kramer [Fri, 25 Oct 2013 07:40:50 +0000 (07:40 +0000)]
Remove dead variables.

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

10 years agoConsider used attributes in hidden decls.
Rafael Espindola [Fri, 25 Oct 2013 01:28:12 +0000 (01:28 +0000)]
Consider used attributes in hidden decls.

Without this patch we would warn and fail to output the function in the test.

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

10 years agoSimplify and refactor the uninitialized field warning.
Richard Trieu [Fri, 25 Oct 2013 00:56:00 +0000 (00:56 +0000)]
Simplify and refactor the uninitialized field warning.

Change the uninitialized field warnings so that field initializers are checked
inside the constructor.  Previously, in class initializers were checked
separately.  Running one set of checks also simplifies the logic for preventing
duplicate warnings.  Added new checks to warn when an uninitialized field is
used in base class initialization.  Also fixed misspelling of uninitialized
and moved all code for this warning together.

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

10 years agoRefactor: Extract specializing the generic lambda call operator during conversion...
Faisal Vali [Thu, 24 Oct 2013 23:40:02 +0000 (23:40 +0000)]
Refactor: Extract specializing the generic lambda call operator during conversion to fptr deduction into its own function.

No functionality change.

All clang regression tests pass.

Thanks!

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

10 years agoRemove unused CodeGenOptions from CodeGenTypes.
Mark Lacey [Thu, 24 Oct 2013 22:08:55 +0000 (22:08 +0000)]
Remove unused CodeGenOptions from CodeGenTypes.

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

10 years agoAdd driver support for FP, SIMD and crypto defaults.
Bernard Ogden [Thu, 24 Oct 2013 18:32:51 +0000 (18:32 +0000)]
Add driver support for FP, SIMD and crypto defaults.

Although we wire up a bit for v8fp for macro setting
purposes, we don't set a macro yet. Need to ask list
about that.

Change-Id: Ic9819593ce00882fbec72757ffccc6f0b18160a0

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

10 years agoClean up char/numeric comparisons in ARM getTargetDefines
Bernard Ogden [Thu, 24 Oct 2013 18:32:44 +0000 (18:32 +0000)]
Clean up char/numeric comparisons in ARM getTargetDefines

Change-Id: Ie07228411b68252adcd5cf80b27ccd2eb3b031d9

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

10 years agoSet appropriate FPU default for Linux on v8
Bernard Ogden [Thu, 24 Oct 2013 18:32:41 +0000 (18:32 +0000)]
Set appropriate FPU default for Linux on v8

Change-Id: If9b649c92e7196e3e791948545dc80901a0761eb

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

10 years agoTeach clang driver about Cortex-A53 and Cortex-A57.
Bernard Ogden [Thu, 24 Oct 2013 18:32:36 +0000 (18:32 +0000)]
Teach clang driver about Cortex-A53 and Cortex-A57.

Adds some Cortex-A53 strings where they were missing before.
Cortex-A57 is entirely new to clang.

Doesn't touch code only used by Darwin, in consequence of which
one of the A53 lines has been removed.

Change-Id: I5edb58f6eae93947334787e26a8772c736de6483

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

10 years agoObjectiveC IRGen. Replace _objc_empty_vtable pointer in Objective-C
Fariborz Jahanian [Thu, 24 Oct 2013 17:40:28 +0000 (17:40 +0000)]
ObjectiveC IRGen. Replace _objc_empty_vtable pointer in Objective-C
class metadata for certain deployment targets. // rdar://14802916

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

10 years agoRevert "Tooling/ReplacementsYaml.h: Prune Tooling's llvm::yaml::ScalarTraits<std...
Argyrios Kyrtzidis [Thu, 24 Oct 2013 15:49:10 +0000 (15:49 +0000)]
Revert "Tooling/ReplacementsYaml.h: Prune Tooling's llvm::yaml::ScalarTraits<std::string> corresponding to LLVM r193344."

This reverts commit r193350, because it addressed an llvm API change that has been reverted.

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

10 years agoclang-format: Properly reset nested AnnotatedLine structure.
Daniel Jasper [Thu, 24 Oct 2013 15:23:11 +0000 (15:23 +0000)]
clang-format: Properly reset nested AnnotatedLine structure.

This fixes llvm.org/PR17682.

Without this patch, the following code leads to invalid reads/writes:
  DEBUG({
    return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
  });
  #if a
  #else
  #endif

Because of the #if-#else structure, the code is formatted and annotated
twice and becauce of the nested block, the annotated lines form a
hierarchical structure. This structure was not properly reset between
runs.

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

10 years agoReplaced duplicate code with calls to forwardInfo.
Chris Wailes [Thu, 24 Oct 2013 14:28:17 +0000 (14:28 +0000)]
Replaced duplicate code with calls to forwardInfo.

Also made move constructor handling safer.

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

10 years agoTooling/ReplacementsYaml.h: Prune Tooling's llvm::yaml::ScalarTraits<std::string...
NAKAMURA Takumi [Thu, 24 Oct 2013 14:24:30 +0000 (14:24 +0000)]
Tooling/ReplacementsYaml.h: Prune Tooling's llvm::yaml::ScalarTraits<std::string> corresponding to LLVM r193344.

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

10 years agoclang-format: Be more conservative about column layout formatting.
Daniel Jasper [Thu, 24 Oct 2013 14:14:49 +0000 (14:14 +0000)]
clang-format: Be more conservative about column layout formatting.

Specifically, if a braced list has at least one nested braced list,
format it either all on one line or in one column (i.e. one item per
line).

This seems in general to be an improvement as the structure of nested
braced lists can make a tightly packed outer braced list hard to read.

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

10 years agoARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archs
Tim Northover [Thu, 24 Oct 2013 10:48:50 +0000 (10:48 +0000)]
ARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archs

These arch arguments are used for embedded targets (obviously) which need a
different calling convention to iOS.

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

10 years agoclang-format: Cleanup array initializer and dict initializer formatting.
Daniel Jasper [Thu, 24 Oct 2013 10:31:50 +0000 (10:31 +0000)]
clang-format: Cleanup array initializer and dict initializer formatting.

Significant changes:
- Also recognize these literals with missing "@" for robustness.
- Reorganize tests.

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

10 years agoTeach Clang to accept and ignore -f[no-]implicit-templates.
Chandler Carruth [Thu, 24 Oct 2013 09:21:37 +0000 (09:21 +0000)]
Teach Clang to accept and ignore -f[no-]implicit-templates.

This GCC flag is useful when you want to control whether implicit
template instantiation occurs at the commandline level. Clang doesn't
currently support such controls, but technically *always* implicitly
instantiating (what Clang does, and what every other compiler still in
use does by default) is valid behavior even under
-fno-implicit-templates, it just may be slow and very wasteful. If
people really want this, we can try to implement it, but I don't have an
actual use.

This should help fix the build of libstdc++ with Clang, its build system
uses this flag.

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

10 years agoTeach Clang to recognize and ignore GCC's -fdiagnostics-show-location
Chandler Carruth [Thu, 24 Oct 2013 09:17:35 +0000 (09:17 +0000)]
Teach Clang to recognize and ignore GCC's -fdiagnostics-show-location
flag. We should probably wire at least some variants of this up to our
actual diagnostics engine, but I'm leaving that for someone else. This
fixes the builds of packages which hard code something here, at least
including libstdc++ itself.

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

10 years agoUse the same SourceManager for ModuleMaps and compilations.
Manuel Klimek [Thu, 24 Oct 2013 07:51:24 +0000 (07:51 +0000)]
Use the same SourceManager for ModuleMaps and compilations.

This allows using virtual file mappings on the original SourceManager to
map in virtual module.map files. Without this patch, the ModuleMap
search will find a module.map file (as the FileEntry exists in the
FileManager), but will be unable to get the content from the
SourceManager (as ModuleMap previously created its own SourceManager).

Two problems needed to be fixed which this patch exposed:

1. Storing the inferred module map
When writing out a module, the ASTWriter stores the names of the files
in the main source manager; when loading the AST again, the ASTReader
errs out if such a file is found missing, unless it is overridden.
Previously CompilerInstance's compileModule method would store the
inferred module map to a temporary file; the problem with this approach
is that now that the module map is handled by the main source manager,
the ASTWriter stores the name of the temporary module map as source to
the compilation; later, when the module is loaded, the temporary file
has already been deleted, which leads to a compilation error. This patch
changes the inferred module map to instead inject a virtual file into
the source manager. This both saves some disk IO, and works with how the
ASTWriter/ASTReader handle overridden source files.

2. Changing test input in test/Modules/Inputs/*
Now that the module map file is handled by the main source manager, the
VerifyDiagnosticConsumer will not ignore diagnostics created while
parsing the module map file. The module test test/Modules/renamed.m uses
-I test/Modules/Inputs and triggers recursive loading of all module maps
in test/Modules/Inputs, some of which had conflicting names, thus
leading errors while parsing the module maps. Those diagnostics already
occur on trunk, but before this patch they would not break the test, as
they were ignored by the VerifyDiagnosticConsumer. This patch thus
changes the module maps that have been recently introduced which broke
the invariant of compatible modules maps in test/Modules/Inputs.

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

10 years agoRemove dead recursive function.
Benjamin Kramer [Thu, 24 Oct 2013 07:39:30 +0000 (07:39 +0000)]
Remove dead recursive function.

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

10 years agoSupport GNU attributes in alias-declarations now that GCC has implemented them
Richard Smith [Thu, 24 Oct 2013 01:21:09 +0000 (01:21 +0000)]
Support GNU attributes in alias-declarations now that GCC has implemented them
and we know where they go.

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

10 years agoFix a test file option from -emit-llvm -o to -emit-llvm-only.
Faisal Vali [Thu, 24 Oct 2013 01:11:55 +0000 (01:11 +0000)]
Fix a test file option from -emit-llvm -o to -emit-llvm-only.

As requested by Rafael Espindola here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091556.html

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

10 years agoPR17666: Instead of allowing an initial identifier argument in any attribute
Richard Smith [Thu, 24 Oct 2013 01:07:54 +0000 (01:07 +0000)]
PR17666: Instead of allowing an initial identifier argument in any attribute
which we don't think can't have one, only allow it in the tiny number of
attributes which opts into this weird parse rule.

I've manually checked that the handlers for all these attributes can in fact
cope with an identifier as the argument. This is still somewhat terrible; we
should move more fully towards picking the parsing rules based on the
attribute, and make the Parse -> Sema interface more type-safe.

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

10 years agoFix an instantiation bug with nested generic lambdas and conversion to fptrs.
Faisal Vali [Thu, 24 Oct 2013 01:05:22 +0000 (01:05 +0000)]
Fix an instantiation bug with nested generic lambdas and conversion to fptrs.

This patch fixes the typelocs of the conversion-operator and the conversion-operator-name and adds the parameters of the call operator to the FunctionProtoTypeLoc of the respective entities. Thus, when the template declarations (conversion operators) undergo deduction and instantiation/transformation/substitution - they add themselves to the local instantiation scope if needed.

This patch supports the following:

auto L = [](auto b) {
  return [](auto a) ->decltype(a) { return a; };
};
int (*fp)(int) = L(8);

Richard LGTM'd this patch: http://llvm-reviews.chandlerc.com/D1831

Thanks!

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

10 years agoUndoing accidental change to docs/LanguageExtensions.rst in my previous
Warren Hunt [Thu, 24 Oct 2013 00:59:24 +0000 (00:59 +0000)]
Undoing accidental change to docs/LanguageExtensions.rst in my previous
patch.

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

10 years agoImplements 64 bit microsoft record layout and adds lit tests to cover
Warren Hunt [Wed, 23 Oct 2013 23:53:07 +0000 (23:53 +0000)]
Implements 64 bit microsoft record layout and adds lit tests to cover
it.  Also removes all of the microsoft C++ ABI related code from the
itanium layout builder.

Differential Revision: http://llvm-reviews.chandlerc.com/D2003

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

10 years agoMore wordsmithing on objc_requires_super documentation.
Ted Kremenek [Wed, 23 Oct 2013 23:30:08 +0000 (23:30 +0000)]
More wordsmithing on objc_requires_super documentation.

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

10 years agoWordsmith text of objc_requires_super.
Ted Kremenek [Wed, 23 Oct 2013 22:41:52 +0000 (22:41 +0000)]
Wordsmith text of objc_requires_super.

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

10 years agoFix typo.
Ted Kremenek [Wed, 23 Oct 2013 22:25:59 +0000 (22:25 +0000)]
Fix typo.

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

10 years agoProvide documentation on attribute((objc_requires_super)).
Ted Kremenek [Wed, 23 Oct 2013 22:15:01 +0000 (22:15 +0000)]
Provide documentation on attribute((objc_requires_super)).

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

10 years agoChange title of section to reflect the concept, and not the mechanism.
Ted Kremenek [Wed, 23 Oct 2013 22:14:59 +0000 (22:14 +0000)]
Change title of section to reflect the concept, and not the mechanism.

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

10 years agoParse: Disable delayed template parsing for constexpr functions
David Majnemer [Wed, 23 Oct 2013 21:31:20 +0000 (21:31 +0000)]
Parse: Disable delayed template parsing for constexpr functions

Commit r191484 treated constexpr function templates as normal function
templates with respect to delaying their parsing.  However, this is
unnecessarily restrictive because there is no compatibility concern with
constexpr, MSVC doesn't support it.

Instead, simply disable delayed template parsing for constexpr function
templates.  This largely reverts the changes made in r191484 but keeps
it's unit test.

This fixes PR17661.

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

10 years agoAST: Mangle fields in anonymous structs/unions
David Majnemer [Wed, 23 Oct 2013 20:52:43 +0000 (20:52 +0000)]
AST: Mangle fields in anonymous structs/unions

The Itanium mangler couldn't cope with mangling an IndirectFieldDecl.
Instead, mangle the field the IndirectFieldDecl refers to.

Further, give IndirectFieldDecl no linkage just like FieldDecl.

N.B. Decl.cpp:getLVForNamespaceScopeDecl tried to calculate linkage for
data members of anonymous structs/unions.  However, this seems
impossible so turn it into an assertion.

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

10 years agoIntrinsics: fix extract & insert when index is out of bound.
Manman Ren [Wed, 23 Oct 2013 20:33:14 +0000 (20:33 +0000)]
Intrinsics: fix extract & insert when index is out of bound.

Now, all extract & insert intrinsics should have the correct and operation
to ignore higher bits.

rdar://15250497

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

10 years ago[analyzer] Generate a LazyCompoundVal when loading from a union-typed region.
Jordan Rose [Wed, 23 Oct 2013 20:08:55 +0000 (20:08 +0000)]
[analyzer] Generate a LazyCompoundVal when loading from a union-typed region.

This ensures that variables accessible through a union are invalidated when
the union value is passed to a function. We still don't fully handle union
values, but this should at least quiet some false positives.

PR16596

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

10 years agoA decl never becomes unused. Make that explicit in the API.
Rafael Espindola [Wed, 23 Oct 2013 16:46:34 +0000 (16:46 +0000)]
A decl never becomes unused. Make that explicit in the API.

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

10 years agoRefactor out the circular reference to LambdaExpr in CXXRecordDecl.
Faisal Vali [Wed, 23 Oct 2013 16:10:50 +0000 (16:10 +0000)]
Refactor out the circular reference to LambdaExpr in CXXRecordDecl.

A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test.  The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html.  Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box).

Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier.

No change in functionality.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested):
http://llvm-reviews.chandlerc.com/D1856

Thanks!

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

10 years ago[mips][msa] Add intrinsics that map to pseudo-instructions.
Daniel Sanders [Wed, 23 Oct 2013 10:12:44 +0000 (10:12 +0000)]
[mips][msa] Add intrinsics that map to pseudo-instructions.

Unlike the previously added intrinsics, these do not map to a single instruction
on MIPS32. They are provided for regularity (to round out the .[bhw] variants
of the same operation) and compatibility with GCC.

Includes:
  copy_[us].d, fill.d, insert.d, insve.d

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

10 years agoAnd Again: Teach TreeTransform how to transform nested generic lambdas.
Faisal Vali [Wed, 23 Oct 2013 06:44:28 +0000 (06:44 +0000)]
And Again: Teach TreeTransform how to transform nested generic lambdas.

A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,

The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType.  This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.

Another attempt caused a test to fail (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091533.html) and also had to be reverted - my apologies - in my haste, i did not run all the tests - argh!

Now all the tests seem to pass - but a Fixme has been added - since I suspect Richard will find the fix a little inelegant ;) I shall try and work on a more elegant fix once I have had a chance to discuss with Richard or Doug at a later date.

Hopefully the third time;s a charm *fingers crossed*

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784

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

10 years agoRevert r193223 and r193216.
Rafael Espindola [Wed, 23 Oct 2013 04:12:23 +0000 (04:12 +0000)]
Revert r193223 and r193216.

They were causing CodeGenCXX/mangle-exprs.cpp to fail.

Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl."

Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves."

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

10 years agoRemove the circular reference to LambdaExpr in CXXRecordDecl.
Faisal Vali [Wed, 23 Oct 2013 02:59:27 +0000 (02:59 +0000)]
Remove the circular reference to LambdaExpr in CXXRecordDecl.

Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

No change in functionality.

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested):
http://llvm-reviews.chandlerc.com/D1856

Thanks!

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

10 years agoMake UsingShadowDecls redeclarable. This fixes some visibility problems with
Richard Smith [Wed, 23 Oct 2013 02:17:46 +0000 (02:17 +0000)]
Make UsingShadowDecls redeclarable. This fixes some visibility problems with
modules.

With this fixed, I no longer see any test regressions in the libc++ test suite
when enabling a single-module module.map for libc++ (other than issues with my
system headers).

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

10 years agoAgain: Teach TreeTransform and family how to transform generic
Faisal Vali [Wed, 23 Oct 2013 00:51:58 +0000 (00:51 +0000)]
Again: Teach TreeTransform and family how to transform generic
lambdas nested within templates and themselves.

A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,

The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType.  This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784

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

10 years agoTeach AST dumper to dump the containing module and hidden flag for declarations.
Richard Smith [Tue, 22 Oct 2013 23:50:38 +0000 (23:50 +0000)]
Teach AST dumper to dump the containing module and hidden flag for declarations.

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

10 years agoCFG: Properly print delegating initializer CFG elements.
Jordan Rose [Tue, 22 Oct 2013 23:19:47 +0000 (23:19 +0000)]
CFG: Properly print delegating initializer CFG elements.

...rather than segfaulting.

Patch by Enrico P!

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

10 years agoRetain previous language linkage of friend function declarations
Alp Toker [Tue, 22 Oct 2013 22:53:01 +0000 (22:53 +0000)]
Retain previous language linkage of friend function declarations

With this extension, friend function declarations will retain the language
linkage specified for previous declarations instead of emitting an error
diagnostic.

The feature is known to be compatible with GCC and MSVC and permits a
language to be specified indirectly where it cannot otherwise be written
directly in class scope.

Work is ongoing to improve linkage spec diagnostics.

Fixes PR17337.

Reviewed by Richard Smith.

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

10 years agoSplit -fsanitize=bounds to -fsanitize=array-bounds (for the frontend-inserted
Richard Smith [Tue, 22 Oct 2013 22:51:04 +0000 (22:51 +0000)]
Split -fsanitize=bounds to -fsanitize=array-bounds (for the frontend-inserted
check using the ubsan runtime) and -fsanitize=local-bounds (for the middle-end
check which inserts traps).

Remove -fsanitize=local-bounds from -fsanitize=undefined. It does not produce
useful diagnostics and has false positives (PR17635), and is not a good
compromise position between UBSan's checks and ASan's checks.

Map -fbounds-checking to -fsanitize=local-bounds to restore Clang's historical
behavior for that flag.

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

10 years agoSema: Allow IndirectFieldDecl to appear in a non-type template argument
David Majnemer [Tue, 22 Oct 2013 21:56:38 +0000 (21:56 +0000)]
Sema: Allow IndirectFieldDecl to appear in a non-type template argument

We would not identify pointer-to-member construction in a non-type
template argument if it was either a FieldDecl or a CXXMethodDecl.
However, this would incorrectly reject declarations that were injected
via an IndirectFieldDecl (e.g. a field inside of an anonymous union).

This fixes PR17657.

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

10 years agoConsider hidden decls for isUsed checks.
Rafael Espindola [Tue, 22 Oct 2013 21:56:29 +0000 (21:56 +0000)]
Consider hidden decls for isUsed checks.

This fixes pr17624.

A FIXME from Richard Smith:

It seems to me that the root cause is that a per-Decl 'used' flag doesn't
really make much sense in the way we use it now. I think we should either track
whether that particular declaration is used (with isUsed scanning the entire
redecl chain), or we should only have one flag for the entire redeclaration
chain (perhaps by always looking at the flag on either the most recent decl or
the canonical decl). Modeling it as "is this declaration or any previous
declaration used" is weird, and requires contortions like the loop at the end
of Sema::MarkFunctionReferenced.

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

10 years agoTreat aliases as definitions.
Rafael Espindola [Tue, 22 Oct 2013 21:39:03 +0000 (21:39 +0000)]
Treat aliases as definitions.

This fixes pr17639.

Before this patch clang would consider

void foo(void) __attribute((alias("__foo")));

a declaration. It now correctly handles it as a definition.

Initial patch by Alp Toker. I added support for variables.

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

10 years agoNew fix for pr17535.
Rafael Espindola [Tue, 22 Oct 2013 19:26:13 +0000 (19:26 +0000)]
New fix for pr17535.

This is a fixed version of r193161. In order to handle

    void foo() __attribute__((alias("bar")));
    void bar() {}
    void zed() __attribute__((alias("foo")));

it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.

This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.

This patch also handles cyclic aliases.

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

10 years ago_mm_extract_epi16: use "& 7" when index is out of bound.
Manman Ren [Tue, 22 Oct 2013 19:24:42 +0000 (19:24 +0000)]
_mm_extract_epi16: use "& 7" when index is out of bound.

This is in line with implementation of _mm_extract_pi16.
rdar://15250497

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

10 years ago[analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.
Jordan Rose [Tue, 22 Oct 2013 18:55:18 +0000 (18:55 +0000)]
[analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.

Some of the shared compiler/linker flags start with -m, so they've been
getting passed to the compiler only since r180073. Now, the -m* wildcard
is processed after the shared flags and the ignored flags.

Found by Laszlo Nagy!

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

10 years agoUse GEPs correctly when adjusting this in MicrosoftCXXABI
Timur Iskhodzhanov [Tue, 22 Oct 2013 18:15:24 +0000 (18:15 +0000)]
Use GEPs correctly when adjusting this in MicrosoftCXXABI

Reviewed at http://llvm-reviews.chandlerc.com/D1977

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

10 years agoRevert r193073 and the attempt to fix it in r193170.
Chandler Carruth [Tue, 22 Oct 2013 18:07:04 +0000 (18:07 +0000)]
Revert r193073 and the attempt to fix it in r193170.

This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.

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

10 years agoReenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'
Serge Pavlov [Tue, 22 Oct 2013 17:14:47 +0000 (17:14 +0000)]
Reenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'

This is a fix to PR17649, caused by fix in r193073. QT uses 'break' statement
to implement their 'foreach' macro. To enable build of QT, this fix reenables
break but only in 'for' statement specifier and only in the third expression.

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

10 years agoclang-format: Fix ObjC literal indentation in Google style.
Daniel Jasper [Tue, 22 Oct 2013 15:45:58 +0000 (15:45 +0000)]
clang-format: Fix ObjC literal indentation in Google style.

Style guide demands a two-space indent.

Before:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

After:
  NSArray *arguments = @[
    kind == kUserTicket ? @"--user-store" : @"--system-store",
    @"--print-tickets",
    @"--productid",
    @"com.google.Chrome"
  ];

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

10 years agoclang-format: Improve formatting of ObjC array literals.
Daniel Jasper [Tue, 22 Oct 2013 15:30:28 +0000 (15:30 +0000)]
clang-format: Improve formatting of ObjC array literals.

Before:
  NSArray *arguments =
      @[ kind == kUserTicket ? @"--user-store" : @"--system-store",
         @"--print-tickets", @"--productid", @"com.google.Chrome" ];
After:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

This fixes llvm.org/PR15231.

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

10 years agoUse early return. No functionality change.
Rafael Espindola [Tue, 22 Oct 2013 15:18:22 +0000 (15:18 +0000)]
Use early return. No functionality change.

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

10 years agoDrop the unneeded VBase field from MethodInfo in the VFTableBuilder class
Timur Iskhodzhanov [Tue, 22 Oct 2013 14:50:20 +0000 (14:50 +0000)]
Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class

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

10 years agoRevert "This patch causes clang to reject alias attributes that point to undefined...
Rafael Espindola [Tue, 22 Oct 2013 14:23:09 +0000 (14:23 +0000)]
Revert "This patch causes clang to reject alias attributes that point to undefined names. For example, with this patch we now reject"

This reverts commit r193161.

It broke

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));

Looks like we have to fix pr17639 first :-(

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

10 years agoThis patch causes clang to reject alias attributes that point to undefined
Rafael Espindola [Tue, 22 Oct 2013 13:51:06 +0000 (13:51 +0000)]
This patch causes clang to reject alias attributes that point to undefined
names. For example, with this patch we now reject

void f1(void) __attribute__((alias("g1")));

This patch is implemented in CodeGen. It is quiet a bit simpler and more
compatible with gcc than implementing it in Sema. The downside is that the
errors only fire during -emit-llvm.

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

10 years agoFix comment typo
Alp Toker [Tue, 22 Oct 2013 09:00:49 +0000 (09:00 +0000)]
Fix comment typo

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

10 years agoRemove incorrect assert.
Manuel Klimek [Tue, 22 Oct 2013 08:27:19 +0000 (08:27 +0000)]
Remove incorrect assert.

If we run into the second preprocessor branch chain, the first branch
chain might have already set the maximum branch count on that level to
something > 0.

Fixes PR17645.

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

10 years agoAllow a header to be part of multiple modules.
Daniel Jasper [Tue, 22 Oct 2013 08:09:47 +0000 (08:09 +0000)]
Allow a header to be part of multiple modules.

This patch changes two things:

a) Allow a header to be part of multiple modules. The reasoning is that
in existing codebases that have a module-like build system, the same
headers might be used in several build targets. Simple reasons might be
that they defined different classes that are declared in the same
header. Supporting a header as a part of multiple modules will make the
transistion easier for those cases. A later step in clang can then
determine whether the two modules are actually compatible and can be
merged and error out appropriately. The later check is similar to what
needs to be done for template specializations anyway.

b) Allow modules to be stored in a directory tree separate from the
headers they describe.

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

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

10 years agoSema: Do not allow template declarations inside local classes
David Majnemer [Tue, 22 Oct 2013 04:14:18 +0000 (04:14 +0000)]
Sema: Do not allow template declarations inside local classes

Summary:
Enforce the rule in C++11 [temp.mem]p2 that local classes cannot have
member templates.

This fixes PR16947.

N.B.  C++14 has slightly different wording to afford generic lambdas
declared inside of functions.

Fun fact:  Some formulations of local classes with member templates
would cause clang to crash during Itanium mangling, such as the
following:

void outer_mem() {
  struct Inner {
    template <typename = void>
    struct InnerTemplateClass {
      static void itc_mem() {}
    };
  };
  Inner::InnerTemplateClass<>::itc_mem();
}

Reviewers: eli.friedman, rsmith, doug.gregor, faisalv

Reviewed By: doug.gregor

CC: cfe-commits, ygao
Differential Revision: http://llvm-reviews.chandlerc.com/D1866

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

10 years agoRevert "Re-enable passing MS inline asm test."
Reid Kleckner [Mon, 21 Oct 2013 22:56:09 +0000 (22:56 +0000)]
Revert "Re-enable passing MS inline asm test."

Microsoft inline asm crashes on the hexagon bot for unknown reasons.

This reverts commit r193124.

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

10 years agoRe-enable passing MS inline asm test.
Reid Kleckner [Mon, 21 Oct 2013 22:30:53 +0000 (22:30 +0000)]
Re-enable passing MS inline asm test.

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

10 years agoRevert "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."
Reid Kleckner [Mon, 21 Oct 2013 22:26:36 +0000 (22:26 +0000)]
Revert "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."

This reverts commit r193100.

It was failing to compile with MSVC 2012 while instantiating
llvm::Optional<DynTypedMatcher>.

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

10 years agoUpdated and added to the Consumed documentation.
Chris Wailes [Mon, 21 Oct 2013 20:54:06 +0000 (20:54 +0000)]
Updated and added to the Consumed documentation.

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