summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Driver] Consolidate tools and toolchains by target platform. (NFC)David L. Jones2017-03-081-11005/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (This is a move-only refactoring patch. There are no functionality changes.) This patch splits apart the Clang driver's tool and toolchain implementation files. Each target platform toolchain is moved to its own file, along with the closest-related tools. Each target platform toolchain has separate headers and implementation files, so the hierarchy of classes is unchanged. There are some remaining shared free functions, mostly from Tools.cpp. Several of these move to their own architecture-specific files, similar to r296056. Some of them are only used by a single target platform; since the tools and toolchains are now together, some helpers now live in a platform-specific file. The balance are helpers related to manipulating argument lists, so they are now in a new file pair, CommonArgs.h and .cpp. I've tried to cluster the code logically, which is fairly straightforward for most of the target platforms and shared architectures. I think I've made reasonable choices for these, as well as the various shared helpers; but of course, I'm happy to hear feedback in the review. There are some particular things I don't like about this patch, but haven't been able to find a better overall solution. The first is the proliferation of files: there are several files that are tiny because the toolchain is not very different from its base (usually the Gnu tools/toolchain). I think this is mostly a reflection of the true complexity, though, so it may not be "fixable" in any reasonable sense. The second thing I don't like are the includes like "../Something.h". I've avoided this largely by clustering into the current file structure. However, a few of these includes remain, and in those cases it doesn't make sense to me to sink an existing file any deeper. Reviewers: rsmith, mehdi_amini, compnerd, rnk, javed.absar Subscribers: emaste, jfb, danalbert, srhines, dschuff, jyknight, nemanjai, nhaehnle, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30372 llvm-svn: 297250
* Add arch-specific directory to search pathPirama Arumuga Nainar2017-03-031-1/+24
| | | | | | | | | | | | | | | | | Summary: This change adds an arch-specific subdirectory in <ResourceDir>/lib/<OS> to the linker search path. This path also gets added as '-rpath' for native compilation if a runtime is linked in as a shared object. This allows arch-specific libraries to be installed alongside clang. Reviewers: danalbert, cbergstrom, javed.absar Subscribers: srhines Differential Revision: https://reviews.llvm.org/D30015 llvm-svn: 296927
* [PowerPC] Enable -fomit-frame-pointer by default for PPCNemanja Ivanovic2017-03-031-0/+3
| | | | | | | | | | | | As is the case on platforms like Mips, X86 and SystemZ, the -fomit-frame-pointer should be enabled by default on PPC when optimizing at -O1 and above. This brings the behaviour of LLVM on PPC in line with GCC. Committing on behalf of Hiroshi Inoue. Differential Revision: https://reviews.llvm.org/D29750 llvm-svn: 296861
* Set ABIs correctly for OpenBSD/arm; soft float and aapcs-linux.Brad Smith2017-02-281-0/+2
| | | | llvm-svn: 296430
* [Driver] Move architecture-specific free helper functions to their own files.David L. Jones2017-02-241-1383/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves helper functions that are CPU-specific out of Driver.cpp and to separate implementation files. The new files are named for the architecture, e.g. ARMArch.cpp. The next step after this will be to move OS-specific code, which I expect will include many of the tool implementations, to similarly separate files. Some CPU-specific functions are not being moved just yet. In cases where the only caller is the platform-specific tools, I plan to move them together. An example is Hexagon, where the only caller of the architecture-specific functions are the tools themselves. (I'm happy to revise this choice, it just seems like less churn to me.) This does mean that some functions which were previously static are now exposed through the library header Driver.h. Reviewers: rsmith, javed.absar Subscribers: aemerson, danalbert, srhines, dschuff, jyknight, nemanjai, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30315 llvm-svn: 296056
* Driver: inline a single caller of a function (NFC)Saleem Abdulrasool2017-02-191-9/+1
| | | | | | Inline the addCompilerRT call to the single caller. NFC. llvm-svn: 295620
* Always use --eh-frame-hdr on OpenBSD, even for -staticBrad Smith2017-02-191-1/+1
| | | | llvm-svn: 295614
* Link static PIE programs against rcrt0.o on OpenBSDBrad Smith2017-02-191-0/+4
| | | | | | Patch by Stefan Kempf. llvm-svn: 295610
* [CUDA] Don't pass -stack-protector to NVPTX compilations.Justin Lebar2017-02-191-19/+23
| | | | | | | | | We can't support stack-protector on NVPTX because NVPTX doesn't expose a stack to the compiler! Fixes PR32009. llvm-svn: 295609
* [XRAY][MIPS] Add -fxray-instrument for mips/mipsel/mips64/mips64elSagar Thakur2017-02-151-0/+4
| | | | | | | | | Summary: Adds xray instrument option for mips/mipsel/mips64/mips64el. Reviewed by sdardis, dberris Differential: D27698 llvm-svn: 295163
* [Driver] Use stem() and not filename().Davide Italiano2017-02-111-1/+1
| | | | | | | | | | On Windows the filename might have an extension, namely `.exe`, so the search will fail. Sorry, I don't have a good way to test this as it seems to fail only in some weird configurations. r284430 has the same modification for Fuchsia. llvm-svn: 294879
* [XRay] Implement powerpc64le xray.Tim Shen2017-02-101-0/+1
| | | | | | | | | | | | | | | | | | Summary: powerpc64 big-endian is not supported, but I believe that most logic can be shared, except for xray_powerpc64.cc. Also add a function InvalidateInstructionCache to xray_util.h, which is copied from llvm/Support/Memory.cpp. I'm not sure if I need to add a unittest, and I don't know how. Reviewers: dberris, echristo, iteratee, kbarton, hfinkel Subscribers: mehdi_amini, nemanjai, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29742 llvm-svn: 294781
* [DebugInfo] Added support to Clang FE for generating debug info for ↵Amjad Aboud2017-02-091-0/+5
| | | | | | | | | | | preprocessor macros. Added "-fdebug-macro" flag (and "-fno-debug-macro" flag) to enable (and to disable) emitting macro debug info. Added CC1 "-debug-info-macro" flag that enables emitting macro debug info. Differential Revision: https://reviews.llvm.org/D16135 llvm-svn: 294637
* [windows] [asan] Add wholearchive flag when including asan_cxx lib.Marcos Pividori2017-02-091-6/+7
| | | | | | | | | | | | | | We need -wholearchive for asan_cxx, the same than for asan. Clang Driver will add asan_cxx at the beginning of the arg list that we pass to the linker. To ensure that all the static libraries are linked to asan_cxx, we force the linker to include the object files in asan_cxx. This fixes some linker errors when compiling with address sanitizer for MT and passing the static library libFuzzer. Differential Revision: https://reviews.llvm.org/D29754 llvm-svn: 294604
* Driver: Do not link safestack with --whole-archive.Peter Collingbourne2017-02-071-3/+5
| | | | | | | | This allows it to be used with the other sanitizers. Differential Revision: https://reviews.llvm.org/D29545 llvm-svn: 294274
* Driver: Do not warn about unused -pthread when linking on darwinMatthias Braun2017-02-031-0/+4
| | | | | | | | While there is nothing to do at link time to get pthreads support on darwin, specifying the argument is fine and we should not warn about unused arguments. llvm-svn: 294065
* Revert "[Driver] Updated for Visual Studio 2017"Reid Kleckner2017-02-021-18/+45
| | | | | | | This reverts commit r293923. It causes test failures on Linux that need time to debug. llvm-svn: 293924
* [Driver] Updated for Visual Studio 2017Reid Kleckner2017-02-021-45/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch updates the MSVC ToolChain for the changes made in Visual Studio 2017[1]. Other notable changes: - Path handling code has been centralised to make potential future changes less painful. - A compiler error is emitted if the driver is unable to locate a usable MSVC toolchain. (Previously it'd fail with a cryptic error such as "link.exe is not executable") - Support for the new Setup Config Server API[2] has been added, albeit block commented out with a preprocessor conditional. This can probably be re-evaluated when the API is officially released (it's currently at the RC stage), but it's left in to make it easy for anyone familiar with the API to give it a go with Clang. Patch by Hamza Sood. [1] https://blogs.msdn.microsoft.com/vcblog/2016/10/07/compiler-tools-layout-in-visual-studio-15/ [2] https://blogs.msdn.microsoft.com/heaths/2016/09/15/changes-to-visual-studio-15-setup/ Reviewers: ruiu, hans, rnk Reviewed By: rnk Subscribers: awson, RKSimon, amccarth, cfe-commits Differential Revision: https://reviews.llvm.org/D28365 llvm-svn: 293923
* [windows] [asan] Add wholearchive flag when including static lib asan.Marcos Pividori2017-01-311-0/+5
| | | | | | | | | | | | | | | | | In Windows, when the sanitizer is implemented as a static library, we use auxiliary static library dll_thunk that will be linked to the dlls that have instrumentation, so they can refer to the runtime in the main executable. It uses interception to get a pointer the function in the main executable and override its function with that pointer. Because of that, we need to ensure that the main executable exports all the sanitizers' interface, otherwise the initialization in dll_thunk will fail. In this commit we add the flag -wholearchive to clang driver to ensure that the linker does not omit any object files from asan library. Differential Revision: https://reviews.llvm.org/D29334 llvm-svn: 293668
* [X86] Teach Clang about -mfentry flagNirav Dave2017-01-311-0/+3
| | | | | | | | | | | | Replace mcount calls with calls to fentry. Reviewers: hfinkel, craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28001 llvm-svn: 293649
* [windows] [asan] Add linker flag when including "asan_dynamic_runtime_thunk".Marcos Pividori2017-01-291-0/+4
| | | | | | | | | | | | | I modify clang driver for windows to include: "-wholearchive:asan_dynamic_runtime_thunk", so all object files in the static library: asan_dynamic_runtime_thunk are considered by the linker. This is necessary, because some object files only include linker pragmas, and doesn't resolve any symbol. If we don't include that flag, the linker will ignore them, and won't read the linker pragmas. Differential Revision: https://reviews.llvm.org/D29159 llvm-svn: 293420
* Fix typo introduced in r292960 that may affect -flto -save-temps (saving the ↵Mehdi Amini2017-01-281-1/+1
| | | | | | optimized bitcode) llvm-svn: 293370
* ARM-Darwin: re-enable -momit-leaf-frame-pointer.Tim Northover2017-01-271-4/+3
| | | | | | | | | | | | In r279546 I disabled all frame pointer elimination at the front-end on ARM-Darwin (and warned about it) because before that the backend had been silently ignoring these options. It turns out we didn't ignore -momit-leaf-frame-pointer though, just the more general -fomit-frame-pointer. So this re-enables passing that down to CodeGen so that everything really does continue working as before (with better diagnostics). llvm-svn: 293311
* [mips] Add support for static model on N64Simon Dardis2017-01-271-3/+57
| | | | | | | | | | | | | | | | | | | | | | | The patch teaches the Clang driver how to handle the N64 static relocation model properly. It enforces the correct target feature (+noabicalls) when -fno-pic is used. This is required as non-pic N64 code as the abi extension to call PIC code (CPIC) is unsupported. Make PIC the default for mips64 and mips64el, this affects both N32 & N64 ABIs, to better match GCC. As part of this effort, clean up the assembler invocation command builder, so the correct flags are used. This and r293279 in LLVM resolves PR/23485. Thanks to Brooks Davis for reporting the issue! Reviewers: slthakur, seanbruno Differential Revision: https://reviews.llvm.org/D29031 llvm-svn: 293285
* Driver: ignore -fno-objc-arc-exception when -fno-objc-arc setSaleem Abdulrasool2017-01-251-0/+6
| | | | | | | | | | | Sometime clang would be supplied -fobjc-arc -f(no)objc-arc-exceptions and then later disable ARC with -fno-objc-arc, which only negate first option, but not the latter, resulting usused argument warning. Silence this warning only when -fno-objc-arc option is present. Patch by Onha Choe! llvm-svn: 293014
* Forward -bitcode_process_mode to ld64 in marker-only modeMehdi Amini2017-01-241-2/+6
| | | | | | | | | | Reviewers: steven_wu Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29066 llvm-svn: 292961
* Split isUsingLTO() outside of embedBitcodeInObject() and ↵Mehdi Amini2017-01-241-3/+4
| | | | | | | | | | | | | | embedBitcodeMarkerOnly(). Summary: These accessors maps directly to the command line option. Reviewers: steven_wu Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29065 llvm-svn: 292960
* Add -fdebug-info-for-profiling to emit more debug info for sample pgo ↵Dehao Chen2017-01-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | profile collection Summary: SamplePGO uses profile with debug info to collect profile. Unlike the traditional debugging purpose, sample pgo needs more accurate debug info to represent the profile. We add -femit-accurate-debug-info for this purpose. It can be combined with all debugging modes (-g, -gmlt, etc). It makes sure that the following pieces of info is always emitted: * start line of all subprograms * linkage name of all subprograms * standalone subprograms (functions that has neither inlined nor been inlined) The impact on speccpu2006 binary size (size increase comparing with -g0 binary, also includes data for -g binary, which does not change with this patch): -gmlt(orig) -gmlt(patched) -g 433.milc 4.68% 5.40% 19.73% 444.namd 8.45% 8.93% 45.99% 447.dealII 97.43% 115.21% 374.89% 450.soplex 27.75% 31.88% 126.04% 453.povray 21.81% 26.16% 92.03% 470.lbm 0.60% 0.67% 1.96% 482.sphinx3 5.77% 6.47% 26.17% 400.perlbench 17.81% 19.43% 73.08% 401.bzip2 3.73% 3.92% 12.18% 403.gcc 31.75% 34.48% 122.75% 429.mcf 0.78% 0.88% 3.89% 445.gobmk 6.08% 7.92% 42.27% 456.hmmer 10.36% 11.25% 35.23% 458.sjeng 5.08% 5.42% 14.36% 462.libquantum 1.71% 1.96% 6.36% 464.h264ref 15.61% 16.56% 43.92% 471.omnetpp 11.93% 15.84% 60.09% 473.astar 3.11% 3.69% 14.18% 483.xalancbmk 56.29% 81.63% 353.22% geomean 15.60% 18.30% 57.81% Debug info size change for -gmlt binary with this patch: 433.milc 13.46% 444.namd 5.35% 447.dealII 18.21% 450.soplex 14.68% 453.povray 19.65% 470.lbm 6.03% 482.sphinx3 11.21% 400.perlbench 8.91% 401.bzip2 4.41% 403.gcc 8.56% 429.mcf 8.24% 445.gobmk 29.47% 456.hmmer 8.19% 458.sjeng 6.05% 462.libquantum 11.23% 464.h264ref 5.93% 471.omnetpp 31.89% 473.astar 16.20% 483.xalancbmk 44.62% geomean 16.83% Reviewers: davidxl, andreadb, rob.lougher, dblaikie, echristo Reviewed By: dblaikie, echristo Subscribers: hfinkel, rob.lougher, andreadb, gbedwell, cfe-commits, probinson, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25435 llvm-svn: 292458
* Move vtable type metadata emission behind a cc1-level flag.Peter Collingbourne2017-01-181-1/+9
| | | | | | | | | | | | | In ThinLTO mode, type metadata will require the module to be written as a multi-module bitcode file, which is currently incompatible with the Darwin linker. It is also useful to be able to enable or disable multi-module bitcode for testing purposes. This introduces a cc1-level flag, -f{,no-}lto-unit, which is used by the driver to enable multi-module bitcode on all but Darwin+ThinLTO, and can also be used to enable/disable the feature manually. Differential Revision: https://reviews.llvm.org/D28877 llvm-svn: 292448
* Revert "[xray] try to fix thumb buildbot"Renato Golin2017-01-181-1/+0
| | | | | | This reverts commit r292268, as it didn't fix the buildbots. llvm-svn: 292355
* [xray] try to fix thumb buildbotRenato Golin2017-01-171-0/+1
| | | | llvm-svn: 292268
* Fix AArch64 global-merge backend option name.Frederic Riss2017-01-171-2/+2
| | | | | | | | -mglobal-merge is translated to the appropriate backend option in the driver. r277322 changed the AArch64 option name in the backend, but the driver was never updated. llvm-svn: 292192
* Address review comments on r290392:Chandler Carruth2017-01-121-4/+6
| | | | | | | | | | | | | - Don't break using '-mllvm -disable-llvm-optzns' (yet). - Don't add support for '-mllvm -disable-llvm-passes'. This is important for LLVM 4 as we haven't yet really told folks this is coming. I'll add release notes about this. I've also added some explicit testing of this so its more obvious what is happening here. llvm-svn: 291850
* Extend NetBSD/AArch64 to cover Big Endian as well.Joerg Sonnenberger2017-01-091-0/+1
| | | | llvm-svn: 291436
* [Driver] Driver changes to support CUDA compilation on Windows.Justin Lebar2017-01-051-7/+17
| | | | | | | | | | | | | | | | | | | | | Summary: For the most part this is straightforward: Just add a CudaInstallation object to the MSVC and MinGW toolchains. CudaToolChain has to override computeMSVCVersion so that Clang::constructJob passes the right version flag to cc1. We have to modify IsWindowsMSVC and friends in Clang::constructJob to be true when compiling CUDA device code on Windows for the same reason. Depends on: D28319 Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28320 llvm-svn: 291131
* Add AVR target and toolchain to ClangDylan McKay2017-01-051-0/+16
| | | | | | | | | | | | | | | | | Summary: Authored by Senthil Kumar Selvaraj This patch adds barebones support in Clang for the (experimental) AVR target. It uses the integrated assembler for assembly, and the GNU linker for linking, as lld doesn't know about the target yet. The DataLayout string is the same as the one in AVRTargetMachine.cpp. The alignment specs look wrong to me, as it's an 8 bit target and all types only need 8 bit alignment. Clang failed with a datalayout mismatch error when I tried to change it, so I left it that way for now. Reviewers: rsmith, dylanmckay, cfe-commits, rengolin Subscribers: rengolin, jroelofs, wdng Differential Revision: https://reviews.llvm.org/D27123 llvm-svn: 291082
* Accept and ignore -Wa,-mbig-obj on COFF targets for gas compatibilityReid Kleckner2017-01-041-0/+4
| | | | | | | | | LLVM's integrated assembler will automatically switch to big objects when there are more than 2**16 sections. Patch by Kyra! llvm-svn: 290979
* Add -f[no-]strict-return flag that can be used to avoid undefined behaviourAlex Lorenz2017-01-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | in non-void functions that fall off at the end without returning a value when compiling C++. Clang uses the new compiler flag to determine when it should treat control flow paths that fall off the end of a non-void function as unreachable. If -fno-strict-return is on, the code generator emits the ureachable and trap IR only when the function returns either a record type with a non-trivial destructor or another non-trivially copyable type. The primary goal of this flag is to avoid treating falling off the end of a non-void function as undefined behaviour. The burden of undefined behaviour is placed on the caller instead: if the caller ignores the returned value then the undefined behaviour is avoided. This kind of behaviour is useful in several cases, e.g. when compiling C code in C++ mode. rdar://13102603 Differential Revision: https://reviews.llvm.org/D27163 llvm-svn: 290960
* Add -plugin-opt=sample-profile for thinLTO build.Dehao Chen2017-01-041-0/+9
| | | | | | | | | | | | Summary: ThinLTO needs to pass down the sample profile file path to linker. Reviewers: tejohnson, davidxl, mehdi_amini Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D27832 llvm-svn: 290919
* [c++17] Implement P0522R0 as written. This allows a template template argumentRichard Smith2016-12-311-0/+7
| | | | | | | | | | | | | | | | | | | to be specified for a template template parameter whenever the parameter is at least as specialized as the argument (when there's an obvious and correct mapping from uses of the parameter to uses of the argument). For example, a template with more parameters can be passed to a template template parameter with fewer, if those trailing parameters have default arguments. This is disabled by default, despite being a DR resolution, as it's fairly broken in its current state: there are no partial ordering rules to cope with template template parameters that have different parameter lists, meaning that code that attempts to decompose template-ids based on arity can hit unavoidable ambiguity issues. The diagnostics produced on a non-matching argument are also pretty bad right now, but I aim to improve them in a subsequent commit. llvm-svn: 290792
* Driver: warn on -fPIC/-fpic/-fPIE/-fpie on WindowsSaleem Abdulrasool2016-12-261-0/+11
| | | | | | | | | | | | Use of these flags would result in the use of ELF-style PIE/PIC code which is incorrect on Windows. Windows is inherently PIC by means of the DLL slide that occurs at load. This also mirrors the behaviour on GCC for MinGW. Currently, the Windows x86_64 forces the relocation model to PIC (Level 2). This is unchanged for now, though we should remove any assumptions on that and change it to a static relocation model. llvm-svn: 290533
* [PM] Introduce options to enable the (still experimental) new passChandler Carruth2016-12-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | manager, and a code path to use it. The option is actually a top-level option but does contain 'experimental' in the name. This is the compromise suggested by Richard in discussions. We expect this option will be around long enough and have enough users towards the end that it merits not being relegated to CC1, but it still needs to be clear that this option will go away at some point. The backend code is a fresh codepath dedicated to handling the flow with the new pass manager. This was also Richard's suggested code structuring to essentially leave a clean path for development rather than carrying complexity or idiosyncracies of how we do things just to share code with the parts of this in common with the legacy pass manager. And it turns out, not much is really in common even though we use the legacy pass manager for codegen at this point. I've switched a couple of tests to run with the new pass manager, and they appear to work. There are still plenty of bugs that need squashing (just with basic experiments I've found two already!) but they aren't in this code, and the whole point is to expose the necessary hooks to start experimenting with the pass manager in more realistic scenarios. That said, I want to *strongly caution* anyone itching to play with this: it is still *very shaky*. Several large components have not yet been shaken down. For example I have bugs in both the always inliner and inliner that I have already spotted and will be fixing independently. Still, this is a fun milestone. =D One thing not in this patch (but that might be very reasonable to add) is some level of support for raw textual pass pipelines such as what Sean had a patch for some time ago. I'm mostly interested in the more traditional flow of getting the IR out of Clang and then running it through opt, but I can see other use cases so someone may want to add it. And of course, *many* features are not yet supported! - O1 is currently more like O2 - None of the sanitizers are wired up - ObjC ARC optimizer isn't wired up - ... So plenty of stuff still lef to do! Differential Revision: https://reviews.llvm.org/D28077 llvm-svn: 290450
* Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.Chandler Carruth2016-12-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Much to my surprise, '-disable-llvm-optzns' which I thought was the magical flag I wanted to get at the raw LLVM IR coming out of Clang deosn't do that. It still runs some passes over the IR. I don't want that, I really want the *raw* IR coming out of Clang and I strongly suspect everyone else using it is in the same camp. There is actually a flag that does what I want that I didn't know about called '-disable-llvm-passes'. I suspect many others don't know about it either. It both does what I want and is much simpler. This removes the confusing version and makes that spelling of the flag an alias for '-disable-llvm-passes'. I've also moved everything in Clang to use the 'passes' spelling as it seems both more accurate (*all* LLVM passes are disabled, not just optimizations) and much easier to remember and spell correctly. This is part of simplifying how Clang drives LLVM to make it cleaner to wire up to the new pass manager. Differential Revision: https://reviews.llvm.org/D28047 llvm-svn: 290392
* Driver: use the triple to query the arch, not the toolchainSaleem Abdulrasool2016-12-221-4/+3
| | | | | | | Although the result is the same, the intent is much more clear this way: we care about the architecture we are targeting. NFC. llvm-svn: 290305
* Driver: remove unnecessary parameterSaleem Abdulrasool2016-12-221-18/+16
| | | | | | | We can query the Triple and EffectiveTriple from the ToolChain. Avoid passing in the argument and query it in the function. NFC. llvm-svn: 290304
* Driver: rename parameter to reduce confusionSaleem Abdulrasool2016-12-221-7/+6
| | | | | | | | The parameter to ParsePICOpts passed the effective triple and then used that in a few places and used the actual triple in others. This was slightly confusing. Rename the parameter to make it more obvious. llvm-svn: 290303
* [analyzer] Add checker modeling gtest APIs.Devin Coughlin2016-12-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gtest is a widely-used unit-testing API. It provides macros for unit test assertions: ASSERT_TRUE(p != nullptr); that expand into an if statement that constructs an object representing the result of the assertion and returns when the assertion is false: if (AssertionResult gtest_ar_ = AssertionResult(p == nullptr)) ; else return ...; Unfortunately, the analyzer does not model the effect of the constructor precisely because (1) the copy constructor implementation is missing from the the header (so it can't be inlined) and (2) the boolean-argument constructor is constructed into a temporary (so the analyzer decides not to inline it since it doesn't reliably call temporary destructors right now). This results in false positives because the analyzer does not realize that the the assertion must hold along the non-return path. This commit addresses the false positives by explicitly modeling the effects of the two un-inlined constructors on the AssertionResult state. I've added a new package, "apiModeling", for these kinds of checkers that model APIs but don't emit any diagnostics. I envision all the checkers in this package always being on by default. This addresses the false positives reported in PR30936. Differential Revision: https://reviews.llvm.org/D27773 rdar://problem/22705813 llvm-svn: 290143
* [ARM] Add missing -backend-option for -arm-execute-onlyPrakhar Bahuguna2016-12-191-0/+1
| | | | llvm-svn: 290110
* [CUDA] Add --ptxas-path= flag.Justin Lebar2016-12-151-1/+5
| | | | | | | | | | | | | | | | | Summary: This lets you build with one CUDA installation but use ptxas from another install. This is useful e.g. if you want to avoid bugs in an old ptxas without actually upgrading wholesale to a newer CUDA version. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27788 llvm-svn: 289847
* [Driver] Bump default x86 cpu to Penryn when targeting macosx10.12+.Ahmed Bougacha2016-12-151-0/+5
| | | | | | 10.12 dropped support for all pre-Penryn Macs. llvm-svn: 289839
OpenPOWER on IntegriCloud