]> granicus.if.org Git - clang/log
clang
11 years agoAdd a FileCharacteristic parameter to SourceManager::createFileIDForMemBuffer
Argyrios Kyrtzidis [Fri, 9 Nov 2012 19:40:45 +0000 (19:40 +0000)]
Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBuffer
for completeness and use it in CompilerInstance::InitializeSourceManager if
the input is a memory buffer.

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

11 years agoTurn FrontendInputFile into an immutable class and have it also accept
Argyrios Kyrtzidis [Fri, 9 Nov 2012 19:40:39 +0000 (19:40 +0000)]
Turn FrontendInputFile into an immutable class and have it also accept
a memory buffer instead of only a filename.

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

11 years agoMake CompilerInstance::InitializeSourceManager accept a FrontendInputFile,
Argyrios Kyrtzidis [Fri, 9 Nov 2012 19:40:33 +0000 (19:40 +0000)]
Make CompilerInstance::InitializeSourceManager accept a FrontendInputFile,
no functionality change.

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

11 years agoDon't use so many bits.
Rafael Espindola [Fri, 9 Nov 2012 19:03:35 +0000 (19:03 +0000)]
Don't use so many bits.

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

11 years agoImplement -mstrict-align using '-backend-option -arm-strict-align' as this saves
Chad Rosier [Fri, 9 Nov 2012 18:27:01 +0000 (18:27 +0000)]
Implement -mstrict-align using '-backend-option -arm-strict-align' as this saves
us from having to make any backend changes.

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

11 years agoAdd test case for r167619.
Chad Rosier [Fri, 9 Nov 2012 17:39:51 +0000 (17:39 +0000)]
Add test case for r167619.

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

11 years ago[driver] Add a -mstrict-align compiler option for ARM targets.
Chad Rosier [Fri, 9 Nov 2012 17:29:19 +0000 (17:29 +0000)]
[driver] Add a -mstrict-align compiler option for ARM targets.
rdar://12340498

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

11 years agoImproved support for removing the comma preceding __VA_ARGS__ where __VA_ARGS__
Andy Gibbs [Fri, 9 Nov 2012 13:24:30 +0000 (13:24 +0000)]
Improved support for removing the comma preceding __VA_ARGS__ where __VA_ARGS__
is empty in a variadic macro expansion.  This fixes a divergence in support for
the ", ## __VA_ARGS__" GCC extension which differed in behaviour when in strict
C99 mode (note: there is no change in behaviour has been made in the gnu99 mode
that clang uses by default).  In addition, there is improved support for the
Microsoft alternative extension ", __VA_ARGS__".

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

11 years agoUse isInvalidDecl() instead of isStatic() as suggested by dblaikie.
Nico Weber [Fri, 9 Nov 2012 08:38:04 +0000 (08:38 +0000)]
Use isInvalidDecl() instead of isStatic() as suggested by dblaikie.

I couldn't think of a way to make an operator() invalid without returning
earlier from this function other than making it static, so no new test.

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

11 years agoDon't crash on calling static member overloaded operator, PR14120
Nico Weber [Fri, 9 Nov 2012 06:06:14 +0000 (06:06 +0000)]
Don't crash on calling static member overloaded operator, PR14120

Patch from Brian Brooks!

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

11 years agoRemove old driver code to grab the iOS simulator version from the -D option.
Bob Wilson [Fri, 9 Nov 2012 01:59:30 +0000 (01:59 +0000)]
Remove old driver code to grab the iOS simulator version from the -D option.

We can now rely on the -mios-simulator-version-min command line option
and remove the awful hack. <rdar://problem/10304510>

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

11 years ago[ms] Implement int64_t version of mangleNumber() in terms of the APSInt version.
Nico Weber [Fri, 9 Nov 2012 00:05:56 +0000 (00:05 +0000)]
[ms] Implement int64_t version of mangleNumber() in terms of the APSInt version.

No intended functionality change.

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

11 years ago[Windows] Fix mangling of number literal '0'
Nico Weber [Thu, 8 Nov 2012 23:38:59 +0000 (23:38 +0000)]
[Windows] Fix mangling of number literal '0'

Do this by making the mangleNumber(APSInt) overload look like
the int64_t version. (The latter should probably just delegate
to the former).

Test from Evgeny Eltsin!

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

11 years agoRemove more code related to invoking llvm-gcc. <rdar://problem/11991320>
Bob Wilson [Thu, 8 Nov 2012 23:21:22 +0000 (23:21 +0000)]
Remove more code related to invoking llvm-gcc. <rdar://problem/11991320>

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

11 years agoFix a source range regression in C++ new expressions with call initializers.
David Blaikie [Thu, 8 Nov 2012 22:53:48 +0000 (22:53 +0000)]
Fix a source range regression in C++ new expressions with call initializers.

Introduced in r167507, discovered in review by Abramo Bagnara.

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

11 years agoFix a bug I found while preparing my devmtg talk: When passing NULL to a
Matt Beaumont-Gay [Thu, 8 Nov 2012 20:50:02 +0000 (20:50 +0000)]
Fix a bug I found while preparing my devmtg talk: When passing NULL to a
function that takes a const Foo&, where Foo is convertible from a large number
of pointer types, we print ALL the overloads, no matter the setting of
-fshow-overloads.

There is potential follow-on work in unifying the "print candidates, but not
too many" logic between OverloadCandidateSet::NoteCandidates and
ImplicitConversionSequence::DiagnoseAmbiguousConversion.

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

11 years agollvm/ConstantFolding.cpp: Make ReadDataFromGlobal() and FoldReinterpretLoadFromConstP...
NAKAMURA Takumi [Thu, 8 Nov 2012 20:34:25 +0000 (20:34 +0000)]
llvm/ConstantFolding.cpp: Make ReadDataFromGlobal() and FoldReinterpretLoadFromConstPtr() Big-endian-aware.

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

11 years agoLiteralSupport: Don't overflow the temporary buffer when decoding invalid string...
Benjamin Kramer [Thu, 8 Nov 2012 19:22:31 +0000 (19:22 +0000)]
LiteralSupport: Don't overflow the temporary buffer when decoding invalid string parts.

Instead just use a dummy buffer, we're not going to use the decoded string anyways.
Fixes PR14292.

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

11 years agoLiteralSupport: Clean up style violations. No functionality change.
Benjamin Kramer [Thu, 8 Nov 2012 19:22:26 +0000 (19:22 +0000)]
LiteralSupport: Clean up style violations. No functionality change.

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

11 years agoAllow to pass from syntactic form of InitListExpr to semantic form (just as viceversa...
Abramo Bagnara [Thu, 8 Nov 2012 18:41:43 +0000 (18:41 +0000)]
Allow to pass from syntactic form of InitListExpr to semantic form (just as viceversa). No functionality change.

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

11 years agoAvoid to write function name in comment. Thanks to Dmitri Gribenko.
Abramo Bagnara [Thu, 8 Nov 2012 16:27:30 +0000 (16:27 +0000)]
Avoid to write function name in comment. Thanks to Dmitri Gribenko.

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

11 years agoReadded line removed by mistake.
Abramo Bagnara [Thu, 8 Nov 2012 16:01:51 +0000 (16:01 +0000)]
Readded line removed by mistake.

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

11 years agoFixed converted ConstantArrayTypeLoc range. Added a missing testcase for ConstructorD...
Abramo Bagnara [Thu, 8 Nov 2012 14:44:42 +0000 (14:44 +0000)]
Fixed converted ConstantArrayTypeLoc range. Added a missing testcase for ConstructorDecl source range.

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

11 years agoFixed range of implicit MemberExpr.
Abramo Bagnara [Thu, 8 Nov 2012 13:52:58 +0000 (13:52 +0000)]
Fixed range of implicit MemberExpr.

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

11 years agoSet TLSSupported to false on Haiku.
Benjamin Kramer [Thu, 8 Nov 2012 12:59:15 +0000 (12:59 +0000)]
Set TLSSupported to false on Haiku.

Haiku does not support this (yet). Leaving it set to true leads to
configure scripts detecting __thread being available and Clang emitting
code for it, resulting in binaries the runtime_loader will refuse to
load.

Patch by Jonathan Schleifer!

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

11 years agoDriver/Darwin: The -arch argument values aren't exactly the arch names from a
Daniel Dunbar [Thu, 8 Nov 2012 03:38:26 +0000 (03:38 +0000)]
Driver/Darwin: The -arch argument values aren't exactly the arch names from a
triple.

 - Translate the special case of powerpc to its expected -arch name.

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

11 years agoRip out a bunch of code for invoking gcc from clang.
Bob Wilson [Thu, 8 Nov 2012 01:03:34 +0000 (01:03 +0000)]
Rip out a bunch of code for invoking gcc from clang.

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

11 years agoRemove code to fall back to llvm-gcc for i386 kexts.
Bob Wilson [Thu, 8 Nov 2012 01:03:29 +0000 (01:03 +0000)]
Remove code to fall back to llvm-gcc for i386 kexts.

More cleanups to follow in separate commits....

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

11 years agoPR14284: crash on ext-valid returning NULL from a void function
David Blaikie [Thu, 8 Nov 2012 00:41:20 +0000 (00:41 +0000)]
PR14284: crash on ext-valid returning NULL from a void function

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

11 years agoWhen deciding whether to convert an array construction loop into a memcpy, look
Richard Smith [Wed, 7 Nov 2012 23:56:21 +0000 (23:56 +0000)]
When deciding whether to convert an array construction loop into a memcpy, look
at whether the *selected* constructor would be trivial rather than considering
whether the array's element type has *any* non-trivial constructors of the
relevant kind.

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

11 years agoForce C89 for c-index-test.c
Dmitri Gribenko [Wed, 7 Nov 2012 23:52:25 +0000 (23:52 +0000)]
Force C89 for c-index-test.c

MSVC supports only C89, so it is important to keep c-index-test.c
buildable with C89.  However, Clang defaults to C99, so while building
Clang with Clang one can introduce C99 constructs into c-index-test.c
without noticing.

Thanks to Nakamura Takumi for helping with MSVC bits.

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

11 years ago[Driver] Fix -Wp,-MMD pr13959
Michael J. Spencer [Wed, 7 Nov 2012 23:37:14 +0000 (23:37 +0000)]
[Driver] Fix -Wp,-MMD pr13959

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

11 years agoReduce nesting. No functionality change.
Nico Weber [Wed, 7 Nov 2012 21:31:36 +0000 (21:31 +0000)]
Reduce nesting. No functionality change.

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

11 years agoWhen template deduction fails on a derived class, try a template deduction on
Richard Trieu [Wed, 7 Nov 2012 21:17:13 +0000 (21:17 +0000)]
When template deduction fails on a derived class, try a template deduction on
the base class.  If the base class deduction succeeds, use those results.  If
it fails, keep using the results from the derived class template deduction.

This prevents an assertion later where the type of deduction failure doesn't
match up with the template deduction info.

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

11 years agoobjective-C blocks: bring back the CharUnit patch for
Fariborz Jahanian [Wed, 7 Nov 2012 20:00:32 +0000 (20:00 +0000)]
objective-C blocks: bring back the CharUnit patch for
captured block variable layout meta-data. No intended change
in functionality.

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

11 years agoPR12713 - crash on invalid due to unmatched parens in decltype
David Blaikie [Wed, 7 Nov 2012 19:08:05 +0000 (19:08 +0000)]
PR12713 - crash on invalid due to unmatched parens in decltype

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

11 years agoobjective-C modern translator. Start the line
Fariborz Jahanian [Wed, 7 Nov 2012 18:15:53 +0000 (18:15 +0000)]
objective-C modern translator. Start the line
directive on a new line.

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

11 years agoWhen loading a module fails because it is out of date, rebuild that
Douglas Gregor [Wed, 7 Nov 2012 17:46:15 +0000 (17:46 +0000)]
When loading a module fails because it is out of date, rebuild that
module in place. <rdar://problem/10138913>

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

11 years agoTest for source location range of new expressions fixed in r167507.
David Blaikie [Wed, 7 Nov 2012 17:17:07 +0000 (17:17 +0000)]
Test for source location range of new expressions fixed in r167507.

Patch by Philip Craig.

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

11 years ago[analyzer] Check that the argument to CFMakeCollectable is non-NULL.
Jordan Rose [Wed, 7 Nov 2012 17:12:37 +0000 (17:12 +0000)]
[analyzer] Check that the argument to CFMakeCollectable is non-NULL.

Patch by Sean McBride!

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

11 years agoFix the Objective-C exception rethrow from cleanups (GNU runtimes). Note that
David Chisnall [Wed, 7 Nov 2012 16:50:40 +0000 (16:50 +0000)]
Fix the Objective-C exception rethrow from cleanups (GNU runtimes).  Note that
a bug in the inliner still causes the wrong thing to happen at -O2 and above
(PR14116).

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

11 years ago[analyzer] Add some examples for the common REGISTER_*_WITH_PROGRAMSTATEs.
Jordan Rose [Wed, 7 Nov 2012 02:35:33 +0000 (02:35 +0000)]
[analyzer] Add some examples for the common REGISTER_*_WITH_PROGRAMSTATEs.

No functionality change (doc comments only).

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

11 years ago[analyzer] Enhance docs for checker callbacks (esp. processRegionChanges).
Jordan Rose [Wed, 7 Nov 2012 02:35:02 +0000 (02:35 +0000)]
[analyzer] Enhance docs for checker callbacks (esp. processRegionChanges).

No functionality change; this checker is only used for documentation.

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

11 years agoAdd -Wmismatched-return-types flag for existing warning on conflicting return types.
Ted Kremenek [Wed, 7 Nov 2012 01:43:44 +0000 (01:43 +0000)]
Add -Wmismatched-return-types flag for existing warning on conflicting return types.

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

11 years agoAdd -Wmismatched-parameter-types flag for existing warning on conflicting parameter...
Ted Kremenek [Wed, 7 Nov 2012 01:25:56 +0000 (01:25 +0000)]
Add -Wmismatched-parameter-types flag for existing warning on conflicting parameter types.

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

11 years agoPR11851 (and duplicates): Whenever a constexpr function is referenced,
Richard Smith [Wed, 7 Nov 2012 01:14:25 +0000 (01:14 +0000)]
PR11851 (and duplicates): Whenever a constexpr function is referenced,
instantiate it if it can be instantiated and implicitly define it if it can be
implicitly defined. This matches g++'s approach. Remove some cases from
SemaOverload which were marking functions as referenced when just planning how
overload resolution would proceed; such cases are not actually references.

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

11 years agomodern ObjC translator. Insert line number for @synchronized statements.
Fariborz Jahanian [Wed, 7 Nov 2012 00:43:05 +0000 (00:43 +0000)]
modern ObjC translator. Insert line number for @synchronized statements.

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

11 years agoAdd missing check to warning for packed attribute. PR14259.
Eli Friedman [Wed, 7 Nov 2012 00:35:20 +0000 (00:35 +0000)]
Add missing check to warning for packed attribute.  PR14259.

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

11 years agoCreate helper functions in StmtDumper for outputting the indentation, newlines, and...
Manuel Klimek [Wed, 7 Nov 2012 00:33:12 +0000 (00:33 +0000)]
Create helper functions in StmtDumper for outputting the indentation, newlines, and brackets.

This is preparation for adding Decl dumping.

Patch by Philip Craig.

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

11 years agoPR13552: Fix the end location of a CXXNewExpr.
David Blaikie [Wed, 7 Nov 2012 00:12:38 +0000 (00:12 +0000)]
PR13552: Fix the end location of a CXXNewExpr.

Spent longer than reasonable looking for a nice way to test this & decided to
give up for now. Open to suggestions/requests. Richard Smith suggested adding
something to ASTMatchers but it wasn't readily apparent how to test this with
that.

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

11 years agoFix assertion failure with auto and nested initializer list; PR14272.
Eli Friedman [Tue, 6 Nov 2012 23:56:42 +0000 (23:56 +0000)]
Fix assertion failure with auto and nested initializer list; PR14272.

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

11 years agoTease out the routine that reads the control block of an AST file from
Douglas Gregor [Tue, 6 Nov 2012 23:40:54 +0000 (23:40 +0000)]
Tease out the routine that reads the control block of an AST file from
the validation of an AST file against a specific set of options.

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

11 years agoPut something sane in the DWARF offset field for bitfield ObjC ivars.
Eli Friedman [Tue, 6 Nov 2012 23:40:48 +0000 (23:40 +0000)]
Put something sane in the DWARF offset field for bitfield ObjC ivars.
This is useful because unnamed bitfields can have effects on the
offsets which are not otherwise reflected in the DWARF information.

<rdar://problem/12629719>

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

11 years agoobjective-C modern rewriter. Insert line numbers in
Fariborz Jahanian [Tue, 6 Nov 2012 23:25:49 +0000 (23:25 +0000)]
objective-C modern rewriter. Insert line numbers in
translated code where new code makes the lines be off.
This is wip.

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

11 years agoRewriteModernObjC.cpp: Use Lexer::Stringify() on the file name of #line directive...
NAKAMURA Takumi [Tue, 6 Nov 2012 22:45:31 +0000 (22:45 +0000)]
RewriteModernObjC.cpp: Use Lexer::Stringify() on the file name of #line directive to escape Win32 path separator '\\'.

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

11 years agoImplement codegen for init_priority attribute properly - make sure it
Anton Korobeynikov [Tue, 6 Nov 2012 22:44:45 +0000 (22:44 +0000)]
Implement codegen for init_priority attribute properly - make sure it
works between the modules.
No functionality change on Darwin/Windows.
This fixes PR11480.

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

11 years agoBack out 167431+167437+167487; I didn't realize how incomplete our test
Eli Friedman [Tue, 6 Nov 2012 22:15:52 +0000 (22:15 +0000)]
Back out 167431+167437+167487; I didn't realize how incomplete our test
coverage of this code is.

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

11 years agoclang/lib/Driver/Tools.cpp: Fix abuse of StringRef.
NAKAMURA Takumi [Tue, 6 Nov 2012 22:02:00 +0000 (22:02 +0000)]
clang/lib/Driver/Tools.cpp: Fix abuse of StringRef.

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

11 years ago[libclang] Add some comments about the version constants for the libclang API.
Argyrios Kyrtzidis [Tue, 6 Nov 2012 21:21:49 +0000 (21:21 +0000)]
[libclang] Add some comments about the version constants for the libclang API.

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

11 years agoFix a silly mistake in r167437.
Eli Friedman [Tue, 6 Nov 2012 21:10:22 +0000 (21:10 +0000)]
Fix a silly mistake in r167437.

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

11 years agoclang/test/Driver/fsanitize.c: Speculative fix to improve test on win32, not to mix...
NAKAMURA Takumi [Tue, 6 Nov 2012 20:44:29 +0000 (20:44 +0000)]
clang/test/Driver/fsanitize.c: Speculative fix to improve test on win32, not to mix emissions into stdout.

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

11 years agoRemove C++11-isms I just introduced in r167482
Douglas Gregor [Tue, 6 Nov 2012 19:41:11 +0000 (19:41 +0000)]
Remove C++11-isms I just introduced in r167482

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

11 years agoIntroduce inferred framework modules into the module map file,
Douglas Gregor [Tue, 6 Nov 2012 19:39:40 +0000 (19:39 +0000)]
Introduce inferred framework modules into the module map file,
allowing a module map to be placed one level above the '.framework'
directories to specify that all .frameworks within that directory can
be inferred as framework modules. One can also specifically exclude
frameworks known not to work.

This makes explicit (and more restricted) behavior modules have had
"forever", where *any* .framework was assumed to be able to be built
as a module. That's not necessarily true, so we white-list directories
(with exclusions) when those directories have been audited.

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

11 years agoTeach Clang parser to reject C++11 attributes that appertain to declaration specifiers.
Michael Han [Tue, 6 Nov 2012 19:34:54 +0000 (19:34 +0000)]
Teach Clang parser to reject C++11 attributes that appertain to declaration specifiers.

We don't support any C++11 attributes that appertain to declaration specifiers so reject
the attributes in parser until we support them; this also conforms to what g++ 4.8 is doing.

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

11 years agoUpdates to user's manual and release notes for -fsanitize= options.
Richard Smith [Tue, 6 Nov 2012 19:23:14 +0000 (19:23 +0000)]
Updates to user's manual and release notes for -fsanitize= options.

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

11 years ago[c-index-test] When building with BUILD_CLANG_ONLY=YES, include c-index-test.
Argyrios Kyrtzidis [Tue, 6 Nov 2012 19:14:25 +0000 (19:14 +0000)]
[c-index-test] When building with BUILD_CLANG_ONLY=YES, include c-index-test.
It is part of libclang and has other uses besides running the clang tests.

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

11 years agoCleanup: 80-column violation
Manman Ren [Tue, 6 Nov 2012 19:05:29 +0000 (19:05 +0000)]
Cleanup: 80-column violation

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

11 years agoUse the -fsanitize=thread flag to unbreak buildbot.
Chad Rosier [Tue, 6 Nov 2012 18:16:37 +0000 (18:16 +0000)]
Use the -fsanitize=thread flag to unbreak buildbot.

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

11 years agoAdd unit tests for source locations of AST nodes.
Manuel Klimek [Tue, 6 Nov 2012 17:31:40 +0000 (17:31 +0000)]
Add unit tests for source locations of AST nodes.

Patch by Philip Craig.

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

11 years agoModern objective-C translator: Start adding line info to the
Fariborz Jahanian [Tue, 6 Nov 2012 17:30:23 +0000 (17:30 +0000)]
Modern objective-C translator: Start adding line info to the
translated source where it is needed. wip.

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

11 years agoBasic: Windows doesn't define S_IFIFO.
Daniel Dunbar [Tue, 6 Nov 2012 17:08:24 +0000 (17:08 +0000)]
Basic: Windows doesn't define S_IFIFO.

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

11 years agoUse -fsanitize= flag in docs for ASan/TSan
Alexey Samsonov [Tue, 6 Nov 2012 16:19:11 +0000 (16:19 +0000)]
Use -fsanitize= flag in docs for ASan/TSan

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

11 years agoFollow-up for r167411 to un-break ASan on Mac. Move SanitizerArgs to a header file...
Alexey Samsonov [Tue, 6 Nov 2012 15:09:03 +0000 (15:09 +0000)]
Follow-up for r167411 to un-break ASan on Mac. Move SanitizerArgs to a header file and use it on Darwin toolchain.

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

11 years agoRemove completely irrelevant code from USR generation.
Ted Kremenek [Tue, 6 Nov 2012 06:36:45 +0000 (06:36 +0000)]
Remove completely irrelevant code from USR generation.

Thanks to Richard Smith for pointing this out.  This code stopped
serving its purpose during r103212 in a refactoring.  My initial
fix was to add back the logic to abort the USR generation for
InternalLinkage, but enough tests broke suspiciously that I fear
that USR generation for cursors with InternalLinkage is now expected
by some clients (where it wasn't the case when the refactoring
took place).  I don't own this code anymore and have not looked
at it for some time, but clearly this code is dead and can be removed
pending further review on the proper logic here.

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

11 years agoDelete an outdated comment.
Nico Weber [Tue, 6 Nov 2012 05:20:23 +0000 (05:20 +0000)]
Delete an outdated comment.

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

11 years agoARM byval: when type alignment is bigger than ABI alignment, instead of
Manman Ren [Tue, 6 Nov 2012 04:58:01 +0000 (04:58 +0000)]
ARM byval: when type alignment is bigger than ABI alignment, instead of
disabling byval, we set realign to true.

It will perform an aligned alloca, and call memcpy to copy the byval
argument to the local variable.
Change the size threshold back to 64 bytes.

rdar://12596507

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

11 years ago[analyzer] Add symbol escapes logic to the SimpleStreamChecker.
Anna Zaks [Tue, 6 Nov 2012 04:20:57 +0000 (04:20 +0000)]
[analyzer] Add symbol escapes logic to the SimpleStreamChecker.

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

11 years ago[analyzer] Remove isWithinInlined. It's been replaced with inTopFrame().
Anna Zaks [Tue, 6 Nov 2012 04:20:54 +0000 (04:20 +0000)]
[analyzer] Remove isWithinInlined. It's been replaced with inTopFrame().

Thanks Jordan.

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

11 years agoPropagate CharUnits through CGObjCMac.cpp.
Eli Friedman [Tue, 6 Nov 2012 03:41:04 +0000 (03:41 +0000)]
Propagate CharUnits through CGObjCMac.cpp.

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

11 years agoMinor fix to ObjC layout bitmap metadata. Found while I was trying to
Eli Friedman [Tue, 6 Nov 2012 03:38:02 +0000 (03:38 +0000)]
Minor fix to ObjC layout bitmap metadata.  Found while I was trying to
refactor the code.

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

11 years agoClassify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as -fsanitiz...
Richard Smith [Tue, 6 Nov 2012 02:30:30 +0000 (02:30 +0000)]
Classify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as -fsanitize=divide-by-zero.

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

11 years ago[c-index-test] Do install c-index-test because it's not just for tests,
Argyrios Kyrtzidis [Tue, 6 Nov 2012 02:12:21 +0000 (02:12 +0000)]
[c-index-test] Do install c-index-test because it's not just for tests,
it's also setup as 'INTERNAL_TOOL'.

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

11 years agoPropagate CharUnits into ObjC CodeGen. No intended functional change.
Eli Friedman [Tue, 6 Nov 2012 01:51:20 +0000 (01:51 +0000)]
Propagate CharUnits into ObjC CodeGen.  No intended functional change.

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

11 years agoPer discussion on cfe-commits, treat -faddress-sanitizer,
Richard Smith [Tue, 6 Nov 2012 01:12:02 +0000 (01:12 +0000)]
Per discussion on cfe-commits, treat -faddress-sanitizer,
-fno-address-sanitizer, -fthread-sanitizer, -fno-thread-sanitizer, and
-fcatch-undefined-behavior as deprecated: produce a warning if they are used
pointing to the corresponding -fsanitize= option. In passing add the missing
'-' to some diagnostics.

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

11 years ago[PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.
Argyrios Kyrtzidis [Tue, 6 Nov 2012 00:35:04 +0000 (00:35 +0000)]
[PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.

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

11 years ago[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
Argyrios Kyrtzidis [Tue, 6 Nov 2012 00:35:02 +0000 (00:35 +0000)]
[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
reference instead of relying on computing it.

In general, if storage is no issue, it is preferable to deserialize info from
the PCH instead of trying to recompute it after the PCH was loaded.

The incentive to change this now was due to r155303 changing how friend template
classes in dependent contexts are handled; such classes can now be chained to
a previous template class but the computed InjectedClassNameType may be different
due to the extra template parameters from the dependent context.

The new handling requires more investigation but, in the meantime, writing out
InjectedClassNameType fixes PCH issue in rdar://12627738.

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

11 years agoHave the parser initialize Sema before it consumes the first
Douglas Gregor [Mon, 5 Nov 2012 23:58:27 +0000 (23:58 +0000)]
Have the parser initialize Sema before it consumes the first
token. This is important because the first token could actually be
after an #include that triggers a module import, which might use
either Sema or the AST consumer before it would have been initialized.

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

11 years agoSplit the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
Douglas Gregor [Mon, 5 Nov 2012 23:30:26 +0000 (23:30 +0000)]
Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
that we can model them as separate submodules.

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

11 years agoFrontend: Add support for reading named pipes as the main file.
Daniel Dunbar [Mon, 5 Nov 2012 22:53:33 +0000 (22:53 +0000)]
Frontend: Add support for reading named pipes as the main file.

 - The whole {File,Source}Manager is built around wanting to pre-determine the
   size of files, so we can't fit this in naturally. Instead, we handle it like
   we do STDIN, where we just replace the main file contents upfront.

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

11 years agoDelete comment I forgot to delete in my last change.
Nico Weber [Mon, 5 Nov 2012 22:50:26 +0000 (22:50 +0000)]
Delete comment I forgot to delete in my last change.

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

11 years agoUse Richard's BE_THE_HEADER trick to simplify a test. No intended behavior change.
Nico Weber [Mon, 5 Nov 2012 22:49:03 +0000 (22:49 +0000)]
Use Richard's BE_THE_HEADER trick to simplify a test. No intended behavior change.

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

11 years agoARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
Manman Ren [Mon, 5 Nov 2012 22:42:46 +0000 (22:42 +0000)]
ARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
the type alignment of the byval argument. This patch will disable byval in this case,
it also increases the size threshold for turning on byval.

A backend fix will be attempted.

rdar://12596507

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

11 years agoUse the individual -fsanitize=<...> arguments to control which of the UBSan
Richard Smith [Mon, 5 Nov 2012 22:21:05 +0000 (22:21 +0000)]
Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.

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

11 years agoAdd -fsanitize=<sanitizers> argument to driver and frontend, and add
Richard Smith [Mon, 5 Nov 2012 22:04:41 +0000 (22:04 +0000)]
Add -fsanitize=<sanitizers> argument to driver and frontend, and add
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the
various UBSan checks to be enabled and disabled separately. Right now, the
different modes can't be combined, but the intention is that combining UBSan
and the other sanitizers will be permitted in the near future.

Currently, the UBSan checks will all be enabled if any of them is; that will be
fixed by the next patch.

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

11 years agoRename LangOptions members for address sanitizer and thread sanitizer from
Richard Smith [Mon, 5 Nov 2012 21:48:12 +0000 (21:48 +0000)]
Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.

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

11 years agoFix module map for SSE4a builtins
Douglas Gregor [Mon, 5 Nov 2012 20:41:30 +0000 (20:41 +0000)]
Fix module map for SSE4a builtins

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

11 years agoMake cpuid.h actually work with -std=c99 <rdar://problem/12552716>.
Douglas Gregor [Mon, 5 Nov 2012 20:11:10 +0000 (20:11 +0000)]
Make cpuid.h actually work with -std=c99 <rdar://problem/12552716>.

While we're here, extend the module map to cover most of the
newly-added instrinsic headers. Only wmmintrin.h is missing, because
it needs to be split into AES/PCLMUL subheaders (as a separate commit).

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

11 years agoHash the various compiler version, target, preprocessor, and
Douglas Gregor [Mon, 5 Nov 2012 19:45:09 +0000 (19:45 +0000)]
Hash the various compiler version, target, preprocessor, and
header-search options into the module hash. We're just using
ADT/Hashing.hpp for this, which isn't as cryptographically strong as
I'd like, but it'll do. If someone contributes (say) and MD4
implementation, we'd happily switch to that.

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

11 years agoOn PowerPC64, integer arguments and return values need to be sign- or
Ulrich Weigand [Mon, 5 Nov 2012 19:13:42 +0000 (19:13 +0000)]
On PowerPC64, integer arguments and return values need to be sign- or
zero-extended to 64 bits.  This information is currently provided to
the back end by setting "signext" or "zeroext" attributes.  However,
this is done only for integer types *smaller* than i32, not for i32
itself.  This causes clang to generate code violating the ABI, which
results in a failure of the tramp3d-v4 test case (due to calling a
system library routine without ABI-required extension).

This patch implements custom versions of classifyArgumentType and
classifyReturnType for PPC64_SVR4_ABIInfo, which are the same as the
default versions except that they also classify "int" and "unsigned int"
as types needing extending.  This fixed tramp3d-v4 on PowerPC64.

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

11 years agoTests for 32bit version of block ivar layout metadata.
Fariborz Jahanian [Mon, 5 Nov 2012 18:14:34 +0000 (18:14 +0000)]
Tests for 32bit version of block ivar layout metadata.

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