Commit Graph

54271 Commits

Author SHA1 Message Date
Pavel Chupin 4a29468dcd [x32] Handle -m64/-m32 switches by Driver in x32 mode
Summary:
Adding remaining 2 cases handling:
* from x32 to 32 via -m32
* from x32 to 64 via -m64

Test Plan: linux-ld test updated

Reviewers: chandlerc, atanasyan

Subscribers: cfe-commits, zinovy.nis

Differential Revision: http://reviews.llvm.org/D4930

llvm-svn: 215899
2014-08-18 15:38:38 +00:00
Sylvestre Ledru b248256089 Fix a memory leak in one of the test unit. Silent coverity warning CID 1095912
llvm-svn: 215898
2014-08-18 15:18:56 +00:00
Sylvestre Ledru 75c2914114 Add the break in the switch case (even if there is llvm_unreachable. It will silent coverity warning CID 1231654
llvm-svn: 215897
2014-08-18 15:13:44 +00:00
Sylvestre Ledru 0ae4074599 Update the call to llvm::sys::fs::UniqueID to match the definition: UniqueID(uint64_t Device, uint64_t File)
Fixes CID 1095247

llvm-svn: 215896
2014-08-18 15:00:11 +00:00
Craig Topper 4dd9b43c8d Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size.
llvm-svn: 215869
2014-08-17 23:49:53 +00:00
Rafael Espindola 8d04452973 Use the pointer-like API of ErrorOr.
Thanks to David Blaikie for the suggestion.

llvm-svn: 215866
2014-08-17 23:31:27 +00:00
Rafael Espindola 91ac8dfa9d Create a std::unique_ptr earlier.
Thanks to David Blaikie for the suggestion.

llvm-svn: 215865
2014-08-17 23:27:13 +00:00
Rafael Espindola 1a1b1562e6 Use std::unique_ptr in a few methods that take ownership.
llvm-svn: 215864
2014-08-17 23:12:27 +00:00
Rafael Espindola b3402685f6 Update for llvm api changes.
llvm-svn: 215856
2014-08-17 22:20:41 +00:00
Rafael Espindola 04ab21d75d Convert a few ownership comments with std::unique_ptr.
llvm-svn: 215853
2014-08-17 22:12:58 +00:00
Manuel Klimek f560b22a92 Do not rely on bin/ path prefix in tests.
llvm-svn: 215845
2014-08-17 19:11:18 +00:00
Rafael Espindola 69d2ad031b Add a test for -no-canonical-prefixes.
llvm-svn: 215836
2014-08-17 16:22:16 +00:00
Olivier Goffart fc8f893192 Fix assertion on asm register that are "%"
Name might be empty again after we removed the '%' prefix
and Name[0] would assert.

Found on code like
register int foo asm("%" MACRO);
where MACRO was supposed to be defined in a header file that was not found.

llvm-svn: 215834
2014-08-17 13:19:48 +00:00
Abramo Bagnara 152eb39cc6 Uniformed parsing of GNU attributes at line beginnning and added GNU attributes parsing FIXMEs.
llvm-svn: 215814
2014-08-16 08:29:27 +00:00
Ben Langmuir fe971d9894 When loading a module with no local entities, still bump the size of the
tables that correspond to ContinuousRangeMaps, since the keys to those
maps need to be unique, or we may map to the wrong offset.

This fixes a crash + malformed AST file seen when loading some modules
that import Cocoa on Darwin, which is a module with no contents except
imports of other modules. Unfortunately I have not been able to find a
reduced test case that reproduces this problem.

Also add an assert that we aren't mapping one key to multiple values
in CRM.  We ought to be able to say there are no duplicate keys at all,
but there are a bunch of 0 -> 0 mappings that are showing up, probably
coming from the source location table.

llvm-svn: 215810
2014-08-16 04:54:18 +00:00
Nick Lewycky 12be8efc62 Clarify.
llvm-svn: 215808
2014-08-16 02:14:37 +00:00
Nick Lewycky 367cbddfc2 Try indenting to put all the text inside the block.
llvm-svn: 215807
2014-08-16 02:11:54 +00:00
Nick Lewycky e9a774022a Document what's experimental about __attribute__((enable_if)). PR20392
llvm-svn: 215806
2014-08-16 02:09:42 +00:00
Argyrios Kyrtzidis ac3997eb52 [libclang] Introduce clang_File_isEqual for comparing CXFile handles.
llvm-svn: 215796
2014-08-16 00:26:19 +00:00
Sean Silva bcd500e09a Revert "Update for LLVM change (StringSaver)"
This reverts commit r215785 / 170ebf4f19459ae51a9561d0e65c87ee4c9b2c97.

LLD has some StringSavers that need to be updated. One of which takes a
lock and I need to investigate that more closely.

llvm-svn: 215791
2014-08-15 23:39:12 +00:00
Nico Weber ae4bb8c8f4 Make sure that vtables referenced from delay-parsed templates get referenced.
This fixes PR20671, see the bug for details. In short, ActOnTranslationUnit()
calls DefineUsedVTables() and only then PerformPendingInstantiations(). But
PerformPendingInstantiations() is what does delayed template parsing, so
vtables only references from late-parsed templates weren't marked used.

As a fix, move the SavePendingInstantiationsAndVTableUsesRAII in
PerformPendingInstantiations() up above the delayed template parsing code.
That way, vtables referenced from templates end up in the RAII object, and the
call to DefineUsedVTables() in PerformPendingInstantiations() marks them used.

llvm-svn: 215786
2014-08-15 23:21:41 +00:00
Sean Silva 43bd97c77b Update for LLVM change (StringSaver)
There is more cleanup to be done here. Once
llvm::sys::Process::GetArgumentVector is switched over to StringSaver,
we can simplify this code a fair amount.

llvm-svn: 215785
2014-08-15 23:18:49 +00:00
Nico Weber ccec9d8cee Add a RAII class for saving and restoring instantiations and uses. No behavior change.
llvm-svn: 215780
2014-08-15 22:29:14 +00:00
Nico Weber 55048cf141 Wrap to 80 columns, no behavior change.
llvm-svn: 215776
2014-08-15 22:15:00 +00:00
Sean Silva 5d62c26fa0 Rename as suggested by dblaikie
llvm-svn: 215774
2014-08-15 21:40:51 +00:00
Sean Silva 070cd2d9d4 ArrayRef'ize
I've shied away from ArrayRef'izing CompilerInvocation::CreateFromArgs
in this commit because that is a less localized change.

llvm-svn: 215773
2014-08-15 21:38:36 +00:00
David Blaikie 0c8e3f2fdd DebugInfo: While loop backedge should be attribute to the start of the while statement.
A little test case simplification - this could be simplified further,
though there are certainly interesting connections to the if/else
construct so I'm hesitant to remove that entirely though it does appear
somewhat unrelated.

(similar fix to r215766, related to PR19864)

llvm-svn: 215768
2014-08-15 21:11:25 +00:00
Sean Silva 0ee846ff3c Rename this function to better reflect its purpose
Thanks to dblaikie for the impetus to look for a better name.

llvm-svn: 215767
2014-08-15 20:59:03 +00:00
David Blaikie 15c4956b3a DebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for loop, to the start of the loop.
This avoids debuggers stepping to strange places (like the last
statement in the loop body, or the first statement in the if).

This is not the whole answer, though - similar bugs no doubt exist in
other loops (patches to follow) and attributing exception handling code
to the correct line is also tricky (based on the previous fix to
PR19864, exception handling is still erroneously attributed to the 'if'
line).

llvm-svn: 215766
2014-08-15 20:50:45 +00:00
James Dennett 64fa12372c Typo fix in comments: definintion -> definition
llvm-svn: 215764
2014-08-15 20:04:40 +00:00
Sean Silva 6a9b0f9008 [cleanup] Rename this function to better reflect its purpose. NFC.
This also suggests some refactoring to simplify this code. Basically, a
ton of complexity in this argument handling code comes from the need to
save const char *'s in stable storage for pushing onto argv.
It seems like llvm:🆑:StringSaver can be improved to cover all the
needs here.

llvm-svn: 215761
2014-08-15 19:23:53 +00:00
Sean Silva bbabefe1b1 [cleanup] Range-for'ify this loop. NFC.
llvm-svn: 215760
2014-08-15 19:23:50 +00:00
Sean Silva 9a6bdf8187 [cleanup] Factor out handling CC1 tools. NFC.
llvm-svn: 215759
2014-08-15 19:23:47 +00:00
Samuel Benzaquen e1e749322f Add missing matchers to the dynamic registry.
Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D4910

llvm-svn: 215757
2014-08-15 19:13:27 +00:00
Sean Silva b5060477e0 [cleanup] Factor out setting the driver's install dir. NFC.
llvm-svn: 215756
2014-08-15 18:58:15 +00:00
Sean Silva 22b4a3444c [cleanup] Factor out initializing the DianosticOptions. NFC.
llvm-svn: 215755
2014-08-15 18:58:12 +00:00
Sean Silva 965bb99180 [cleanup] Factor out adjusting "cl.exe" to "clang-cl.exe". NFC.
llvm-svn: 215754
2014-08-15 18:58:09 +00:00
Sean Silva 2103c38a99 [cleanup] Factor out some checks. NFC.
The core logic in main() is actually pretty simple, but there's lots of
stuff that has been added over time which obscures the flow of the code.
In upcoming patches, I'll be pulling more stuff out of the main
codepath.

I'm open to naming suggestions for these helper functions.

llvm-svn: 215751
2014-08-15 18:50:00 +00:00
Reid Kleckner b9538a6d09 MS ABI: Virtual member pointer thunks are not unnamed_addr
They can be compared for identity.

llvm-svn: 215745
2014-08-15 18:12:40 +00:00
Matt Arsenault dbb84916d9 R600: Add ldexp intrinsic
llvm-svn: 215738
2014-08-15 17:44:32 +00:00
Fariborz Jahanian 4eda2c0086 Objective-C. Do not warn if user is using property-dox syntax to name a
user provided setter name (as declared in @property attribute declaration).
rdar://18022762

llvm-svn: 215736
2014-08-15 17:39:00 +00:00
Rafael Espindola 1e08577586 Move some code into a helper function. NFC.
llvm-svn: 215731
2014-08-15 17:14:35 +00:00
Rafael Espindola d76eb44cdf Use a valid arch name in this triple.
llvm-svn: 215726
2014-08-15 16:55:25 +00:00
Samuel Benzaquen 8e7f99647d Add isDeleted() matcher for FunctionDecl nodes.
Reviewers: klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D4911

llvm-svn: 215714
2014-08-15 14:20:59 +00:00
Aaron Ballman 71291bc4a7 Const-correctness, return-after-else, and formatting updates. NFC.
llvm-svn: 215706
2014-08-15 12:38:17 +00:00
Aaron Ballman 5c98a23e80 There are no overloads of this virtual function, nor are there any callers of it. NFC.
llvm-svn: 215705
2014-08-15 12:34:08 +00:00
Aaron Ballman b00885898e Adding const-qualifiers to auto declarations. NFC.
llvm-svn: 215704
2014-08-15 12:29:39 +00:00
Yi Kong 70cf4c626e arm_acle.h: Small cleanup
Since __SIZEOF_LONG_LONG__ is always defined as 8 on ARM targets,
there's no point in checking this. NFC.

Patch by Moritz Roth.

llvm-svn: 215697
2014-08-15 08:53:22 +00:00
Daniel Jasper ea79ea1627 clang-format: Prefer breaking after return type over template param
Before:
  typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa<
      aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bool *aaaaaaaaaaaaaaaaaa,
                                                   bool *aa) {}

After:
  typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa
  aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      bool *aaaaaaaaaaaaaaaaaa, bool *aa) {}

llvm-svn: 215693
2014-08-15 05:00:39 +00:00
Daniel Jasper 497d9fdcf8 clang-format: [proto] Understand text-format nesting without :
Before:
  option (MyProto.options) = {
    field_c : "OK" msg_field{field_d : 123}
  };

After:
  option (MyProto.options) = {
    field_c : "OK"
    msg_field{field_d : 123}
  };

(Note that the colon after "msg_field" is optional).

llvm-svn: 215692
2014-08-15 05:00:35 +00:00