summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Switch PPCallbacks to take the new MacroDefinition instead of ↵Richard Smith2015-05-047-37/+27
| | | | | | MacroDirective*, in order to preserve full information on module macro expansion. llvm-svn: 236404
* Rename MacroDefinition -> MacroDefinitionRecord, ↵Richard Smith2015-05-047-36/+38
| | | | | | | | | | Preprocessor::MacroDefinition -> MacroDefinition. clang::MacroDefinition now models the currently-defined value of a macro. The previous MacroDefinition type, which represented a record of a macro definition directive for a detailed preprocessing record, is now called MacroDefinitionRecord. llvm-svn: 236400
* clang-format function definition header. NFC.Yaron Keren2015-05-021-2/+1
| | | | llvm-svn: 236390
* Replace GetNumBytesInBuffer() in MicrosoftCXXNameMangler::mangleArgumentType ↵Yaron Keren2015-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | by tell(). Using GetNumBytesInBuffer() assumes that the stream was not flushed between the GetNumBytesInBuffer() calls, which may happen to be true or not, depending on stream policy. tell() always reports the correct stream location. Do note there are only two more uses of GetNumBytesInBuffer() in LLVM+clang, in lib/MC/MCAsmStreamer.cpp and lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp. The former may be replacable by tell (needs testing) but while the later can not be immediatly replaced by tell() as it uses the absolute value of GetNumBytesInBuffer() rather than the real stream position. Both uses seems to depend upon flush policy and thus may not work correctly depending upon the stream behaviour. Going forward, GetNumBytesInBuffer() should probably be protected, non-accessible to raw_ostream clients. llvm-svn: 236389
* clang-format: [JS] Fix calculation of template string width.Daniel Jasper2015-05-021-4/+14
| | | | | | | | | | OriginalColumn might not be set, so fall back to Location and SourceMgr in case it is missing. Also initialize end column in case the token is multi line, but it's the ` token itself that starts the multi line. Patch by Martin Probst, thank you! llvm-svn: 236383
* clang-format: [JS] Fix templated parameter default values.Daniel Jasper2015-05-021-1/+1
| | | | | | | | | | Parameters can have templated types and default values (= ...), which is another location in which a template closer should be followed by whitespace. Patch by Martin Probst, thank you. llvm-svn: 236382
* InstrProf: Cede ownership of createProfileWeights to CGFJustin Bogner2015-05-026-26/+28
| | | | | | | | The fact that PGO has a say in how these branch weights are determined isn't interesting to most of CodeGen, so it makes more sense for this API to be accessible via CodeGenFunction rather than CodeGenPGO. llvm-svn: 236380
* [modules] Remove dead code from Module for tracking macro import locations.Richard Smith2015-05-024-14/+7
| | | | llvm-svn: 236376
* [modules] Don't bother creating a ModuleMacro representing a #undef that ↵Richard Smith2015-05-021-2/+5
| | | | | | overrides nothing. llvm-svn: 236374
* Fix -fobjc-arc doesn't work with -save-tempsSteven Wu2015-05-021-2/+1
| | | | | | | | | | The underlying problem is that there is currently no way to run ObjCARCContract from llvm bitcode which is required by ObjC ARC. This fix the problem by always enable ObjCARCContract pass if optimization is enabled. The ObjCARC Contract pass has almost no overhead on code that is not using ARC. llvm-svn: 236372
* Diagnose delayed typos when parsing a postfix expression with anKaelyn Takata2015-05-021-1/+13
| | | | | | | | unmatched l_paren before setting the LHS to ExprError(). Fixes PR23285. llvm-svn: 236371
* InstrProf: Use a locally tracked current count in ComputeRegionCountsJustin Bogner2015-05-022-38/+35
| | | | | | | | No functional change. This just makes it more obvious that the logic in ComputeRegionCounts only depends on the counter map and local state. llvm-svn: 236370
* [modules] If a module #includes a modular header that #undef's its macro, itRichard Smith2015-05-023-10/+6
| | | | | | | | should not export the macro. ... at least, not unless we have local submodule visibility enabled. llvm-svn: 236369
* InstrProf: Replace the RegionCounter class with a simpler direct approachJustin Bogner2015-05-012-203/+111
| | | | | | | | | This removes the RegionCounter class, which is only used as a helper in teh ComputeRegionCounts stmt visitor. This class is just an extra layer of abstraction that makes the code harder to follow at this point, and removing it makes the logic quite a bit more direct. llvm-svn: 236364
* Remove some code left around for debugging purposesDavid Majnemer2015-05-011-12/+0
| | | | llvm-svn: 236355
* [MS ABI] Detect and diagnose vftables which cannot be createdDavid Majnemer2015-05-011-10/+42
| | | | | | | | | | | | | | | | The MSVC ABI has a bug introduced by appending to the end of vftables which come from virtual bases: covariant thunks introduces via non-overlapping regions of the inheritance lattice both append to the same slot in the vftable. It is possible to generate correct vftables in cases where one node in the lattice completely dominates the other on the way to the base with the vfptr; in all other cases, we must raise a diagnostic in order to prevent the illusion that we succeeded in laying out the vftable. This fixes PR16759. llvm-svn: 236354
* [MS ABI] NV bases may indirectly contain covariant thunks from V BasesDavid Majnemer2015-05-011-39/+24
| | | | | | | | | | | | A class might contain multiple ways of getting to a vbase, some of which are virtual and other non-virtual. It may be the case that a non-virtual base contains an override of a method in a vbase. This means that we must carefully pick between a set of nvbases to determine which is the best. As a consequence, the findPathForVPtr algorithm is considerably simpler. llvm-svn: 236353
* [modules] Add -fmodules-local-submodule-visibility flag.Richard Smith2015-05-013-45/+71
| | | | | | | | | | | | | | | This flag specifies that the normal visibility rules should be used even for local submodules (submodules of the currently-being-built module). Thus names will only be visible if a header / module that declares them has actually been included / imported, and not merely because a submodule that happened to be built earlier declared those names. This also removes the need to modularize bottom-up: textually-included headers will be included into every submodule that includes them, since their include guards will not leak between modules. So far, this only governs visibility of macros, not of declarations, so is not ready for real use yet. llvm-svn: 236350
* ARM: merge Cyclone into other ARMv8 CPUs and add tests for features.Tim Northover2015-05-011-6/+2
| | | | | | | | Cyclone actually supports all the goodies you'd expect to come with an AArch64 CPU, so it doesn't need its own clause. Also we should probably be testing these clauses. llvm-svn: 236349
* Also correct typos in the middle of a ternary expression when the RHS is ↵Kaelyn Takata2015-05-011-0/+8
| | | | | | | | | | | | invalid. The LHS was already being corrected before being set to ExprError when the RHS is invalid, but when it was present the middle of a ternary expression would be dropped in the error paths. Fixes PR23350. llvm-svn: 236347
* Eagerly correct typos in ParenExprs that may be type casts for non-C++ code.Kaelyn Takata2015-05-011-0/+5
| | | | | | | This is needed to ensure the type casts are parsed properly. Fixes PR23101. llvm-svn: 236337
* InstrProf: Fix a coverage crash where a macro begins in an unreachable blockJustin Bogner2015-05-011-1/+4
| | | | llvm-svn: 236335
* R600: Report fp64 on all capable asicsJan Vesely2015-05-011-1/+9
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 236325
* Make helper functions static. NFC.Benjamin Kramer2015-05-013-9/+11
| | | | llvm-svn: 236315
* Fix a few line endings. NFC.Yunzhong Gao2015-05-014-68/+68
| | | | llvm-svn: 236301
* [modules] Start moving the module visibility information off the Module itself.Richard Smith2015-05-0110-71/+99
| | | | | | | It has no place there; it's not a property of the Module, and it makes restoring the visibility set when we leave a submodule more difficult. llvm-svn: 236300
* InstrProf: This call does nothing, remove itJustin Bogner2015-05-011-1/+0
| | | | llvm-svn: 236298
* InstrProf: Support for setting profile output from command lineJustin Bogner2015-04-304-4/+14
| | | | | | | | | | | | | | | | This change is the third of 3 patches to add support for specifying the profile output from the command line via -fprofile-instr-generate=<path>, where the specified output path/file will be overridden by the LLVM_PROFILE_FILE environment variable. This patch adds the necessary support to the clang frontend, and adds a new test. The compiler-rt and llvm parts are r236055 and r236288, respectively. Patch by Teresa Johnson. Thanks! llvm-svn: 236289
* Make macro dumping robust against a nonexistent macro.Richard Smith2015-04-301-1/+1
| | | | llvm-svn: 236285
* Fix -Wpessimizing-move by removing call to std::moveRichard Trieu2015-04-301-1/+1
| | | | llvm-svn: 236281
* [modules] Add a mechanism to dump information about a macro.Richard Smith2015-04-303-4/+74
| | | | | | Wire this up to "#pragma clang __debug macro <name>". llvm-svn: 236280
* InstrProf: Fix handling of profile counters in the body of range based forJustin Bogner2015-04-301-3/+2
| | | | | | | | | We were assigning the counter for the body of the loop to the loop variable initialization for some reason here, but our tests completely lacked coverage for range-for loops. This fixes that and makes the logic generally more similar to the logic for a regular for. llvm-svn: 236277
* Revert most of r236271, leaving only the datalayout change in ↵Reid Kleckner2015-04-304-179/+93
| | | | | | lib/Basic/Targets.cpp llvm-svn: 236274
* Use 4 byte preferred aggregate alignment in datalayout on x86 Win32Reid Kleckner2015-04-305-96/+183
| | | | llvm-svn: 236271
* InstrProf: Make sure coverage propagates out of foreach loops correctlyJustin Bogner2015-04-301-4/+8
| | | | llvm-svn: 236264
* Remove some leftover debugging code.David Majnemer2015-04-301-1/+0
| | | | llvm-svn: 236243
* Don't warn about use of deprecated API when the containing context is ↵Jordan Rose2015-04-301-1/+1
| | | | | | | | | | unavailable. This probably won't come up much, but it seems tidier. Related to rdar://problem/20713550 llvm-svn: 236242
* Batch up access-related diagnostics on enum constants until the whole enum ↵Jordan Rose2015-04-302-2/+17
| | | | | | | | | | is parsed. That way we can take any trailing availability attributes into account. rdar://problem/20713550 llvm-svn: 236241
* [MS ABI] Correctly make paths through covariant virtual basesDavid Majnemer2015-04-301-24/+94
| | | | | | | | | | | | There can be multiple virtual bases which are on the path to a vfptr when one vbase virtually inherits from another. We should prefer the most derived virtual base which covariantly overrides a method in the vfptr class; if we do not lengthen the path this way, we will end up with too few vftable entries. This fixes PR21073. llvm-svn: 236239
* AVX-512: Added AVX-512 intrinsics and testsElena Demikhovsky2015-04-304-0/+596
| | | | | | by Asaf Badouh (asaf.badouh@intel.com) llvm-svn: 236218
* clang-format: Don't merge short else blocks.Daniel Jasper2015-04-301-1/+6
| | | | | | | | | | | | | | | | | | | | | Before (with the appropriate flags settings): if (a) { f(); } else { g(); } Before (with other appropriate flags settings): if (a) { f(); } else { g(); } After: if (a) { f(); } else { g(); } llvm-svn: 236217
* [OPENMP] Codegen for 'private' clause in 'task' directive.Alexey Bataev2015-04-303-29/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For tasks codegen for private/firstprivate variables are different rather than for other directives. 1. Build an internal structure of privates for each private variable: struct .kmp_privates_t. { Ty1 var1; ... Tyn varn; }; 2. Add a new field to kmp_task_t type with list of privates. struct kmp_task_t { void * shareds; kmp_routine_entry_t routine; kmp_int32 part_id; kmp_routine_entry_t destructors; .kmp_privates_t. privates; }; 3. Create a function with destructors calls for all privates after end of task region. kmp_int32 .omp_task_destructor.(kmp_int32 gtid, kmp_task_t *tt) { ~Destructor(&tt->privates.var1); ... ~Destructor(&tt->privates.varn); return 0; } 4. Perform default initialization of all private fields (no initialization for POD data, default constructor calls for classes) + provide address of a destructor function after kmpc_omp_task_alloc() and before kmpc_omp_task() calls. kmp_task_t *new_task = __kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry); DefaultConstructor(new_task->privates.var1); new_task->shareds.var1_ref = &new_task->privates.var1; ... DefaultConstructor(new_task->privates.varn); new_task->shareds.varn_ref = &new_task->privates.varn; new_task->destructors = .omp_task_destructor.; kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task) Differential Revision: http://reviews.llvm.org/D9322 llvm-svn: 236207
* [OPENMP] Allow to use global variables as lcv in loop-based directives.Alexey Bataev2015-04-302-20/+72
| | | | | | | For proper codegen we need to capture variable in the OpenMP region. In loop-based directives loop control variables are private by default and they must be captured in this region. There was a problem with capturing of globals, used as lcv, as they was not marked as private by default. Differential Revision: http://reviews.llvm.org/D9336 llvm-svn: 236201
* [OPENMP] Fixed codegen for 'copyprivate' clause.Alexey Bataev2015-04-302-7/+8
| | | | | | Fixed initialization of 'single' region completion + changed type of the third argument of __kmpc_copyprivate() runtime function to size_t. llvm-svn: 236198
* Remove dead code: a MacroDirective can't be imported or ambiguous any more.Richard Smith2015-04-305-57/+4
| | | | llvm-svn: 236197
* Use a more reliable method to determine whetherSean Callanan2015-04-301-2/+1
| | | | | | | | | a FileID corresponds to a real file or to a memory buffer. The old method didn't work when Clang was built Release, which meant it wasn't a very good method at all. llvm-svn: 236188
* Add an assert to get information on buildbot failure.Richard Smith2015-04-291-0/+1
| | | | llvm-svn: 236181
* Propagate a terrible hack to the sparc target feature handling codeEric Christopher2015-04-291-3/+5
| | | | | | | | | by erasing the soft-float target feature if the rest of the front end added it because of defaults or the soft float option. Add some testing for some of the targets that implement this hack. llvm-svn: 236179
* Fix unused variable warning.Richard Smith2015-04-291-1/+1
| | | | llvm-svn: 236178
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-2923-407/+190
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
OpenPOWER on IntegriCloud