Commit Graph

41790 Commits

Author SHA1 Message Date
Benjamin Kramer d7d2b1fe45 Don't include Type.h in DeclarationName.h.
Recursively prune some includes.

llvm-svn: 169094
2012-12-01 16:35:25 +00:00
Benjamin Kramer 8b44da58f7 Make ASTVector.h standalone without including all of ASTContext.
llvm-svn: 169093
2012-12-01 15:18:03 +00:00
Benjamin Kramer ea70eb30a0 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.

llvm-svn: 169092
2012-12-01 15:09:41 +00:00
Eli Bendersky 2592e4e851 Fix a test that was redefining FileCheck variables while referencing old ones.
In preparation for the FileCheck enhancement to support backreferences.

llvm-svn: 169090
2012-12-01 13:50:51 +00:00
Joey Gouly a35a289de6 Switch to using -### as mentioned by chandlerc.
llvm-svn: 169089
2012-12-01 13:07:22 +00:00
Joey Gouly f1040fdd51 Add -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approved by d0k.
llvm-svn: 169088
2012-12-01 12:15:28 +00:00
Benjamin Kramer 5586bdfd2a Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool.
llvm-svn: 169086
2012-12-01 12:08:08 +00:00
Michael Han cadf0b682d Fix a typo in comment.
llvm-svn: 169078
2012-12-01 04:35:48 +00:00
Richard Smith 085a4c2d13 Make these functions more clearly express the test they are performing. No functionality change.
llvm-svn: 169077
2012-12-01 03:15:03 +00:00
Richard Smith 2be35f5fbb Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.

llvm-svn: 169075
2012-12-01 02:35:44 +00:00
Eli Friedman fe9d110f3a 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.

llvm-svn: 169068
2012-12-01 01:15:54 +00:00
Richard Smith 06d87f1e5d Remove restriction on combining ubsan with asan or tsan. This has worked for a while.
llvm-svn: 169066
2012-12-01 01:02:45 +00:00
Douglas Gregor c401755f46 Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>.

llvm-svn: 169065
2012-12-01 01:01:09 +00:00
Bill Wendling 0517508c00 Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.
llvm-svn: 169059
2012-11-30 23:46:56 +00:00
Douglas Gregor 47238dc057 Fix test for Windows path separators
llvm-svn: 169058
2012-11-30 23:40:49 +00:00
Douglas Gregor fa686fb4ed 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>

llvm-svn: 169057
2012-11-30 23:32:31 +00:00
Bill Wendling 3c6591d6ea 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.

llvm-svn: 169054
2012-11-30 23:18:12 +00:00
Eli Friedman 5ac9875160 Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>.

llvm-svn: 169051
2012-11-30 23:09:29 +00:00
Douglas Gregor 6336543195 Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!
llvm-svn: 169045
2012-11-30 22:11:57 +00:00
Douglas Gregor 22103e3416 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>

llvm-svn: 169042
2012-11-30 21:58:49 +00:00
Aaron Ballman f505d55472 Fixing a precedence issue with my previous commit.
llvm-svn: 169041
2012-11-30 21:44:01 +00:00
Aaron Ballman 56b226a8da Fixing an MSVC warning about an unsafe mixture of Boolean and unsigned types in a logical operator.
llvm-svn: 169037
2012-11-30 21:15:20 +00:00
Dmitri Gribenko 9ebd1611b6 Comments: no need to escape any characters in \code ... \endcode.
llvm-svn: 169030
2012-11-30 20:04:39 +00:00
Aaron Ballman 406ea51cfb Support for #pragma region/endregion for MSVC compatibility. Patch thanks to pravic!
llvm-svn: 169028
2012-11-30 19:52:30 +00:00
Douglas Gregor 6fb03aeae1 Actually keep track of the source locations at which particular module
files are loaded.

llvm-svn: 169027
2012-11-30 19:28:05 +00:00
Douglas Gregor af8f02634b 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>.

llvm-svn: 169021
2012-11-30 18:38:50 +00:00
Manuel Klimek 9d0412334e Allow matchers to access the ASTContext.
Patch by Edwin Vane.

llvm-svn: 169000
2012-11-30 13:45:19 +00:00
Chandler Carruth adc29e11d0 Update to reflect the change of macro name in r168993.
llvm-svn: 168994
2012-11-30 11:04:44 +00:00
Eli Friedman dea98de3fb 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.

llvm-svn: 168984
2012-11-30 06:19:40 +00:00
Richard Smith 328aae595c Refactor to reduce duplication in handling of special member functions. No functionality change.
llvm-svn: 168977
2012-11-30 05:11:39 +00:00
Quentin Colombet 317962381a Add a test case for the new cortex-a5 switch
llvm-svn: 168968
2012-11-30 01:34:36 +00:00
Jordan Rose ba101e1b3b 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.

llvm-svn: 168967
2012-11-30 01:15:32 +00:00
Douglas Gregor 8c05893746 Fix unit tests for ModuleLoader change in r168961.
llvm-svn: 168962
2012-11-30 00:01:57 +00:00
Douglas Gregor 7a626570ef 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>.

llvm-svn: 168961
2012-11-29 23:55:25 +00:00
Eli Friedman a92db6773a Fix a small calling-convention bug for x86-32. PR14453.
llvm-svn: 168959
2012-11-29 23:21:04 +00:00
Quentin Colombet 2e9952ef60 Add ARM cortex-a5 subtarget
llvm-svn: 168958
2012-11-29 23:15:27 +00:00
Richard Smith f41d237bf6 Remove out-of-date comment.
llvm-svn: 168957
2012-11-29 23:09:57 +00:00
Quentin Colombet 9b541ff6af Revert commit revision r168953, to change the commit message, which was empty
llvm-svn: 168956
2012-11-29 23:07:08 +00:00
Quentin Colombet 2b14712eca (no commit message)
llvm-svn: 168953
2012-11-29 22:58:40 +00:00
Alexey Samsonov 0e96becfb1 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.

llvm-svn: 168950
2012-11-29 22:36:21 +00:00
Eli Bendersky 479b1b5986 Make the test less sensitive to DWARF emission implementation details.
Note: the ":" goes into the regex because FileCheck wrongly complains about
unbalanced brackets otherwise.

llvm-svn: 168934
2012-11-29 20:01:14 +00:00
Eric Christopher 0499778517 Make sure that we put the rest of the sanitizer libraries on the link line
before libstdc++ like we do with ubsan.

llvm-svn: 168918
2012-11-29 18:51:05 +00:00
Eric Christopher a0f27b3e2c Use newer command line option here.
llvm-svn: 168908
2012-11-29 18:08:24 +00:00
Eric Christopher 5535598bbc Remove duplicate test run lines.
llvm-svn: 168907
2012-11-29 18:08:22 +00:00
Rafael Espindola c12edd4e68 Now that the underlying problem has been fixed, add r168411 back.
Original commit message:

Remove redundant code.

llvm-svn: 168900
2012-11-29 16:38:22 +00:00
Rafael Espindola 8778c28022 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.

llvm-svn: 168895
2012-11-29 16:09:03 +00:00
NAKAMURA Takumi c2b2b75bd5 ASTTests/StmtPrinterTest/StmtPrinter.TestMSIntegerLiteral: Remove i128 stuff. Conditioning-out in macro argument was not accepted on MS cl.exe.
llvm-svn: 168867
2012-11-29 10:22:40 +00:00
NAKAMURA Takumi b2df62570e 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.

llvm-svn: 168865
2012-11-29 09:57:11 +00:00
Timur Iskhodzhanov 6732d350ef [-cxx-abi microsoft] Also spill the argument-back-references context when mangling templates
llvm-svn: 168862
2012-11-29 08:58:47 +00:00
Richard Smith e6a56db2e6 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.

llvm-svn: 168856
2012-11-29 05:41:51 +00:00