Rafael Espindola
a36e78ef5d
Use llvm::sys::fs::createTemporaryFile.
...
llvm-svn: 185717
2013-07-05 20:00:06 +00:00
Craig Topper
5603df45df
Use SmallVectorImpl& for function arguments instead of SmallVector.
...
llvm-svn: 185715
2013-07-05 19:34:19 +00:00
Rafael Espindola
1d0912a475
We don't need to check for windows' error codes in here.
...
The operator== calls equivalent which calls default_error_condition which
handles windows to posix conversion.
llvm-svn: 185702
2013-07-05 14:15:24 +00:00
Benjamin Kramer
17381a0627
Use the multiple argument form of path::append.
...
llvm-svn: 185164
2013-06-28 16:25:46 +00:00
Rafael Espindola
157f34bd31
Update for llvm::sys::fs::unique_file not creating directories.
...
llvm-svn: 185127
2013-06-28 03:49:04 +00:00
Rafael Espindola
73c23a7182
Small improvements to createOutputFile.
...
* Use a single stat to find out if the file exists and if it is a regular file.
* Use early returns when possible.
* Add comments explaining why we have each check.
llvm-svn: 185091
2013-06-27 18:26:26 +00:00
Rafael Espindola
380988340c
Remove PathV1.h from CompilerInvocation.cpp.
...
llvm-svn: 184918
2013-06-26 05:40:30 +00:00
Rafael Espindola
9678d27140
Use llvm::sys::fs::getMainExecutable.
...
llvm-svn: 184915
2013-06-26 05:03:40 +00:00
Rafael Espindola
399ab33a37
Remove PathV1.h from CompilerInstance.cpp.
...
llvm-svn: 184913
2013-06-26 04:32:59 +00:00
Rafael Espindola
f5e5bc4703
Don't use PathV1.h in ASTUnit.cpp.
...
llvm-svn: 184912
2013-06-26 04:26:38 +00:00
Rafael Espindola
a96bd562c2
Remove the last use of PathWithStatus.
...
llvm-svn: 184909
2013-06-26 04:12:57 +00:00
Rafael Espindola
bc4aa5547e
Use llvm::sys::fs::unique_file.
...
llvm-svn: 184908
2013-06-26 04:02:37 +00:00
Rafael Espindola
bc7d949b32
Remove some uses of llvm::sys::Path.
...
llvm-svn: 184907
2013-06-26 03:52:38 +00:00
Nick Lewycky
d3f3e4f04c
Make -vectorize-... proper cc1 flags instead of abusing -backend-option. Fixes
...
usage of clang as a library.
llvm-svn: 184812
2013-06-25 01:49:44 +00:00
Argyrios Kyrtzidis
48d88de2af
[libclang/codecompletion] Make sure the top-level decl hash takes into account ImportDecls.
...
The top-level hash is used to determine if we need to update the global code-completion results.
ImportDecls did not affect the hash so a newly introduced ImportDecl would not trigger an update of the global results.
rdar://14202797
llvm-svn: 184782
2013-06-24 21:19:12 +00:00
Richard Smith
6ea058245e
Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
...
follow.
llvm-svn: 184678
2013-06-24 01:45:33 +00:00
Benjamin Kramer
a157d0503d
Remove duplicated case.
...
llvm-svn: 184640
2013-06-22 16:44:45 +00:00
Nick Lewycky
92a6c74bbf
Fix a leak of TargetMachine in clang. We'll continue to leak it on purpose if
...
given -disable-free. (Reviewed by John McCall over IRC.)
llvm-svn: 184595
2013-06-21 21:15:32 +00:00
Douglas Gregor
963c553564
[Modules] If a module map resides in a system header directory, treat it as a system module.
...
This prevents -pedantic from causing warnings in the system headers
used to create modules. Fixes <rdar://problem/14201171>.
llvm-svn: 184560
2013-06-21 16:28:10 +00:00
Lawrence Crowl
b53e5483b0
This patch adds new private headers to the module map. Private
...
headers may be included from within the module, but not from outside
the module.
llvm-svn: 184471
2013-06-20 21:14:14 +00:00
Rafael Espindola
be3b12b004
Use the new name of getUniqueID.
...
llvm-svn: 184432
2013-06-20 15:12:38 +00:00
Manman Ren
9691f7fa35
Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
...
These options will add a module flag with name "Dwarf Version".
The behavior flag is currently set to Warning, so when two values disagree,
a warning will be emitted.
llvm-svn: 184276
2013-06-19 01:46:49 +00:00
Rafael Espindola
fc92e84586
Use llvm::sys::fs::can_write.
...
llvm-svn: 184234
2013-06-18 20:58:25 +00:00
Rafael Espindola
f9e9bb8858
Use llvm::sys::fs::GetUniqueID.
...
llvm-svn: 184218
2013-06-18 19:40:07 +00:00
John McCall
1fe2a8c87e
Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!
...
llvm-svn: 184166
2013-06-18 02:46:29 +00:00
Reid Kleckner
898229ab4b
[Driver] Refactor clang driver to use LLVM's Option library
...
The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere
As discussed in the review, this change includes using directives in
header files. I'll make follow up changes to remove those in favor of
name specifiers.
Reviewers: espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D975
llvm-svn: 183989
2013-06-14 17:17:23 +00:00
Rafael Espindola
dcf73d2275
Don't depend on the transitive inclusion of PathV1.h.
...
llvm-svn: 183945
2013-06-13 21:09:29 +00:00
Rafael Espindola
18556de316
Use the sys::RemoveFileOnSignal that takes a StringRef.
...
llvm-svn: 183944
2013-06-13 21:02:40 +00:00
Benjamin Kramer
33d4330393
Modernize some low-hanging PathV1 uses.
...
llvm-svn: 183903
2013-06-13 14:26:04 +00:00
Rafael Espindola
a3346d8765
Use the global functions instead of the Program methods.
...
llvm-svn: 183861
2013-06-12 20:44:26 +00:00
Rafael Espindola
be5138885d
Include PathV1.h in files that use it.
...
This is preparation for replacing Path.h with PathV2.h.
llvm-svn: 183781
2013-06-11 19:59:07 +00:00
Argyrios Kyrtzidis
d6f57221c8
Modify a comment to reflect changes of r183717.
...
llvm-svn: 183751
2013-06-11 16:42:34 +00:00
Benjamin Kramer
65745dc0b1
ASTUnit: Invert the dependency of PrecompilePreambleAction on PrecompilePreambleConsumer.
...
Actions outlive consumers. PR16295. Found by AddressSanitizer.
llvm-svn: 183741
2013-06-11 13:07:19 +00:00
Argyrios Kyrtzidis
f0168de936
[libclang] Allow building a precompiled preamble with compiler errors
...
A while ago we allowed libclang to build a PCH that had compiler errors; this was to retain the performance
afforded by a PCH even if the user's code is in an intermediate state.
Extend this for the precompiled preamble as well.
rdar://14109828
llvm-svn: 183717
2013-06-11 00:36:55 +00:00
Jordan Rose
e2fad6d754
Handle Unicode characters in fix-it replacement strings.
...
Patch by Sukolsak Sakshuwong!
llvm-svn: 183535
2013-06-07 17:16:01 +00:00
Aaron Ballman
5d041beb4e
Adding support for MSVC #pragma detect_mismatch functionality by emitting a FAILIFMISMATCH linker command into the object file.
...
llvm-svn: 183178
2013-06-04 02:07:14 +00:00
Argyrios Kyrtzidis
dc9fdaf217
[modules] If we hit a failure while loading a PCH/module, abort parsing instead of trying to continue in an invalid state.
...
Also don't let libclang create a PCH with such an error.
Fixes rdar://13953768
llvm-svn: 182629
2013-05-24 05:44:08 +00:00
Richard Smith
0b1f476888
Revert r182331, these checks should be based on the target not the host.
...
llvm-svn: 182333
2013-05-20 23:40:27 +00:00
Richard Smith
fcf713ac24
Move two Darwin-specific hacks into #ifdef __APPLE__. These were stat'ing
...
nonexistent Darwin-specific files on every module build.
llvm-svn: 182331
2013-05-20 23:17:08 +00:00
Richard Smith
1fa5d64b76
C++1y deduced return types: when we deduce a return type for a function which
...
we loaded from PCH, if we're building another PCH, create an update record to
patch the return type of the earlier declaration.
llvm-svn: 181659
2013-05-11 05:45:24 +00:00
Douglas Gregor
d7193795bd
[Modules] Extend Darwin hack to include the modification time of SystemVersion.plist.
...
Fixes <rdar://problem/13856838>.
llvm-svn: 181635
2013-05-10 21:54:08 +00:00
Argyrios Kyrtzidis
1c7455f42f
[libclang] When parsing with CXTranslationUnit_ForSerialization, make sure to install the ASTWriter that we create as an ASTMutationListener.
...
Fixes rdar://13833268
llvm-svn: 181575
2013-05-10 01:28:51 +00:00
Argyrios Kyrtzidis
1054bbf08d
[PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.
...
This made sense in pre-module era, before merging of HeaderFileInfos was introduced.
Final part of rdar://13840148.
llvm-svn: 181490
2013-05-08 23:46:55 +00:00
Richard Smith
a3d3bd215b
C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
...
llvm-svn: 181388
2013-05-08 02:12:03 +00:00
Richard Smith
0a715429b9
C++1y: Update __cplusplus to temporary value 201305L to allow detection of provisional C++1y support.
...
Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from
the C++ features study group), and update documentation to match.
llvm-svn: 181342
2013-05-07 19:32:56 +00:00
Benjamin Kramer
1ce5d80066
Use remove_if to erase parts of a vector. Avoids O(n^2) worst cases.
...
llvm-svn: 181150
2013-05-05 12:39:28 +00:00
Dmitri Gribenko
44ebbd5436
Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None
...
Patch by Robert Wilhelm.
llvm-svn: 181139
2013-05-05 00:41:58 +00:00
Argyrios Kyrtzidis
56c56d218d
Revert r177218.
...
Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag.
llvm-svn: 181073
2013-05-03 23:20:27 +00:00
Douglas Gregor
30071cead9
Remove DiagnosticConsumer::clone(), a bad idea that is now unused.
...
llvm-svn: 181070
2013-05-03 23:07:45 +00:00
Douglas Gregor
6b930967e8
When building a module, forward diagnostics to the outer diagnostic consumer.
...
Previously, we would clone the current diagnostic consumer to produce
a new diagnostic consumer to use when building a module. The problem
here is that we end up losing diagnostics for important diagnostic
consumers, such as serialized diagnostics (where we'd end up with two
diagnostic consumers writing the same output file). With forwarding,
the diagnostics from all of the different modules being built get
forwarded to the one serialized-diagnostic consumer and are emitted in
a sane way.
Fixes <rdar://problem/13663996>.
llvm-svn: 181067
2013-05-03 22:58:43 +00:00