]> granicus.if.org Git - clang/log
clang
11 years agoTest case for r165275.
Chad Rosier [Thu, 4 Oct 2012 23:59:54 +0000 (23:59 +0000)]
Test case for r165275.

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

11 years agoIf we flow off the end of a value-returning function:
Richard Smith [Thu, 4 Oct 2012 23:52:29 +0000 (23:52 +0000)]
If we flow off the end of a value-returning function:
 - outside C++, return undef (behavior is not undefined unless the value is used)
 - in C++, with -fcatch-undefined-behavior, perform an appropriate trap
 - in C++, produce an 'unreachable' (behavior is undefined immediately)

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

11 years agolibstdc++-4.6 needs the same common_type fix as libstdc++-4.7. Other than that,
Richard Smith [Thu, 4 Oct 2012 22:23:07 +0000 (22:23 +0000)]
libstdc++-4.6 needs the same common_type fix as libstdc++-4.7. Other than that,
Clang can now cope with its eccentricities in C++11 mode.

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

11 years agoEgriegious hack to support libstdc++4.6's broken <atomic> header, which defines
Richard Smith [Thu, 4 Oct 2012 22:13:39 +0000 (22:13 +0000)]
Egriegious hack to support libstdc++4.6's broken <atomic> header, which defines
a non-inline namespace, then reopens it as inline to try to add its symbols to
the surrounding namespace. In this one special case, permit the namespace to be
reopened as inline, and patch up the name lookup tables to match.

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

11 years agoFixed FunctionTypeLoc source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:42:10 +0000 (21:42 +0000)]
Fixed FunctionTypeLoc source range.

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

11 years agoFixed instantiated operators source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:40:42 +0000 (21:40 +0000)]
Fixed instantiated operators source range.

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

11 years agoFixed friend decl source range.
Abramo Bagnara [Thu, 4 Oct 2012 21:39:47 +0000 (21:39 +0000)]
Fixed friend decl source range.

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

11 years agoFixed ParamDecl source range for implicit typed k&r parameters.
Abramo Bagnara [Thu, 4 Oct 2012 21:38:29 +0000 (21:38 +0000)]
Fixed ParamDecl source range for implicit typed k&r parameters.

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

11 years agoFix the CodeGen/ppc64-varargs-struct.c test case to tolerate release builds.
Bill Schmidt [Thu, 4 Oct 2012 20:33:57 +0000 (20:33 +0000)]
Fix the CodeGen/ppc64-varargs-struct.c test case to tolerate release builds.

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

11 years agoAdd a test case for r156143, which enabled general varargs support for the
Bill Schmidt [Thu, 4 Oct 2012 20:18:38 +0000 (20:18 +0000)]
Add a test case for r156143, which enabled general varargs support for the
64-bit PPC SVR4 ABI.

The test verifies passing of structures, items with 16-byte alignment, and
small items that are passed right-justified in the parameter save area slot.

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

11 years agoDriver: Link crtfastmath.o if it's available and -ffast-math is specified.
Benjamin Kramer [Thu, 4 Oct 2012 19:42:20 +0000 (19:42 +0000)]
Driver: Link crtfastmath.o if it's available and -ffast-math is specified.

crtfastmath.o contains routines to set the floating point flags to a faster,
unsafe mode. Linking it in speeds up code dealing with denormals significantly
(PR14024).

For now this is only enabled on linux where I can test it and crtfastmath.o is
widely available. We may want to provide a similar file with compiler-rt
eventually and/or enable it on other platforms too.

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

11 years agoFix scope location when parsing GNU attributes.
Michael Han [Thu, 4 Oct 2012 16:42:52 +0000 (16:42 +0000)]
Fix scope location when parsing GNU attributes.

For GNU attributes, instead of reusing attribute source
location for the scope location, use SourceLocation() since
GNU attributes don not have scope tokens.

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

11 years agoRevert 165129
Preston Gurd [Thu, 4 Oct 2012 15:26:04 +0000 (15:26 +0000)]
Revert 165129

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

11 years agoPrefer StringRef::startswith to the strncmp/strlen contraption.
Benjamin Kramer [Thu, 4 Oct 2012 10:06:38 +0000 (10:06 +0000)]
Prefer StringRef::startswith to the strncmp/strlen contraption.

This may be slightly more efficient and is definitely more readable.

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

11 years agoFix typo in comments.
Logan Chien [Thu, 4 Oct 2012 08:08:56 +0000 (08:08 +0000)]
Fix typo in comments.

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

11 years agoFix r165005: The lexical DeclContext is not the right place to make a decision about...
Axel Naumann [Thu, 4 Oct 2012 07:34:43 +0000 (07:34 +0000)]
Fix r165005: The lexical DeclContext is not the right place to make a decision about whether we need to call tryAddTopLevelDecl or not. That call should be made when the DeclContext's redeclaration context is the translation unit.

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

11 years agoAdd missing comment for mangling.
Nick Lewycky [Thu, 4 Oct 2012 04:58:17 +0000 (04:58 +0000)]
Add missing comment for mangling.

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

11 years agoFail early with a clear assert if an operation with multiple uses somehow ends
Lang Hames [Thu, 4 Oct 2012 03:23:25 +0000 (03:23 +0000)]
Fail early with a clear assert if an operation with multiple uses somehow ends
up being contracted during codegen.

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

11 years agoTest file-scoped FP_CONTRACT pragma.
Lang Hames [Thu, 4 Oct 2012 03:07:37 +0000 (03:07 +0000)]
Test file-scoped FP_CONTRACT pragma.

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

11 years agoPermanently end the whole "pragma got handled by the parser too early"
Eli Friedman [Thu, 4 Oct 2012 02:36:51 +0000 (02:36 +0000)]
Permanently end the whole "pragma got handled by the parser too early"
mess by handling all pragmas which the parser touches uniformly.
<rdar://problem/12248901>, etc.

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

11 years agoAdd an explicit -object_path_lto flag during linking with a uniquified temporary
Bill Wendling [Wed, 3 Oct 2012 23:49:57 +0000 (23:49 +0000)]
Add an explicit -object_path_lto flag during linking with a uniquified temporary
file name if building Apple-style.

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

11 years agouse ';' instead of '-' in the note part of my last patch.
Fariborz Jahanian [Wed, 3 Oct 2012 22:39:32 +0000 (22:39 +0000)]
use ';' instead of '-' in the note part of my last patch.

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

11 years agoUpdate test case for r165174.
Chad Rosier [Wed, 3 Oct 2012 22:18:51 +0000 (22:18 +0000)]
Update test case for r165174.

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

11 years agotblgen: Migrate clang-tblgen to new TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:29:30 +0000 (21:29 +0000)]
tblgen: Migrate clang-tblgen to new TableGenMain API.

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

11 years agoRemove the directory that these are already in.
Bill Wendling [Wed, 3 Oct 2012 21:08:21 +0000 (21:08 +0000)]
Remove the directory that these are already in.

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

11 years ago[libclang] When indexing, invoke the importedASTFile for PCH files as well.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:51 +0000 (21:05 +0000)]
[libclang] When indexing, invoke the importedASTFile for PCH files as well.

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

11 years ago[libclang] Simplify indexing of module imports by handling implicit
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:44 +0000 (21:05 +0000)]
[libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

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

11 years agoPR14004: Fix typo in documentation.
Richard Smith [Wed, 3 Oct 2012 21:02:25 +0000 (21:02 +0000)]
PR14004: Fix typo in documentation.

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

11 years agoFix invalid reads by memcmp.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:09 +0000 (20:58 +0000)]
Fix invalid reads by memcmp.

Str may be smaller than Start->Name here. Use strncmp to avoid scanning past the
end. Found by valgrind.

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

11 years agoAlways initialize FPContractable.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:04 +0000 (20:58 +0000)]
Always initialize FPContractable.

false is used as a baseline here, we may want to allow contraction in some of
the cases.  Found by valgrind.

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

11 years ago[Options] Store the owning OptTable in Option so it can construct Group and Alias.
Michael J. Spencer [Wed, 3 Oct 2012 19:58:10 +0000 (19:58 +0000)]
[Options] Store the owning OptTable in Option so it can construct Group and Alias.

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

11 years agoRemove useless parameter "WantFile" from Driver::GetProgramPath().
Simon Atanasyan [Wed, 3 Oct 2012 19:52:37 +0000 (19:52 +0000)]
Remove useless parameter "WantFile" from Driver::GetProgramPath().
This parameter is useless because nowhere used explicitly and always
gets its default value - "false".

The patch reviewed by Rafael Espindola.

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

11 years agoThis patch enables general varargs support for the 64-bit PPC SVR4 ABI.
Bill Schmidt [Wed, 3 Oct 2012 19:18:57 +0000 (19:18 +0000)]
This patch enables general varargs support for the 64-bit PPC SVR4 ABI.

Most of the pieces for this were already in place, but a proper EmitVAArg
is needed for aggregates and complex numbers to be handled.  Although the
va_list for 64-bit PowerPC SVR4 consists of GPRs 3 through 10 together with
the overflow portion of the parameter save area, we can treat va_list as
pointing to contiguous memory for all parameters, since the back end forces
the parameter GPRs to memory for varargs functions.

There is no need at this time to model parameters and return values beyond
what the DefaultABIInfo provides.

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

11 years agoFix a typo in my last patch reported by Erik Schwiebert.
Fariborz Jahanian [Wed, 3 Oct 2012 19:05:41 +0000 (19:05 +0000)]
Fix a typo in my last patch reported by Erik Schwiebert.

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

11 years agoRemove ASTReader::needPendingInstantiation(), introduced in r164993,
Douglas Gregor [Wed, 3 Oct 2012 18:38:43 +0000 (18:38 +0000)]
Remove ASTReader::needPendingInstantiation(), introduced in r164993,
which is neither correct nor necessary. The use of this routine was
eliminated by r165137.

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

11 years agoAdd some FIXMEs to the ASTReader code
Douglas Gregor [Wed, 3 Oct 2012 18:36:10 +0000 (18:36 +0000)]
Add some FIXMEs to the ASTReader code

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

11 years agoRevert most of the functionality in r165001. Instead, make sure that
Douglas Gregor [Wed, 3 Oct 2012 18:34:48 +0000 (18:34 +0000)]
Revert most of the functionality in r165001. Instead, make sure that
the ASTReader doesn't attach a body to a function that is already
defined elsewhere.

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

11 years agoobjective-C arc: Warn under arc about a use of an ivar inside a block
Fariborz Jahanian [Wed, 3 Oct 2012 17:55:29 +0000 (17:55 +0000)]
objective-C arc: Warn under arc about a use of an ivar inside a block
that doesn't have a 'self' as this implicitly captures 'self' and could
create retain cycles. Provide fixit. // rdar://11194874

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

11 years agoImplement Adnroid MIPS toolchain support:
Simon Atanasyan [Wed, 3 Oct 2012 17:46:38 +0000 (17:46 +0000)]
Implement Adnroid MIPS toolchain support:
1. Add mipsel-linux-android to the list of valid MIPS target triples.
2. Add <gcc install path>/mips-r2 to the list of toolchain specific path
   prefixes if target is mipsel-linux-android.

The patch reviewed by Logan Chien.

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

11 years agoFix failure of newly added test, by using %clang instead of %clang_cc1
Preston Gurd [Wed, 3 Oct 2012 16:52:40 +0000 (16:52 +0000)]
Fix failure of newly added test, by using %clang instead of %clang_cc1
and by specifying a target.

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

11 years agoAdds a test to verify that Clang does the optimization to use a
Preston Gurd [Wed, 3 Oct 2012 16:37:56 +0000 (16:37 +0000)]
Adds a test to verify that Clang does the optimization to use a
fast div/rem instruction (for Intel Atom).

Test case for llvm commit 165126.

Patch by Tyler Nowicki.

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

11 years agoRevert "InlineObjCInstanceMethod.m: Remove lines introduced in r165079."
Jordan Rose [Wed, 3 Oct 2012 16:00:32 +0000 (16:00 +0000)]
Revert "InlineObjCInstanceMethod.m: Remove lines introduced in r165079."

...and fix the run line so that the expected warnings are the same on
all platforms.

This reverts r165088 / d09074f0ca06626914108f1c0d4e70adeb851e01.

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

11 years agoclang-check: Add clangRewriteCore.a to the Makefile build to make it link again.
Benjamin Kramer [Wed, 3 Oct 2012 14:35:38 +0000 (14:35 +0000)]
clang-check: Add clangRewriteCore.a to the Makefile build to make it link again.

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

11 years agoMatching block names with FileCheck requires asserts.
Benjamin Kramer [Wed, 3 Oct 2012 14:21:33 +0000 (14:21 +0000)]
Matching block names with FileCheck requires asserts.

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

11 years agoCodeGen: Fix a silly typo when emitting subs of block addresses.
Benjamin Kramer [Wed, 3 Oct 2012 14:15:39 +0000 (14:15 +0000)]
CodeGen: Fix a silly typo when emitting subs of block addresses.

Part of PR14005.

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

11 years agoWhen mangling an APSInt with the ms abi, make sure to look at all nibbles.
Nico Weber [Wed, 3 Oct 2012 13:39:49 +0000 (13:39 +0000)]
When mangling an APSInt with the ms abi, make sure to look at all nibbles.

Currently, it's ignored if the number of set bits isn't divisible by 4.

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

11 years agoAs opposed to the clang-fixit tool described on
Daniel Jasper [Wed, 3 Oct 2012 13:28:43 +0000 (13:28 +0000)]
As opposed to the clang-fixit tool described on
http://clang.llvm.org/docs/ClangTools.html, this adds -fixit option to
clang-check. Thus, clang-check can become a general-purpose tool to run
clang capitalizing on the info stored in a compilation database.

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

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

11 years agoFix typo in comments.
Logan Chien [Wed, 3 Oct 2012 09:26:43 +0000 (09:26 +0000)]
Fix typo in comments.

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

11 years agoComment to XML conversion: escape XML special chars correctly; use correct
Dmitri Gribenko [Wed, 3 Oct 2012 09:04:56 +0000 (09:04 +0000)]
Comment to XML conversion: escape XML special chars correctly; use correct
regex for version tuples.

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

11 years agoThe top-level clang Makefile is #included into other Makefiles. (sigh) So we
Bill Wendling [Wed, 3 Oct 2012 08:39:19 +0000 (08:39 +0000)]
The top-level clang Makefile is #included into other Makefiles. (sigh) So we
can't have the logic here to add in the 'tools/{driver,libclang}' directories,
because they will be added in for ALL Makefiles which #include the top-level
one. Place the logic into the 'tools' Makefile.

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

11 years agoAdd the missing backslash-newline which was causing make errors.
Bill Wendling [Wed, 3 Oct 2012 08:07:20 +0000 (08:07 +0000)]
Add the missing backslash-newline which was causing make errors.

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

11 years agoMake sure 32-bit ASan runtime is available on 64-bit Linux platforms
Alexey Samsonov [Wed, 3 Oct 2012 07:23:03 +0000 (07:23 +0000)]
Make sure 32-bit ASan runtime is available on 64-bit Linux platforms

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

11 years agoWhile I'm here, resync a %select with the enum definition it selects on.
Nico Weber [Wed, 3 Oct 2012 06:57:02 +0000 (06:57 +0000)]
While I'm here, resync a %select with the enum definition it selects on.

* nullptr used to be mapped to ERROR, now mapped to nullptr
* integral was missing
* expressions now have their own error message, so they won't reach
  this. Map them to ERROR.

Note that clang usually crashes before emitting this diagnostic anyway
(see PR13984), so this change alone doesn't have an observable effect.
It makes the code more correct though.

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

11 years agoMove expression mangling in the microsoft mangler to its own function.
Nico Weber [Wed, 3 Oct 2012 06:46:47 +0000 (06:46 +0000)]
Move expression mangling in the microsoft mangler to its own function.

This matches what's done in ItaniumMangle and makes it a bit easier
to implement mangling for more expressions. Also use the slightly nicer
"not yet implemented" error message from there.

No functionality change (except for the different error message).

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

11 years agoReplace a default: with an explicit list of cases. No functionality change.
Nico Weber [Wed, 3 Oct 2012 06:12:27 +0000 (06:12 +0000)]
Replace a default: with an explicit list of cases. No functionality change.

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

11 years agoUpdate the block specification for some long-settled subleties.
John McCall [Wed, 3 Oct 2012 04:57:59 +0000 (04:57 +0000)]
Update the block specification for some long-settled subleties.

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

11 years agoInlineObjCInstanceMethod.m: Remove lines introduced in r165079. It broke some builds...
NAKAMURA Takumi [Wed, 3 Oct 2012 02:35:19 +0000 (02:35 +0000)]
InlineObjCInstanceMethod.m: Remove lines introduced in r165079. It broke some builds, on FreeBSD, Linux and Windows.

error: 'warning' diagnostics expected but not seen:
  Line 94: types are incompatible
1 error generated.

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

11 years ago[PCH] Fix serialization of an ImportDecl.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:45 +0000 (01:58 +0000)]
[PCH] Fix serialization of an ImportDecl.

ImportDecl's module ID was not written out and the reader accepted as module ID
the serialized:
  Record.push_back(!IdentifierLocs.empty());

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

11 years agoSet the file entry for a Module* that was created during deserialization
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:42 +0000 (01:58 +0000)]
Set the file entry for a Module* that was created during deserialization
of a module file.

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

11 years agoAdd a FIXME.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:39 +0000 (01:58 +0000)]
Add a FIXME.

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

11 years agoIntroduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:37 +0000 (01:58 +0000)]
Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
when an ImportDecl that was implicitly created due to an inclusion directive.

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

11 years agoSome renames to use the 'visitor' nomenclature, no functionality change.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:28 +0000 (01:58 +0000)]
Some renames to use the 'visitor' nomenclature, no functionality change.

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

11 years agoImprove C++11 attribute parsing.
Michael Han [Wed, 3 Oct 2012 01:56:22 +0000 (01:56 +0000)]
Improve C++11 attribute parsing.

- General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST.
- Add support to parse arguments of attributes that in 'gnu' namespace.
- Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic.

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

11 years ago[analyzer] Adjust the return type of an inlined devirtualized method call.
Jordan Rose [Wed, 3 Oct 2012 01:08:35 +0000 (01:08 +0000)]
[analyzer] Adjust the return type of an inlined devirtualized method call.

In C++, overriding virtual methods are allowed to specify a covariant
return type -- that is, if the return type of the base method is an
object pointer type (or reference type), the overriding method's return
type can be a pointer to a subclass of the original type. The analyzer
was failing to take this into account when devirtualizing a method call,
and anything that relied on the return value having the proper type later
would crash.

In Objective-C, overriding methods are allowed to specify ANY return type,
meaning we can NEVER be sure that devirtualizing will give us a "safe"
return value. Of course, a program that does this will most likely crash
at runtime, but the analyzer at least shouldn't crash.

The solution is to check and see if the function/method being inlined is
the function that static binding would have picked. If not, check that
the return value has the same type. If the types don't match, see if we
can fix it with a derived-to-base cast (the C++ case). If we can't,
return UnknownVal to avoid crashing later.

<rdar://problem/12409977>

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

11 years ago[analyzer] Push evalDynamicCast and evalDerivedToBase up to Store.
Jordan Rose [Wed, 3 Oct 2012 01:08:32 +0000 (01:08 +0000)]
[analyzer] Push evalDynamicCast and evalDerivedToBase up to Store.

These functions are store-agnostic, and would benefit from information in
DynamicTypeInfo but gain nothing from the store type.

No intended functionality change.

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

11 years agoTeach getCXXRecordDeclForPointerType about references.
Jordan Rose [Wed, 3 Oct 2012 01:08:28 +0000 (01:08 +0000)]
Teach getCXXRecordDeclForPointerType about references.

Then, rename it getPointeeCXXRecordDecl and give it a nice doc comment,
and actually use it.

No intended functionality change.

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

11 years agoChange how the SelfReferenceChecker handles MemberExpr. Instead of treating
Richard Trieu [Wed, 3 Oct 2012 00:41:36 +0000 (00:41 +0000)]
Change how the SelfReferenceChecker handles MemberExpr.  Instead of treating
each one separately, process a stack of MemberExpr's as a single unit so that
static calls and member access will not be warned on.

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

11 years agoRevert 165058, per Jim request. This requires further discussion.
Chad Rosier [Tue, 2 Oct 2012 23:38:55 +0000 (23:38 +0000)]
Revert 165058, per Jim request.  This requires further discussion.

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

11 years agoAdded a test for C++11 statement attributes serialization.
Alexander Kornienko [Tue, 2 Oct 2012 23:11:53 +0000 (23:11 +0000)]
Added a test for C++11 statement attributes serialization.

Summary: Uses [[clang::fallthrough]] attribute in a template function, and -Wimplicit-fallthrough to check the attribute presence in an instantiation.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D55

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

11 years ago[Doc parse]: SUpport for message in deprecated/unavailable
Fariborz Jahanian [Tue, 2 Oct 2012 23:01:04 +0000 (23:01 +0000)]
[Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.

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

11 years agoSilence -Wunused-value warning.
Ted Kremenek [Tue, 2 Oct 2012 21:50:18 +0000 (21:50 +0000)]
Silence -Wunused-value warning.

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

11 years ago[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.
Chad Rosier [Tue, 2 Oct 2012 21:49:14 +0000 (21:49 +0000)]
[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.
A Sema lookup is used to determine the size of the variable, which is in turn
used during wildcard matching.

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

11 years ago[PCH/Module] Change the map of file-level DeclIDs to use a FileID
Argyrios Kyrtzidis [Tue, 2 Oct 2012 21:09:17 +0000 (21:09 +0000)]
[PCH/Module] Change the map of file-level DeclIDs to use a FileID
as key instead of a SLocEntry pointer. This allows the array of
file sorted declarations in a PCH/module to be deterministic.

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

11 years ago[libclang] When indexing an AST file, only deserialize the file level
Argyrios Kyrtzidis [Tue, 2 Oct 2012 21:09:13 +0000 (21:09 +0000)]
[libclang] When indexing an AST file, only deserialize the file level
declarations of the current primary module.

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

11 years ago[ms-inline asm] Fixup test case to be valid ms-style asm. Fix whitespace.
Chad Rosier [Tue, 2 Oct 2012 20:55:30 +0000 (20:55 +0000)]
[ms-inline asm] Fixup test case to be valid ms-style asm.  Fix whitespace.

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

11 years agoRefactor clients of AnalyzerOptions::getBooleanOption() to have
Ted Kremenek [Tue, 2 Oct 2012 20:42:16 +0000 (20:42 +0000)]
Refactor clients of AnalyzerOptions::getBooleanOption() to have
an intermediate helper method to query and populate the Optional value.

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

11 years agoTweak AnalyzerOptions::getOptionAsInteger() to populate the string
Ted Kremenek [Tue, 2 Oct 2012 20:31:56 +0000 (20:31 +0000)]
Tweak AnalyzerOptions::getOptionAsInteger() to populate the string
table, making it printable with the ConfigDump checker.  Along the
way, fix a really serious bug where the value was getting parsed
from the string in code that was in an assert() call.  This means
in a Release-Asserts build this code wouldn't work as expected.

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

11 years agoChange AnalyzerOptions::mayInlineCXXMemberFunction to default populate
Ted Kremenek [Tue, 2 Oct 2012 20:31:52 +0000 (20:31 +0000)]
Change AnalyzerOptions::mayInlineCXXMemberFunction to default populate
the config string table.  Also setup a test for dumping the analyzer
configuration for C++.

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

11 years ago[Doc parsing]: Add available and deprecated attribute info
Fariborz Jahanian [Tue, 2 Oct 2012 20:05:47 +0000 (20:05 +0000)]
[Doc parsing]: Add available and deprecated attribute info
to XML output. // rdar://12378879

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

11 years ago[ms-inline asm] Enhance the isSimpleMSAsm() function to handle operands with pointer...
Chad Rosier [Tue, 2 Oct 2012 18:51:05 +0000 (18:51 +0000)]
[ms-inline asm] Enhance the isSimpleMSAsm() function to handle operands with pointer size
directives (e.g., dword ptr [eax]).

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

11 years agoFix test for r165028. It only generates that flag for source files now.
Bill Wendling [Tue, 2 Oct 2012 18:07:59 +0000 (18:07 +0000)]
Fix test for r165028. It only generates that flag for source files now.
<rdar://problem/12401423>

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

11 years agoDuring LTO, we call 'dsymutil' when we compile source files. This necessitates
Bill Wendling [Tue, 2 Oct 2012 18:02:50 +0000 (18:02 +0000)]
During LTO, we call 'dsymutil' when we compile source files. This necessitates
clang specifying a temporary file that it later cleans up so that it can survive
the linking stage. However, when we compile object files during LTO we don't
call 'dsymutil'. That's done at a different stage (if at all). We rely upon the
linker to specify a unique name for the temporary file it generates.
<rdar://problem/12401423>

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

11 years agoConvert to FileCheck.
Rafael Espindola [Tue, 2 Oct 2012 17:41:03 +0000 (17:41 +0000)]
Convert to FileCheck.

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

11 years agoNo need to call the InitializeAll* functions.
Chad Rosier [Tue, 2 Oct 2012 16:41:12 +0000 (16:41 +0000)]
No need to call the InitializeAll* functions.

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

11 years agoFP_CONTRACT: Fix two tests for -Asserts.
NAKAMURA Takumi [Tue, 2 Oct 2012 16:36:54 +0000 (16:36 +0000)]
FP_CONTRACT: Fix two tests for -Asserts.

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

11 years ago[libclang] When indexing an AST file, only deserialize the preprocessing record
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:51 +0000 (16:10 +0000)]
[libclang] When indexing an AST file, only deserialize the preprocessing record
entities of the current primary module.

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

11 years agoAdd info in the preprocessing record whether an inclusion directive
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:46 +0000 (16:10 +0000)]
Add info in the preprocessing record whether an inclusion directive
resulted in an automatic module import.

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

11 years ago[libclang] Even though we disable the preprocessing record during indexing,
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:41 +0000 (16:10 +0000)]
[libclang] Even though we disable the preprocessing record during indexing,
make sure that it gets enabled for when a module needs to be created.

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

11 years ago[libclang] Implement the importedASTFile indexing callback to provide
Argyrios Kyrtzidis [Tue, 2 Oct 2012 16:10:38 +0000 (16:10 +0000)]
[libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.

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

11 years agoSplitting this test case into two because the behavior for the calling convention...
Aaron Ballman [Tue, 2 Oct 2012 14:56:00 +0000 (14:56 +0000)]
Splitting this test case into two because the behavior for the calling convention code is target-specific.

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

11 years agoAllowing individual targets to determine whether a given calling convention is allowe...
Aaron Ballman [Tue, 2 Oct 2012 14:26:08 +0000 (14:26 +0000)]
Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.

Fixes PR13782

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

11 years agoSilencing an MSVC warning about */ being found outside of a comment.
Aaron Ballman [Tue, 2 Oct 2012 13:54:25 +0000 (13:54 +0000)]
Silencing an MSVC warning about */ being found outside of a comment.

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

11 years agoAdd redecls into their lexical DeclContext: this is what they assert on, and the...
Axel Naumann [Tue, 2 Oct 2012 13:06:13 +0000 (13:06 +0000)]
Add redecls into their lexical DeclContext: this is what they assert on, and the merging should have set it correctly.
This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different.

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

11 years agoEnable programmatic provisioning of virtual module.map files (instead of writing...
Axel Naumann [Tue, 2 Oct 2012 12:26:36 +0000 (12:26 +0000)]
Enable programmatic provisioning of virtual module.map files (instead of writing out actual module.map files).
Opens up the wonders of clang::Modules to tools - though they remain as experimental as before.

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

11 years agoOnly those InterestingDecls that got added to the AST should be passed to the ASTCons...
Axel Naumann [Tue, 2 Oct 2012 12:18:46 +0000 (12:18 +0000)]
Only those InterestingDecls that got added to the AST should be passed to the ASTConsumer.

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

11 years ago-arch is a darwin-specific driver feature, use a triple instead in rewriter test.
Benjamin Kramer [Tue, 2 Oct 2012 09:42:36 +0000 (09:42 +0000)]
-arch is a darwin-specific driver feature, use a triple instead in rewriter test.

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

11 years agoForce triple in test to unbreak it on non-darwin platforms.
Benjamin Kramer [Tue, 2 Oct 2012 09:29:48 +0000 (09:29 +0000)]
Force triple in test to unbreak it on non-darwin platforms.

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

11 years agoMerge pending instantiations instead of overwriting existing ones.
Axel Naumann [Tue, 2 Oct 2012 09:09:43 +0000 (09:09 +0000)]
Merge pending instantiations instead of overwriting existing ones.
Check whether a pending instantiation needs to be instantiated (or whether an instantiation already exists).
Verify the size of the PendingInstantiations record (was only checking size of existing PendingInstantiations).

Migrate Obj-C++ part of redecl-merge into separate test, now that this is growing.
templates.mm: test that CodeGen has seen exactly one definition of template instantiations.
redecl-merge.m: use "@" specifier for expected-diagnostics.

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

11 years agoUse an environment variable instead of what's in the make cmd goals.
Bill Wendling [Tue, 2 Oct 2012 06:19:15 +0000 (06:19 +0000)]
Use an environment variable instead of what's in the make cmd goals.

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

11 years agoTweak diagnostic text to indicate that __weak on a local variable is only allowed
Ted Kremenek [Tue, 2 Oct 2012 05:36:02 +0000 (05:36 +0000)]
Tweak diagnostic text to indicate that __weak on a local variable is only allowed
for ARC.  Fixes <rdar://problem/12407705>

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