summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace snprintf with a Twine. NFC.Benjamin Kramer2015-02-141-5/+3
| | | | llvm-svn: 229264
* Revise the implementation logic of sized deallocation: Do not automatically ↵Larisse Voufo2015-02-141-0/+5
| | | | | | | | generate weak definitions of the sized operator delete (in terms of unsized operator delete). Instead, provide the funcitonality via a new compiler flag, -fdef-sized-delete. The current implementation causes link-time ODR violations when the delete symbols are exported into the dynamic table. llvm-svn: 229241
* Revert "Revert r229082 for a bit, it caused PR22577."David Majnemer2015-02-141-0/+13
| | | | | | | This reverts commit r229123. It was a red herring, the bug was present without r229082. llvm-svn: 229205
* Revert r229082 for a bit, it caused PR22577.Nico Weber2015-02-131-13/+0
| | | | llvm-svn: 229123
* MS ABI: Implement /volatile:msDavid Majnemer2015-02-131-0/+13
| | | | | | | | | | | | The /volatile:ms semantics turn volatile loads and stores into atomic acquire and release operations. This distinction is important because volatile memory operations do not form a happens-before relationship with non-atomic memory. This means that a volatile store is not sufficient for implementing a mutex unlock routine. Differential Revision: http://reviews.llvm.org/D7580 llvm-svn: 229082
* [PowerPC] Remove the --no-tls-optimize workaround from the clang driverBill Schmidt2015-02-101-7/+0
| | | | llvm-svn: 228739
* -iframework option should be forwarded to linkerSteven Wu2015-02-061-0/+6
| | | | | | | | | | | | | | | Summary: -iframework option is used to specified System framework path so the path specified should be passed to linker as -F option rdar://problem/18234544 Reviewers: bob.wilson Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7106 llvm-svn: 228413
* [PowerPC] Re-disable linker optimizations for nowBill Schmidt2015-02-061-0/+7
| | | | llvm-svn: 228402
* Re-land r228258 and make clang-cl's /EHs- disable -fexceptions againReid Kleckner2015-02-051-3/+3
| | | | | | | | | | | After r228258, Clang started emitting C++ EH IR that LLVM wasn't ready to deal with, even when exceptions were disabled with /EHs-. This time, make /EHs- turn off -fexceptions while still emitting exceptional constructs in functions using __try. Since Sema rejects C++ exception handling constructs before CodeGen, landingpads should only appear in such functions as the result of a __try. llvm-svn: 228329
* [PowerPC] Revert workaround for TLS linker bugBill Schmidt2015-02-051-7/+0
| | | | | | | | | | | | | | | | In r227480, Ulrich Weigand introduced a workaround for a linker optimization bug that can create mis-optimized code for accesses to general-dynamic or local-dynamic TLS variables. The linker optimization bug only occurred for Clang/LLVM because of some inefficient code being generated for these TLS accesses. I have recently corrected LLVM to produce the efficient code sequence expected by the linkers, so this workaround is no longer needed. Therefore this patch reverts r227480. I've tested that the previous bootstrap failure no longer occurs with the workaround reverted. llvm-svn: 228253
* Driver: Stop forcing frame pointer usage on WindowsReid Kleckner2015-02-041-17/+39
| | | | | | | | | | | | | | | | | Previously, we would use a frame pointer by default on non-Linux OSs. On Linux, any optimization flags imply -fomit-frame-pointer. XCore always defaulted to -fomit-frame-pointer. Now x86 Windows matches our behavior on Linux. All other ISAs supported by Windows (ARM, x64) use xdata information, and frame pointers aren't useful. Frame pointers are now off by default for such targets, but can be forced via -fno-omit-frame-pointer and code using alloca(). In fact, on Win64 our frame-pointer prologue is not describable with UNWIND_INFO. This change is a workaround to avoid using the broken FP using prologue for most functions. This is PR22467. llvm-svn: 228236
* Replace isalnum with isAlphanumeric per reviewBen Langmuir2015-02-041-1/+2
| | | | | | Thanks Dmitri! llvm-svn: 228163
* Teaches the Clang driver to accept Cortex-A72Renato Golin2015-02-041-2/+2
| | | | | | | | | A previous commit added Cortex-A72 to LLVM, this teaches Clang to accept it as well. Patch by Ranjeet Singh. llvm-svn: 228141
* Make the default module cache user-specificBen Langmuir2015-02-031-1/+38
| | | | | | | | | Appends the username to the first component (after the temp dir) of the module cache path. If the username contains a character that shouldn't go into a path (for now conservatively allow [a-zA-Z0-9_]), we fallback to the user id. llvm-svn: 228013
* Use CLANG_LIBDIR_SUFFIX when looking for the gold plugin.Rafael Espindola2015-02-031-1/+2
| | | | | | Patch by İsmail Dönmez! llvm-svn: 227979
* PR 17421: Implemented -save-temps={obj|cwd} optionReid Kleckner2015-02-021-1/+1
| | | | | | | | | | | | | | | | | -save-temps=cwd is equivalent to -save-temps -save-temps=obj saves temporary file in the same directory as output This helps to avoid clobbering of temp files in case of parallel compilation with -save-temps of the files that have the same name but located in different directories. Patch by Artem Belevich Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D7304 llvm-svn: 227886
* Tweak behavior due to -fexceptions, in C++ mode, imply -fcxx-exceptionsFilipe Cabecinhas2015-01-311-3/+11
| | | | | | Added test llvm-svn: 227695
* Fix regression in r227409 where we were passing -fsyntax-onlyEric Christopher2015-01-301-0/+1
| | | | | | | | in all cases. Patch by Artem Belevich. llvm-svn: 227591
* [mips] Pass ABI name via -target-abi instead of target-featuresDaniel Sanders2015-01-301-11/+24
| | | | | | | | | | | | | | Patch by Vladimir Medic Reviewers: echristo, atanasyan, dsanders Reviewed By: atanasyan, dsanders Subscribers: llvm-commits, echristo, atanasyan Differential Revision: http://reviews.llvm.org/D6091 llvm-svn: 227583
* Remove unneeded codeFilipe Cabecinhas2015-01-301-2/+1
| | | | | | | We don't really care about enabling RTTI with -fexceptions, only with -fcxx-exceptions. llvm-svn: 227567
* clang-cl: Enable -fexceptions but not -fcxx-exceptions by defaultReid Kleckner2015-01-301-3/+3
| | | | | | This enables proper IRgen of SEH constructs. llvm-svn: 227528
* Add some more PS4 driver settings related to rtti and exceptions.Filipe Cabecinhas2015-01-291-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The PS4 defaults to -fno-rtti, and has to have rtti enabled when enabling exceptions. This commit makes clang add the -fno-rtti by default on the PS4, unless -frtti was passed in. It also diagnoses misuses for the PS4: - Exceptions need rtti. Warn and enable rtti if no rtti flag was passed, error if -fno-rtti was passed. I also added a more general warning for when -fno-rtti is the default (currently it's only on the PS4) and the vptr sanitizer is on. Fixed a few tests, due to different flag order when passing cc1 arguments. Reviewers: chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7250 llvm-svn: 227518
* [PowerPC] Work around TLS linker bugUlrich Weigand2015-01-291-0/+7
| | | | | | | | | | | Work around a bug in GNU ld (and gold) linker versions up to 2.25 that may mis-optimize code generated by this version of clang/LLVM to access general-dynamic or local-dynamic TLS variables. Bug is fixed here: https://sourceware.org/ml/binutils/2015-01/msg00318.html llvm-svn: 227480
* Ensure that -fsyntax-only with fortran 90 passes along silentlyEric Christopher2015-01-291-7/+12
| | | | | | | | | to the underlying gcc. PR22234 Patch by Artem Belevich. llvm-svn: 227409
* For the --be8 flag, check explicitly for pre-v7 / pre-v6m cores.Joerg Sonnenberger2015-01-281-2/+19
| | | | | | | | Those used the old Big Endian support on ARM and don't need flags. Refactor the logic in a separate common function, which also looks at -march. Add corresponding logic for the Linux toolchain. llvm-svn: 227393
* [clang] Use -android environment for all compiler-rt libs.Dan Albert2015-01-281-8/+6
| | | | | | | | | | | | | | | | Summary: This was already done for the sanitizers, but it needs to be done for the profile and builtin libs as well. Reviewers: srhines, timmurray, eugenis, samsonov Reviewed By: samsonov Subscribers: compnerd, cfe-commits Differential Revision: http://reviews.llvm.org/D7187 llvm-svn: 227392
* Fix part of r227215. PS4 code just omits leaf frame pointers.Filipe Cabecinhas2015-01-271-3/+4
| | | | llvm-svn: 227219
* Added more PS4 defaults for code generationFilipe Cabecinhas2015-01-271-2/+9
| | | | llvm-svn: 227215
* For NetBSD/ARM-EB, link with --be8. Support for the older BE32 isJoerg Sonnenberger2015-01-261-0/+2
| | | | | | currently not planned. llvm-svn: 227088
* Allows Clang to use LLVM's fixes-x18 optionRenato Golin2015-01-251-0/+5
| | | | | | | | | | | | | This patch allows clang to have llvm reserve the x18 platform register on AArch64. FreeBSD will use this in the kernel for per-cpu data but has no need to reserve this register in userland so will need this flag to reserve it. This uses llvm r226664 to allow this register to be reserved. Patch by Andrew Turner. llvm-svn: 227062
* Process the -fno-signed-zeros optimization flag (PR20870)Sanjay Patel2015-01-231-0/+2
| | | | | | | | | | | | | | | | | | The driver currently accepts but ignores the -fno-signed-zeros flag. This patch passes the flag through and enables 'nsz' fast-math-flag generation in IR. The existing OpenCL flag for the same functionality is made into an alias here. It may be removed in a subsequent patch. This should resolve bug 20870 ( http://llvm.org/bugs/show_bug.cgi?id=20870 ); patches for the optimizer were checked in at: http://llvm.org/viewvc/llvm-project?view=revision&revision=225050 http://llvm.org/viewvc/llvm-project?view=revision&revision=224583 Differential Revision: http://reviews.llvm.org/D6873 llvm-svn: 226915
* Implement command line options for stack probe spaceHans Wennborg2015-01-201-0/+9
| | | | | | | | | | | | | This code adds the -mstack-probe-size command line option and implements the /Gs compiler switch for clang-cl. This should fix http://llvm.org/bugs/show_bug.cgi?id=21896 Patch by Andrew H! Differential Revision: http://reviews.llvm.org/D6685 llvm-svn: 226601
* Adding option -fno-inline-asm to disallow inline asmSteven Wu2015-01-161-0/+5
| | | | | | | | | | | | | | | | Summary: This patch add a new option to dis-allow all inline asm. Any GCC style inline asm will be reported as an error. Reviewers: rnk, echristo Reviewed By: rnk, echristo Subscribers: bob.wilson, rnk, echristo, rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D6870 llvm-svn: 226340
* Revert "Insert random noops to increase security against ROP attacks (clang)"JF Bastien2015-01-141-11/+0
| | | | | | | This reverts commit: http://reviews.llvm.org/D3393 llvm-svn: 225947
* Insert random noops to increase security against ROP attacks (clang)JF Bastien2015-01-141-0/+11
| | | | | | | | | | | | | | | | | | | | A pass that adds random noops to X86 binaries to introduce diversity with the goal of increasing security against most return-oriented programming attacks. Command line options: -noop-insertion // Enable noop insertion. -noop-insertion-percentage=X // X% of assembly instructions will have a noop prepended (default: 50%, requires -noop-insertion) -max-noops-per-instruction=X // Randomly generate X noops per instruction. ie. roll the dice X times with probability set above (default: 1). This doesn't guarantee X noop instructions. In addition, the following 'quick switch' in clang enables basic diversity using default settings (currently: noop insertion and schedule randomization; it is intended to be extended in the future). -fdiversify This is the clang part of the patch. llvm part: D3392 http://reviews.llvm.org/D3393 Patch by Stephen Crane (@rinon) llvm-svn: 225910
* Driver: begin threading frontend support for SymbolRewriterSaleem Abdulrasool2015-01-091-0/+13
| | | | | | | | | | Allow blessed access to the symbol rewriter from the driver. Although the symbol rewriter could be invoked through tools like opt and llc, it would not accessible from the frontend. This allows us to read the rewrite map files in the frontend rather than the backend and enable symbol rewriting for actually performing the symbol interpositioning. llvm-svn: 225504
* R600: Handle amdgcn tripleTom Stellard2015-01-061-0/+2
| | | | | | For now there is no difference between amdgcn and r600. llvm-svn: 225294
* Set the default ISA for OpenBSD/mips64 to MIPS III.Brad Smith2015-01-061-0/+4
| | | | llvm-svn: 225241
* Fix formatting. NFC.Rafael Espindola2015-01-051-6/+3
| | | | llvm-svn: 225168
* Really don't warn about -flto/fno-lto :-(Rafael Espindola2015-01-031-8/+27
| | | | | | This should fix the last bots. llvm-svn: 225100
* Also avoid warning on -flto/-fno-lto on linux.Rafael Espindola2015-01-021-2/+7
| | | | | | | On OS X a .s file is preprocessed, it is not on linux, which is why the warning was still showing up on linux but not OS X. llvm-svn: 225095
* Don't warn on unused -fno-lto.Rafael Espindola2015-01-021-2/+3
| | | | | | | It is somewhat common for CFLAGS to be used with .s files. We were already ignoring -flto. This patch just does the same for -fno-lto. llvm-svn: 225093
* Driver: honour the clang-cl behaviour on ARM as wellSaleem Abdulrasool2015-01-021-3/+4
| | | | | | | | | | Unfortunately, MSVC does not indicate to the driver what target is being used. This means that we cannot correctly select the target architecture for the clang_rt component. This breaks down when targeting windows with the clang driver as opposed to the clang-cl driver. This should fix the native ARM buildbot tests. llvm-svn: 225089
* Driver: reuse getCompilerRT in place of addSanitizerRTWindowsSaleem Abdulrasool2015-01-021-16/+16
| | | | | | | | | | | The logic for addSanitizerRTWindows was performing the same logical operation as getCompilerRT, which was previously fully generalised for Linux and Windows. This avoids having a duplication of the logic for building up the name of a clang_rt component. This change does move the current limitation for Windows into getArchNameForCompilerRTLib, where it is assumed that the architecture for Windows is always i386. llvm-svn: 225087
* Driver: unify compiler-rt component selectionSaleem Abdulrasool2014-12-301-37/+28
| | | | | | | | | | | | | Unify the component handling for compiler-rt. The components are regularly named, built up from: ${LIBRARY_PREFIX}clang_rt.${component}-${arch}[-${environment}]${LIBRARY_SUFFIX} Unify the handling for all the various components, into a single path to link against the various components in a number of places. This reduces duplication of the clang_rt library name construction logic. llvm-svn: 225013
* Driver: whitespaceSaleem Abdulrasool2014-12-301-9/+7
| | | | | | Fixup some whitespace/style issues. NFC. llvm-svn: 225012
* Driver: use the canonical library prefix on WindowsSaleem Abdulrasool2014-12-301-1/+2
| | | | | | | | Unlike Unices, Windows does not use a library prefix. Use the traditional naming scheme even for Windows itanium environments. This makes the builtins behave more like the sanitisers as well. llvm-svn: 224996
* Driver: unify addClangRT{Linux,Windows}Saleem Abdulrasool2014-12-301-20/+16
| | | | | | | | The differences are pretty superficial: - .lib vs .a extensions - whether or not to link (potentially) incorrectly against libgcc_s llvm-svn: 224975
* Add driver flags -ftrigraphs, -fno-trigraphs.Nico Weber2014-12-231-2/+5
| | | | | | | | | | | | | | | | | -trigraphs is now an alias for -ftrigraphs. -fno-trigraphs makes it possible to explicitly disable trigraphs, which couldn't be done before. clang -std=c++11 -fno-trigraphs now builds without GNU extensions, but with trigraphs disabled. Previously, trigraphs were only disabled in GNU modes or with -std=c++1z. Make the new -f flags the cc1 interface too. This requires changing -trigraphs to -ftrigraphs in a few cc1 tests. Related to PR21974. llvm-svn: 224790
* Reapply "Change -save-temps to emit unoptimized bitcode files."Bob Wilson2014-12-211-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | This reapplies r224503 along with a fix for compiling Fortran by having the clang driver invoke gcc (see r224546, where it was reverted). I have added a testcase for that as well. Original commit message: It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224688
OpenPOWER on IntegriCloud