[clang] [clang] Predefined macros for float128 support (PR #67196)

2023-09-26 Thread Eric Christopher via cfe-commits

https://github.com/echristo commented:

In general this looks good. Since we don't have full compiler-rt support for 
this yet we may want to wait until that to merge. Alex is already looking at 
this and coordinating with his needs is probably the best solution.

https://github.com/llvm/llvm-project/pull/67196
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D51650: Implement target_clones multiversioning

2021-11-05 Thread Eric Christopher via cfe-commits
I think you are these days too :) My offer was "past-past-me". I think
you're probably ok here, I did a rough scan, but getting someone like Aaron
for the attribute support would be good.

On Fri, Nov 5, 2021 at 12:00 PM Erich Keane via Phabricator <
revi...@reviews.llvm.org> wrote:

> erichkeane added a comment.
>
> Sadly, I think _I_ am the multiversioning expert (or at least, past-me
> was), so I'm hoping some of the reviewers @danielkiss can get to join will
> be able to read/understand this stuff for a quality review.
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D51650/new/
>
> https://reviews.llvm.org/D51650
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D100776: [clang/Basic] Make TargetInfo.h not use DataLayout again

2021-04-27 Thread Eric Christopher via cfe-commits
Sounds good. It's a soft objection, mostly because if nothing else it puts
us back where we were subject to some latent bugs, but perhaps not as bad
as before (though I don't find having to use an assert build reassuring ;)

Anyhow, go ahead and we'll figure out something else.

On Tue, Apr 27, 2021, 7:23 PM Reid Kleckner via Phabricator <
revi...@reviews.llvm.org> wrote:

> rnk accepted this revision.
> rnk added a comment.
> This revision is now accepted and ready to land.
>
> In D100776#2703273 , @echristo
> wrote:
>
> > As is mentioned there are tradeoffs around this though: a) it does make
> it harder to have clang generate code without a backend or llvm itself
> around, b) it does have a dependency when none existed.
> >
> > So, if this is really causing some consternation then we can pull back
> and reinstate what we had, but it was a direction around solving a set of
> hard to find bugs.
> >
> > Thoughts?
>
> I'm reading this as a soft, non-blocking objection. The concern that the
> layouts and prefix might get out of sync is addressed: there are asserts
> that they agree when the backends are linked in.
>
> So, under that interpretation, and without further guidance from
> @echristo, I think we should go forward. If that's not the right
> interpretation, we can always revert.
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D100776/new/
>
> https://reviews.llvm.org/D100776
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D96203: [clang][patch] Modify sanitizer options names: renaming blacklist to blocklist

2021-04-27 Thread Eric Christopher via cfe-commits
On Tue, Apr 27, 2021 at 8:01 AM Melanie Blower via Phabricator <
revi...@reviews.llvm.org> wrote:

> mibintc abandoned this revision.
> mibintc added a comment.
>
> There was no resolution about what option name would be acceptable
>

Oh no, I'm sorry that you felt that way.  I saw Vitaly's comment about
exclusion and mine and we were waiting to see if that was ok with you.
You'd said something about allow/disallow, but it had stopped. I'm
happy either way though I do have a preference for exclude to disallow.

Thanks!

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D97736: [Driver] Add a experimental option to link to LLVM libc.

2021-03-13 Thread Eric Christopher via cfe-commits
On Fri, Mar 5, 2021 at 1:15 AM Siva Chandra via Phabricator <
revi...@reviews.llvm.org> wrote:

> sivachandra added a comment.
>
> In D97736#2605535 , @phosek
> wrote:
>
> > Have you considered using an input linker script? We could generate
> `libc.so` that could look something like:
> >
> >   INPUT(libllvmlibc.a /lib/libc.so)
> >
> > We would need to pass `--sysroot` to the linker for this to work. The
> driver could remain completely agnostic of whether you're using LLVM libc
> or not.
>
> Yes, that was also considered. Those downstream users who have the
> flexibility to do it that way should be able to do it that way. However,
> not all downstream users or normal clang users will have that liberty [1].
> Another point to note is that we will have to do this with all libc
> components like `libc.so`, `libm.so` etc.
>
> [1] I think all of this can be done. For example, we can set all this up
> when building a distribution. However, I am not sure this is worth it when
> we know this is a transient phase. Soon, when LLVM libc is complete enough,
> a more appropriate option would be the one which allows choosing a libc as
> Eric pointed out.
>

To be clear I'm not a fan of a "pick your libc" option as opposed to just
naming the compiled llvm libc as perhaps libc.[a,so,etc] similar to other
platforms. I think we'd need a good reason to diverge here.

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 549e55b - Temporarily Revert "[clangd] Add Random Forest runtime for code completion."

2020-09-18 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-09-18T14:47:43-07:00
New Revision: 549e55b3d5634870aa9d42135f51ad46a6a0e347

URL: 
https://github.com/llvm/llvm-project/commit/549e55b3d5634870aa9d42135f51ad46a6a0e347
DIFF: 
https://github.com/llvm/llvm-project/commit/549e55b3d5634870aa9d42135f51ad46a6a0e347.diff

LOG: Temporarily Revert "[clangd] Add Random Forest runtime for code 
completion."
as a header doesn't appear to have made it into the commit.

This reverts commit 9b6765e784b39c88cb8cdb85ab083e6c95a997ed and followup

Added: 


Modified: 
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

Removed: 
clang-tools-extra/clangd/quality/CompletionModel.cmake
clang-tools-extra/clangd/quality/CompletionModelCodegen.py
clang-tools-extra/clangd/quality/README.md
clang-tools-extra/clangd/quality/model/features.json
clang-tools-extra/clangd/quality/model/forest.json
clang-tools-extra/clangd/unittests/DecisionForestTests.cpp

clang-tools-extra/clangd/unittests/decision_forest_model/CategoricalFeature.h
clang-tools-extra/clangd/unittests/decision_forest_model/features.json
clang-tools-extra/clangd/unittests/decision_forest_model/forest.json



diff  --git a/clang-tools-extra/clangd/CMakeLists.txt 
b/clang-tools-extra/clangd/CMakeLists.txt
index 9d2ab5be222a..3a1a034ed17b 100644
--- a/clang-tools-extra/clangd/CMakeLists.txt
+++ b/clang-tools-extra/clangd/CMakeLists.txt
@@ -28,9 +28,6 @@ set(LLVM_LINK_COMPONENTS
   FrontendOpenMP
   Option
   )
-  
-include(${CMAKE_CURRENT_SOURCE_DIR}/quality/CompletionModel.cmake)
-gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/quality/model CompletionModel 
clang::clangd::Example)
 
 if(MSVC AND NOT CLANG_CL)
  set_source_files_properties(CompileCommands.cpp PROPERTIES COMPILE_FLAGS 
-wd4130) # disables C4130: logical operation on address of string constant
@@ -80,7 +77,6 @@ add_clang_library(clangDaemon
   TUScheduler.cpp
   URI.cpp
   XRefs.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/CompletionModel.cpp
 
   index/Background.cpp
   index/BackgroundIndexLoader.cpp
@@ -121,11 +117,6 @@ add_clang_library(clangDaemon
   omp_gen
   )
 
-# Include generated CompletionModel headers.
-target_include_directories(clangDaemon PUBLIC
-  $
-)
-
 clang_target_link_libraries(clangDaemon
   PRIVATE
   clangAST

diff  --git a/clang-tools-extra/clangd/quality/CompletionModel.cmake 
b/clang-tools-extra/clangd/quality/CompletionModel.cmake
deleted file mode 100644
index 60c6d2aa8433..
--- a/clang-tools-extra/clangd/quality/CompletionModel.cmake
+++ /dev/null
@@ -1,37 +0,0 @@
-# Run the Completion Model Codegenerator on the model present in the 
-# ${model} directory.
-# Produces a pair of files called ${filename}.h and  ${filename}.cpp in the 
-# ${CMAKE_CURRENT_BINARY_DIR}. The generated header
-# will define a C++ class called ${cpp_class} - which may be a
-# namespace-qualified class name.
-function(gen_decision_forest model filename cpp_class)
-  set(model_compiler 
${CMAKE_SOURCE_DIR}/../clang-tools-extra/clangd/quality/CompletionModelCodegen.py)
-  
-  set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
-  set(header_file ${output_dir}/${filename}.h)
-  set(cpp_file ${output_dir}/${filename}.cpp)
-
-  add_custom_command(OUTPUT ${header_file} ${cpp_file}
-COMMAND "${Python3_EXECUTABLE}" ${model_compiler}
-  --model ${model}
-  --output_dir ${output_dir}
-  --filename ${filename}
-  --cpp_class ${cpp_class}
-COMMENT "Generating code completion model runtime..."
-DEPENDS ${model_compiler} ${model}/forest.json ${model}/features.json
-VERBATIM )
-
-  set_source_files_properties(${header_file} PROPERTIES
-GENERATED 1)
-  set_source_files_properties(${cpp_file} PROPERTIES
-GENERATED 1)
-
-  # Disable unused label warning for generated files.
-  if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
-set_source_files_properties(${cpp_file} PROPERTIES
-  COMPILE_FLAGS /wd4102)
-  else()
-set_source_files_properties(${cpp_file} PROPERTIES
-  COMPILE_FLAGS -Wno-unused)
-  endif()
-endfunction()

diff  --git a/clang-tools-extra/clangd/quality/CompletionModelCodegen.py 
b/clang-tools-extra/clangd/quality/CompletionModelCodegen.py
deleted file mode 100644
index 20bfccd8806f..
--- a/clang-tools-extra/clangd/quality/CompletionModelCodegen.py
+++ /dev/null
@@ -1,290 +0,0 @@
-"""Code generator for Code Completion Model Inference.
-
-Tool runs on the Decision Forest model defined in {model} directory.
-It generates two files: {output_dir}/{filename}.h and 
{output_dir}/{filename}.cpp 
-The generated files defines the Example class named {cpp_class} having all the 
features as class members.
-The generated runtime provides an `Evaluate` function which can be used to 
score a code completion candidate.
-"""
-
-import argparse
-import json

[clang] 05777ab - Temporarily Revert "[DebugInfo] Move constructor homing case in shouldOmitDefinition."

2020-08-24 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-08-24T21:51:31-07:00
New Revision: 05777ab941063192b9ccb1775358a83a2700ccc1

URL: 
https://github.com/llvm/llvm-project/commit/05777ab941063192b9ccb1775358a83a2700ccc1
DIFF: 
https://github.com/llvm/llvm-project/commit/05777ab941063192b9ccb1775358a83a2700ccc1.diff

LOG: Temporarily Revert "[DebugInfo] Move constructor homing case in 
shouldOmitDefinition."
as it's causing test failures.

This reverts commit 589ce5f7050dd83fd3f7dbc182ea0fb051ece994.

Added: 


Modified: 
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp 
b/clang/lib/CodeGen/CGDebugInfo.cpp
index c2929d027a1b..e3442ecd4bd5 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2260,25 +2260,6 @@ static bool 
hasExplicitMemberDefinition(CXXRecordDecl::method_iterator I,
   return false;
 }
 
-static bool canUseCtorHoming(const CXXRecordDecl *RD) {
-  // Constructor homing can be used for classes that have at least one
-  // constructor and have no trivial or constexpr constructors.
-  // Skip this optimization if the class or any of its methods are marked
-  // dllimport.
-  if (RD->isLambda() || RD->hasConstexprNonCopyMoveConstructor() ||
-  isClassOrMethodDLLImport(RD))
-return false;
-
-  if (RD->ctors().empty())
-return false;
-
-  for (const auto *Ctor : RD->ctors())
-if (Ctor->isTrivial() && !Ctor->isCopyOrMoveConstructor())
-  return false;
-
-  return true;
-}
-
 static bool shouldOmitDefinition(codegenoptions::DebugInfoKind DebugKind,
  bool DebugTypeExtRefs, const RecordDecl *RD,
  const LangOptions ) {
@@ -2313,6 +2294,23 @@ static bool 
shouldOmitDefinition(codegenoptions::DebugInfoKind DebugKind,
   !isClassOrMethodDLLImport(CXXDecl))
 return true;
 
+  // In constructor debug mode, only emit debug info for a class when its
+  // constructor is emitted. Skip this optimization if the class or any of
+  // its methods are marked dllimport.
+  //
+  // This applies to classes that don't have any trivial constructors and have
+  // at least one constructor.
+  if (DebugKind == codegenoptions::DebugInfoConstructor &&
+  !CXXDecl->isLambda() && !CXXDecl->hasConstexprNonCopyMoveConstructor() &&
+  !isClassOrMethodDLLImport(CXXDecl)) {
+if (CXXDecl->ctors().empty())
+  return false;
+for (const auto *Ctor : CXXDecl->ctors())
+  if (Ctor->isTrivial() && !Ctor->isCopyOrMoveConstructor())
+return false;
+return true;
+  }
+
   TemplateSpecializationKind Spec = TSK_Undeclared;
   if (const auto *SD = dyn_cast(RD))
 Spec = SD->getSpecializationKind();
@@ -2322,12 +2320,6 @@ static bool 
shouldOmitDefinition(codegenoptions::DebugInfoKind DebugKind,
   CXXDecl->method_end()))
 return true;
 
-  // In constructor homing mode, only emit complete debug info for a class
-  // when its constructor is emitted.
-  if ((DebugKind != codegenoptions::DebugInfoConstructor) &&
-  canUseCtorHoming(CXXDecl))
-return true;
-
   return false;
 }
 

diff  --git 
a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp 
b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
index ff0457e94404..4e41c4092bf4 100644
--- a/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
+++ b/clang/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp
@@ -1,7 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple 
-debug-info-kind=limited %s -o - | FileCheck %
-
-// Make sure this still works with constructor homing.
-// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple 
-debug-info-kind=constructor %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple 
-debug-info-kind=limited %s -o - | FileCheck %s
 
 // Run again with -gline-tables-only or -gline-directives-only and verify we 
don't crash.  We won't output
 // type info at all.



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D85384: [X86] Add basic support for -mtune command line option in clang

2020-08-19 Thread Eric Christopher via cfe-commits
This would be because at that point the default cpu was that and it
probably had something to do with fallbacks.

At this point it can be changed I imagine to whatever makes sense.

On Wed, Aug 19, 2020, 1:12 AM Craig Topper via Phabricator <
revi...@reviews.llvm.org> wrote:

> craig.topper added a subscriber: ddunbar.
> craig.topper added a comment.
>
> In D85384#2225434 , @phosek
> wrote:
>
> > This seems to have broken our Mac builders with the following error:
> >
> >   -- Testing: 25226 tests, 24 workers --
> >   Testing:  0.. 10.. 20.
> >   FAIL: Clang :: Frontend/ast-main.c (6834 of 25226)
> >    TEST 'Clang :: Frontend/ast-main.c' FAILED
> 
> >   Script:
> >   --
> >   : 'RUN: at line 1';   env SDKROOT="/"
> /b/s/w/ir/k/staging/llvm_build/bin/clang -emit-llvm -S -o
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.c.tmp1.ll
> -x c - < /b/s/w/ir/k/llvm-project/clang/test/Frontend/ast-main.c
> >   : 'RUN: at line 2';   env SDKROOT="/"
> /b/s/w/ir/k/staging/llvm_build/bin/clang -emit-ast -o
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.c.tmp.ast
> /b/s/w/ir/k/llvm-project/clang/test/Frontend/ast-main.c
> >   : 'RUN: at line 3';   env SDKROOT="/"
> /b/s/w/ir/k/staging/llvm_build/bin/clang -emit-llvm -S -o
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.c.tmp2.ll
> -x ast - <
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.c.tmp.ast
> >   : 'RUN: at line 4';   diff
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.c.tmp1.ll
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.c.tmp2.ll
> >   --
> >   Exit Code: 1
> >
> >   Command Output (stdout):
> >   --
> >   14c14
> >   < attributes #0 = { noinline nounwind optnone ssp uwtable
> "correctly-rounded-divide-sqrt-fp-math"="false"
> "disable-tail-calls"="false" "frame-pointer"="all"
> "less-precise-fpmad"="false" "min-legal-vector-width"="0"
> "no-infs-fp-math"="false" "no-jump-tables"="false"
> "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false"
> "no-trapping-math"="true" "stack-protector-buffer-size"="8"
> "target-cpu"="penryn"
> "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87"
> "tune-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" }
> >   ---
> >   > attributes #0 = { noinline nounwind optnone ssp uwtable
> "correctly-rounded-divide-sqrt-fp-math"="false"
> "disable-tail-calls"="false" "frame-pointer"="all"
> "less-precise-fpmad"="false" "min-legal-vector-width"="0"
> "no-infs-fp-math"="false" "no-jump-tables"="false"
> "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false"
> "no-trapping-math"="true" "stack-protector-buffer-size"="8"
> "target-cpu"="penryn"
> "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87"
> "unsafe-fp-math"="false" "use-soft-float"="false" }
> >
> >   --
> >
> >   
> >   Testing:  0.. 10.. 20.
> >   FAIL: Clang :: Frontend/ast-main.cpp (6835 of 25226)
> >    TEST 'Clang :: Frontend/ast-main.cpp' FAILED
> 
> >   Script:
> >   --
> >   : 'RUN: at line 1';   env SDKROOT="/"
> /b/s/w/ir/k/staging/llvm_build/bin/clang -emit-llvm -S -o
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.cpp.tmp1.ll
> -x c++ - < /b/s/w/ir/k/llvm-project/clang/test/Frontend/ast-main.cpp
> >   : 'RUN: at line 2';   env SDKROOT="/"
> /b/s/w/ir/k/staging/llvm_build/bin/clang -fno-delayed-template-parsing
> -emit-ast -o
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.cpp.tmp.ast
> /b/s/w/ir/k/llvm-project/clang/test/Frontend/ast-main.cpp
> >   : 'RUN: at line 3';   env SDKROOT="/"
> /b/s/w/ir/k/staging/llvm_build/bin/clang -emit-llvm -S -o
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.cpp.tmp2.ll
> -x ast - <
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.cpp.tmp.ast
> >   : 'RUN: at line 4';   diff
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.cpp.tmp1.ll
> /b/s/w/ir/k/staging/llvm_build/tools/clang/test/Frontend/Output/ast-main.cpp.tmp2.ll
> >   --
> >   Exit Code: 1
> >
> >   Command Output (stdout):
> >   --
> >   37,39c37,39
> >   < attributes #0 = { noinline optnone ssp uwtable
> "correctly-rounded-divide-sqrt-fp-math"="false"
> "disable-tail-calls"="false" "frame-pointer"="all"
> "less-precise-fpmad"="false" "min-legal-vector-width"="0"
> "no-infs-fp-math"="false" "no-jump-tables"="false"
> "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false"
> "no-trapping-math"="true" "stack-protector-buffer-size"="8"
> "target-cpu"="penryn"
> "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87"
> "tune-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" }
> >   < attributes #1 = { noinline 

Re: [PATCH] D83273: [X86] Remove the feature dependency handling in X86TargetInfo::setFeatureEnabledImpl to a table based lookup in X86TargetParser.cpp

2020-08-04 Thread Eric Christopher via cfe-commits
Ow. Can revert and reapply after we fix the caching problem perhaps?

-eric

On Tue, Aug 4, 2020 at 3:48 PM Nick Desaulniers via Phabricator <
revi...@reviews.llvm.org> wrote:

> nickdesaulniers added a comment.
>
> I just collected a perf profile for an entire build.
> `getImpliedDisabledFeatures` is at the top with 9.15% of time spent in self.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D83273/new/
>
> https://reviews.llvm.org/D83273
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D85231: Protect against filenames with no extension at all.

2020-08-04 Thread Eric Christopher via cfe-commits
Could maybe add an assert along with the patch as well as an assert only
test?

On Tue, Aug 4, 2020, 1:42 PM Sterling Augustine via Phabricator <
revi...@reviews.llvm.org> wrote:

> saugustine added a comment.
>
> The darwin-dsymutil.c tests this code path right now on line 33. I found
> this error by running it under asan; otherwise it was fully latent.
>
> It seems pretty clear to me that when End == -1 (StringRef::npos),
> creating a string ref from that is obviously a bug.
>
> I'm not even sure how to check for a failure. clang will almost never
> crash; there is just a very subtle bounds violation or empty stringref. How
> it manifests itself depends on subsequent usage of the stringref, and stack
> layout.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D85231/new/
>
> https://reviews.llvm.org/D85231
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D80833: [CodeView] Add full repro to LF_BUILDINFO record

2020-07-10 Thread Eric Christopher via cfe-commits
Release+Asserts on x86_64-linux and the debug-info-codeview-buildinfo.c
test. Sorry if the latter wasn't clear :)

-eric

On Fri, Jul 10, 2020 at 4:12 PM Alexandre Ganea 
wrote:

> Thanks for letting me know Eric. What test fails exactly? What config?
>
>
>
> *De :* Eric Christopher 
> *Envoyé :* July 10, 2020 7:04 PM
> *À :* reviews+d80833+public+da87cf0eabdca...@reviews.llvm.org; Alexandre
> Ganea via Phabricator 
> *Cc :* Alexandre Ganea ; Hans Wennborg <
> h...@chromium.org>; Adrian McCarthy ; Martin Storsjo
> ; Amy Huang ; dma...@mozilla.com;
> john.rea...@vmssoftware.com; ztur...@roblox.com; ...@gmail.com;
> llvm-commits ;
> stefan.reinal...@molecular-matters.com; Ulrich Weigand <
> ulrich.weig...@de.ibm.com>; mlek...@skidmore.edu; Clang Commits <
> cfe-commits@lists.llvm.org>; Han Shen 
> *Objet :* Re: [PATCH] D80833: [CodeView] Add full repro to LF_BUILDINFO
> record
>
>
>
> I'm seeing tests fail with a crash. Can we revert the patch and attempted
> fixes and start working from there?
>
>
>
> Stacktrace for the curious :)
>
>
>
> @ 0x56420187cbbe  llvm::MCStreamer::emitIntValue()
> @ 0x5641fec38899  llvm::MCStreamer::emitInt16()
> @ 0x5641ff73b337  llvm::CodeViewDebug::emitCompilerInformation()
> @ 0x5641ff73ac73  llvm::CodeViewDebug::endModule()
> @ 0x5641ff718e83  llvm::AsmPrinter::doFinalization()
> @ 0x5642016fd9ca  llvm::FPPassManager::doFinalization()
> @ 0x5642016f954e  (anonymous
> namespace)::MPPassManager::runOnModule()
>
>
>
> -eric
>
>
>
> On Tue, Jun 30, 2020 at 11:56 AM Alexandre Ganea via Phabricator via
> cfe-commits  wrote:
>
> aganea added a comment.
>
> In D80833#2109172 , @uweigand
> wrote:
>
> > Hmm, with clang-cl it seems the driver is trying to use this:
> >  Target: s390x-pc-windows-msvc
> >  which of course doesn't exist.  Not sure what is supposed to be
> happening here, but it seems that it's falling back on s390x-linux since on
> s390x, Linux is currently the only supported OS.
>
>
> I'm seeing some of the tests are setting the target explicitly `%clang_cl
> --target=x86_64-windows-msvc`. Would that work on your machine? Or should I
> do `UNSUPPORTED: s390x` ?
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D80833/new/
>
> https://reviews.llvm.org/D80833
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D80833: [CodeView] Add full repro to LF_BUILDINFO record

2020-07-10 Thread Eric Christopher via cfe-commits
You'll probably want the assert as well:

assert.h assertion failed at llvm-project/llvm/lib/MC/MCStreamer.cpp:134 in
virtual void llvm::MCStreamer::emitIntValue(uint64_t, unsigned int):
(isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) && "Invalid size"

On Fri, Jul 10, 2020 at 4:03 PM Eric Christopher  wrote:

> I'm seeing tests fail with a crash. Can we revert the patch and attempted
> fixes and start working from there?
>
> Stacktrace for the curious :)
>
> @ 0x56420187cbbe  llvm::MCStreamer::emitIntValue()
> @ 0x5641fec38899  llvm::MCStreamer::emitInt16()
> @ 0x5641ff73b337  llvm::CodeViewDebug::emitCompilerInformation()
> @ 0x5641ff73ac73  llvm::CodeViewDebug::endModule()
> @ 0x5641ff718e83  llvm::AsmPrinter::doFinalization()
> @ 0x5642016fd9ca  llvm::FPPassManager::doFinalization()
> @ 0x5642016f954e  (anonymous
> namespace)::MPPassManager::runOnModule()
>
> -eric
>
> On Tue, Jun 30, 2020 at 11:56 AM Alexandre Ganea via Phabricator via
> cfe-commits  wrote:
>
>> aganea added a comment.
>>
>> In D80833#2109172 , @uweigand
>> wrote:
>>
>> > Hmm, with clang-cl it seems the driver is trying to use this:
>> >  Target: s390x-pc-windows-msvc
>> >  which of course doesn't exist.  Not sure what is supposed to be
>> happening here, but it seems that it's falling back on s390x-linux since on
>> s390x, Linux is currently the only supported OS.
>>
>>
>> I'm seeing some of the tests are setting the target explicitly `%clang_cl
>> --target=x86_64-windows-msvc`. Would that work on your machine? Or should I
>> do `UNSUPPORTED: s390x` ?
>>
>>
>> Repository:
>>   rG LLVM Github Monorepo
>>
>> CHANGES SINCE LAST ACTION
>>   https://reviews.llvm.org/D80833/new/
>>
>> https://reviews.llvm.org/D80833
>>
>>
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D80833: [CodeView] Add full repro to LF_BUILDINFO record

2020-07-10 Thread Eric Christopher via cfe-commits
I'm seeing tests fail with a crash. Can we revert the patch and attempted
fixes and start working from there?

Stacktrace for the curious :)

@ 0x56420187cbbe  llvm::MCStreamer::emitIntValue()
@ 0x5641fec38899  llvm::MCStreamer::emitInt16()
@ 0x5641ff73b337  llvm::CodeViewDebug::emitCompilerInformation()
@ 0x5641ff73ac73  llvm::CodeViewDebug::endModule()
@ 0x5641ff718e83  llvm::AsmPrinter::doFinalization()
@ 0x5642016fd9ca  llvm::FPPassManager::doFinalization()
@ 0x5642016f954e  (anonymous
namespace)::MPPassManager::runOnModule()

-eric

On Tue, Jun 30, 2020 at 11:56 AM Alexandre Ganea via Phabricator via
cfe-commits  wrote:

> aganea added a comment.
>
> In D80833#2109172 , @uweigand
> wrote:
>
> > Hmm, with clang-cl it seems the driver is trying to use this:
> >  Target: s390x-pc-windows-msvc
> >  which of course doesn't exist.  Not sure what is supposed to be
> happening here, but it seems that it's falling back on s390x-linux since on
> s390x, Linux is currently the only supported OS.
>
>
> I'm seeing some of the tests are setting the target explicitly `%clang_cl
> --target=x86_64-windows-msvc`. Would that work on your machine? Or should I
> do `UNSUPPORTED: s390x` ?
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D80833/new/
>
> https://reviews.llvm.org/D80833
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

2020-07-05 Thread Eric Christopher via cfe-commits
On Sun, Jul 5, 2020 at 8:47 PM Arthur Eubanks via Phabricator <
revi...@reviews.llvm.org> wrote:

> aeubanks added a comment.
>
> In D83013#2132070 , @echristo
> wrote:
>
> > Adding Chandler and Alina here as well.
> >
> > In general, I don't think that this is such a great idea. Being able to
> have this sort of thing work more reliably is one of the reasons for the
> new pass manager. I think I'd like to see this split out into an old versus
> new pass manager pass to avoid the difficulty of cleaning this up after we
> finish migrating llvm to the new pass manager. This also seems to add some
> technical debt around options and other enablement which is also less than
> ideal. Is this compelling to add right now versus finishing work migrating
> llvm completely to the new pass manager and removing the old one? From
> speaking with Alina I think that work should be done in a short while.
> >
> > Thanks.
> >
> > -eric
>
>
> I don't think we're that close yet, probably at least a couple months out,
> there are lots of loose ends to be tied up. I'll make a post soon in
> llvm-dev (maybe first we can sync up again) about what I think needs to be
> done before the NPM switch.
>
>
Honestly at this point that is a couple of months :) I think we may be able
to speed things up as well.

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 0861889 - [clang/llvm] As part of using inclusive language within

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T16:03:58-07:00
New Revision: 0861889be103bf7bcf013768e913695ed94b50bf

URL: 
https://github.com/llvm/llvm-project/commit/0861889be103bf7bcf013768e913695ed94b50bf
DIFF: 
https://github.com/llvm/llvm-project/commit/0861889be103bf7bcf013768e913695ed94b50bf.diff

LOG: [clang/llvm] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang/lib/AST/Decl.cpp
clang/lib/CodeGen/CGClass.cpp
clang/lib/Format/UnwrappedLineParser.cpp
llvm/unittests/Support/SpecialCaseListTest.cpp
llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h

Removed: 




diff  --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 23547933b88b..1676f319394d 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -4522,11 +4522,11 @@ bool RecordDecl::mayInsertExtraPadding(bool EmitRemark) 
const {
 ReasonToReject = 5;  // is standard layout.
   else if (Blacklist.isBlacklistedLocation(EnabledAsanMask, getLocation(),
"field-padding"))
-ReasonToReject = 6;  // is in a blacklisted file.
+ReasonToReject = 6;  // is in an excluded file.
   else if (Blacklist.isBlacklistedType(EnabledAsanMask,
getQualifiedNameAsString(),
"field-padding"))
-ReasonToReject = 7;  // is blacklisted.
+ReasonToReject = 7;  // The type is excluded.
 
   if (EmitRemark) {
 if (ReasonToReject >= 0)

diff  --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 1d78b3fccb13..4d143e3e1bdf 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -752,7 +752,7 @@ bool CodeGenFunction::IsConstructorDelegationValid(
 //parameters
 //  - etc.
 // If we ever add any of the above cases, remember that:
-//  - function-try-blocks will always blacklist this optimization
+//  - function-try-blocks will always exclude this optimization
 //  - we need to perform the constructor prologue and cleanup in
 //EmitConstructorBody.
 

diff  --git a/clang/lib/Format/UnwrappedLineParser.cpp 
b/clang/lib/Format/UnwrappedLineParser.cpp
index cf9673d51617..577b60bc51e2 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -900,7 +900,7 @@ void UnwrappedLineParser::parsePPUnknown() {
   addUnwrappedLine();
 }
 
-// Here we blacklist certain tokens that are not usually the first token in an
+// Here we exclude certain tokens that are not usually the first token in an
 // unwrapped line. This is used in attempt to distinguish macro calls without
 // trailing semicolons from other constructs split to several lines.
 static bool tokenCanStartNewLine(const FormatToken ) {

diff  --git a/llvm/unittests/Support/SpecialCaseListTest.cpp 
b/llvm/unittests/Support/SpecialCaseListTest.cpp
index 4be143d8f41f..bee639df6a66 100644
--- a/llvm/unittests/Support/SpecialCaseListTest.cpp
+++ b/llvm/unittests/Support/SpecialCaseListTest.cpp
@@ -172,7 +172,7 @@ TEST_F(SpecialCaseListTest, EmptySpecialCaseList) {
   EXPECT_FALSE(SCL->inSection("", "foo", "bar"));
 }
 
-TEST_F(SpecialCaseListTest, MultipleBlacklists) {
+TEST_F(SpecialCaseListTest, MultipleExclusions) {
   std::vector Files;
   Files.push_back(makeSpecialCaseListFile("src:bar\n"
   "src:*foo*\n"

diff  --git 
a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h 
b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
index 86e75a32ef4e..17410d37f9ce 100644
--- a/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
+++ b/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
@@ -345,7 +345,7 @@
 #if GTEST_LANG_CXX11 && \
 (!defined(__GLIBCXX__) || ( \
 __GLIBCXX__ >= 20110325ul &&  /* GCC >= 4.6.0 */ \
-/* Blacklist of patch releases of older branches: */ \
+/* Exclude patch releases of older branches: */ \
 __GLIBCXX__ != 20110416ul &&  /* GCC 4.4.6 */ \
 __GLIBCXX__ != 20120313ul &&  /* GCC 4.4.7 */ \
 __GLIBCXX__ != 20110428ul &&  /* GCC 4.5.3 */ \



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] da6332f - [clang-tidy] As part of using inclusive language within

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T15:20:11-07:00
New Revision: da6332f5f9f15f7b182f27bc9b8edbf709b48093

URL: 
https://github.com/llvm/llvm-project/commit/da6332f5f9f15f7b182f27bc9b8edbf709b48093
DIFF: 
https://github.com/llvm/llvm-project/commit/da6332f5f9f15f7b182f27bc9b8edbf709b48093.diff

LOG: [clang-tidy] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
clang-tools-extra/clang-tidy/google/NonConstReferences.h
clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp 
b/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
index b7da1c5940c5..e0fb614dfe8b 100644
--- a/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
+++ b/clang-tools-extra/clang-tidy/google/NonConstReferences.cpp
@@ -22,12 +22,12 @@ namespace runtime {
 NonConstReferences::NonConstReferences(StringRef Name,
ClangTidyContext *Context)
 : ClangTidyCheck(Name, Context),
-  WhiteListTypes(
-  utils::options::parseStringList(Options.get("WhiteListTypes", ""))) 
{}
+  IncludedTypes(
+  utils::options::parseStringList(Options.get("IncludedTypes", ""))) {}
 
 void NonConstReferences::storeOptions(ClangTidyOptions::OptionMap ) {
-  Options.store(Opts, "WhiteListTypes",
-utils::options::serializeStringList(WhiteListTypes));
+  Options.store(Opts, "IncludedTypes",
+utils::options::serializeStringList(IncludedTypes));
 }
 
 void NonConstReferences::registerMatchers(MatchFinder *Finder) {
@@ -67,12 +67,12 @@ void NonConstReferences::check(const 
MatchFinder::MatchResult ) {
 
   auto ReferencedType = *Result.Nodes.getNodeAs("referenced_type");
 
-  if (std::find_if(WhiteListTypes.begin(), WhiteListTypes.end(),
-   [&](llvm::StringRef WhiteListType) {
+  if (std::find_if(IncludedTypes.begin(), IncludedTypes.end(),
+   [&](llvm::StringRef ExplicitType) {
  return ReferencedType.getCanonicalType().getAsString(
 Result.Context->getPrintingPolicy()) ==
-WhiteListType;
-   }) != WhiteListTypes.end())
+ExplicitType;
+   }) != IncludedTypes.end())
 return;
 
   // Don't warn on function references, they shouldn't be constant.

diff  --git a/clang-tools-extra/clang-tidy/google/NonConstReferences.h 
b/clang-tools-extra/clang-tidy/google/NonConstReferences.h
index a8499a1982b1..ad7d4e4b1bca 100644
--- a/clang-tools-extra/clang-tidy/google/NonConstReferences.h
+++ b/clang-tools-extra/clang-tidy/google/NonConstReferences.h
@@ -30,7 +30,7 @@ class NonConstReferences : public ClangTidyCheck {
   void storeOptions(ClangTidyOptions::OptionMap ) override;
 
 private:
-  const std::vector WhiteListTypes;
+  const std::vector IncludedTypes;
 };
 
 } // namespace runtime

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst 
b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
index a210ccc1fb0b..52de1f108738 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-references.rst
@@ -12,6 +12,6 @@ 
https://google.github.io/styleguide/cppguide.html#Reference_Arguments
 Options
 ---
 
-.. option:: WhiteListTypes
+.. option:: IncludedTypes
 
-   A semicolon-separated list of names of whitelist types. Default is empty.
+   A semicolon-separated list of names of types to explicitly include. Default 
is empty.

diff  --git 
a/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp 
b/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp
index 1ebbbe3fc86c..e70ec3aeddf0 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/google-runtime-references.cpp
@@ -1,7 +1,7 @@
 // RUN: %check_clang_tidy %s google-runtime-references %t -- \
 // RUN:   -config="{CheckOptions: \
-// RUN: [{key: google-runtime-references.WhiteListTypes, \
-// RUN:   value: 'whitelist::A; whitelist::B'}]}"
+// RUN: [{key: google-runtime-references.IncludedTypes, \
+// RUN:   value: 'included::A; included::B'}]}"
 
 int a;
 int  = a;
@@ -141,14 +141,14 @@ A& operator|=(A& a, const A& b) { return a; }
 A& operator^=(A& a, const A& b) { return a; }
 A& operator&=(A& a, const A& b) { return a; }
 
-namespace whitelist {
+namespace included {
 class A {};
 class B {};
 void f7(A &);
 void f8(B 

[clang-tools-extra] ef455a5 - Update comment to be more clear.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T14:44:41-07:00
New Revision: ef455a55bcf2cfea04a99c361b182ad18b7f03f1

URL: 
https://github.com/llvm/llvm-project/commit/ef455a55bcf2cfea04a99c361b182ad18b7f03f1
DIFF: 
https://github.com/llvm/llvm-project/commit/ef455a55bcf2cfea04a99c361b182ad18b7f03f1.diff

LOG: Update comment to be more clear.

Added: 


Modified: 
clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp 
b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
index 0a3861e79a3d..67f281b3ed1f 100644
--- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
@@ -712,7 +712,7 @@ bool 
ForLoopIndexUseVisitor::TraverseArraySubscriptExpr(ArraySubscriptExpr *E) {
 /// If we encounter a reference to IndexVar in an unpruned branch of the
 /// traversal, mark this loop as unconvertible.
 ///
-/// This implements inclusions for convertible loops: any usages of IndexVar
+/// This determines the set of convertible loops: any usages of IndexVar
 /// not explicitly considered convertible by this traversal will be caught by
 /// this function.
 ///



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 10563e1 - [Analysis/Transforms/Sanitizers] As part of using inclusive language

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T00:42:26-07:00
New Revision: 10563e16aa2c432a883695ddd714da68751bbd77

URL: 
https://github.com/llvm/llvm-project/commit/10563e16aa2c432a883695ddd714da68751bbd77
DIFF: 
https://github.com/llvm/llvm-project/commit/10563e16aa2c432a883695ddd714da68751bbd77.diff

LOG: [Analysis/Transforms/Sanitizers] As part of using inclusive language
within the llvm project, migrate away from the use of blacklist and
whitelist.

Added: 


Modified: 
clang/lib/CodeGen/SanitizerMetadata.cpp
clang/lib/CodeGen/SanitizerMetadata.h
llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/Analysis/ObjCARCInstKind.cpp
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/lib/Transforms/Scalar/LoopRerollPass.cpp
llvm/lib/Transforms/Scalar/NaryReassociate.cpp
llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/SanitizerMetadata.cpp 
b/clang/lib/CodeGen/SanitizerMetadata.cpp
index 86269b5513f3..cdf83370c41f 100644
--- a/clang/lib/CodeGen/SanitizerMetadata.cpp
+++ b/clang/lib/CodeGen/SanitizerMetadata.cpp
@@ -31,16 +31,16 @@ static bool isAsanHwasanOrMemTag(const SanitizerSet& SS) {
 void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
SourceLocation Loc, StringRef Name,
QualType Ty, bool IsDynInit,
-   bool IsBlacklisted) {
+   bool IsExcluded) {
   if (!isAsanHwasanOrMemTag(CGM.getLangOpts().Sanitize))
 return;
   IsDynInit &= !CGM.isInSanitizerBlacklist(GV, Loc, Ty, "init");
-  IsBlacklisted |= CGM.isInSanitizerBlacklist(GV, Loc, Ty);
+  IsExcluded |= CGM.isInSanitizerBlacklist(GV, Loc, Ty);
 
   llvm::Metadata *LocDescr = nullptr;
   llvm::Metadata *GlobalName = nullptr;
   llvm::LLVMContext  = CGM.getLLVMContext();
-  if (!IsBlacklisted) {
+  if (!IsExcluded) {
 // Don't generate source location and global name if it is blacklisted -
 // it won't be instrumented anyway.
 LocDescr = getLocationMetadata(Loc);
@@ -53,7 +53,7 @@ void 
SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
   llvm::ConstantAsMetadata::get(
   llvm::ConstantInt::get(llvm::Type::getInt1Ty(VMContext), IsDynInit)),
   llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(
-  llvm::Type::getInt1Ty(VMContext), IsBlacklisted))};
+  llvm::Type::getInt1Ty(VMContext), IsExcluded))};
 
   llvm::MDNode *ThisGlobal = llvm::MDNode::get(VMContext, GlobalMetadata);
   llvm::NamedMDNode *AsanGlobals =
@@ -69,12 +69,12 @@ void 
SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
   llvm::raw_string_ostream OS(QualName);
   D.printQualifiedName(OS);
 
-  bool IsBlacklisted = false;
+  bool IsExcluded = false;
   for (auto Attr : D.specific_attrs())
 if (Attr->getMask() & SanitizerKind::Address)
-  IsBlacklisted = true;
+  IsExcluded = true;
   reportGlobalToASan(GV, D.getLocation(), OS.str(), D.getType(), IsDynInit,
- IsBlacklisted);
+ IsExcluded);
 }
 
 void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {

diff  --git a/clang/lib/CodeGen/SanitizerMetadata.h 
b/clang/lib/CodeGen/SanitizerMetadata.h
index 7ffac4360d9c..440a54590acc 100644
--- a/clang/lib/CodeGen/SanitizerMetadata.h
+++ b/clang/lib/CodeGen/SanitizerMetadata.h
@@ -40,7 +40,7 @@ class SanitizerMetadata {
   bool IsDynInit = false);
   void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
   StringRef Name, QualType Ty, bool IsDynInit = false,
-  bool IsBlacklisted = false);
+  bool IsExcluded = false);
   void disableSanitizerForGlobal(llvm::GlobalVariable *GV);
   void disableSanitizerForInstruction(llvm::Instruction *I);
 private:

diff  --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h 
b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
index 40007a9b8c53..fea6064042ae 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
@@ -39,7 +39,7 @@ class GlobalsMetadata {
 LocationMetadata SourceLoc;
 StringRef Name;
 bool IsDynInit = false;
-bool IsBlacklisted = false;
+bool IsExcluded = false;
 
 Entry() = default;
   };

diff  --git a/llvm/lib/Analysis/InlineCost.cpp 
b/llvm/lib/Analysis/InlineCost.cpp
index ba327ca6ce2d..66e8184e7ec2 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1113,7 +1113,8 @@ bool CallAnalyzer::visitCastInst(CastInst ) {
   }))
 return true;
 
-  // 

[clang-tools-extra] 16897e4 - Update test file.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:13:28-07:00
New Revision: 16897e47baa2b7cd1f63f40f8355c372b841f83d

URL: 
https://github.com/llvm/llvm-project/commit/16897e47baa2b7cd1f63f40f8355c372b841f83d
DIFF: 
https://github.com/llvm/llvm-project/commit/16897e47baa2b7cd1f63f40f8355c372b841f83d.diff

LOG: Update test file.

Added: 


Modified: 
clang-tools-extra/test/clang-change-namespace/allow-list.cpp

Removed: 




diff  --git a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp 
b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
index 07abd8b247d1..3f93cb7c9892 100644
--- a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
+++ b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
@@ -1,5 +1,5 @@
 // RUN: echo "^std::.*$" > %T/allowed-list.txt
-// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" 
--file_pattern ".*" --allowed_file %T/white-list.txt %s -- | sed 's,// 
CHECK.*,,' | FileCheck %s
+// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" 
--file_pattern ".*" --allowed_file %T/allow-list.txt %s -- | sed 's,// 
CHECK.*,,' | FileCheck %s
 
 #include "Inputs/fake-std.h"
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 25ed42f - [clang-change-namespace] As part of using inclusive language

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:01:42-07:00
New Revision: 25ed42f05d07d3ad85c58ee001752338211c911c

URL: 
https://github.com/llvm/llvm-project/commit/25ed42f05d07d3ad85c58ee001752338211c911c
DIFF: 
https://github.com/llvm/llvm-project/commit/25ed42f05d07d3ad85c58ee001752338211c911c.diff

LOG: [clang-change-namespace] As part of using inclusive language
within the llvm project, migrate away from the use of blacklist
and whitelist.

Added: 
clang-tools-extra/test/clang-change-namespace/allow-list.cpp

Modified: 
clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
clang-tools-extra/clang-change-namespace/ChangeNamespace.h
clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp

Removed: 
clang-tools-extra/test/clang-change-namespace/white-list.cpp



diff  --git a/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp 
b/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
index 5f4a889cab9e..e2a70db4102b 100644
--- a/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
+++ b/clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp
@@ -347,7 +347,7 @@ bool isTemplateParameter(TypeLoc Type) {
 
 ChangeNamespaceTool::ChangeNamespaceTool(
 llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef FilePattern,
-llvm::ArrayRef WhiteListedSymbolPatterns,
+llvm::ArrayRef AllowedSymbolPatterns,
 std::map *FileToReplacements,
 llvm::StringRef FallbackStyle)
 : FallbackStyle(FallbackStyle), FileToReplacements(*FileToReplacements),
@@ -365,8 +365,8 @@ ChangeNamespaceTool::ChangeNamespaceTool(
   DiffOldNamespace = joinNamespaces(OldNsSplitted);
   DiffNewNamespace = joinNamespaces(NewNsSplitted);
 
-  for (const auto  : WhiteListedSymbolPatterns)
-WhiteListedSymbolRegexes.emplace_back(Pattern);
+  for (const auto  : AllowedSymbolPatterns)
+AllowedSymbolRegexes.emplace_back(Pattern);
 }
 
 void ChangeNamespaceTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
@@ -800,7 +800,7 @@ void 
ChangeNamespaceTool::replaceQualifiedSymbolInDeclContext(
   Result.SourceManager->getSpellingLoc(End)),
   *Result.SourceManager, Result.Context->getLangOpts());
   std::string FromDeclName = FromDecl->getQualifiedNameAsString();
-  for (llvm::Regex  : WhiteListedSymbolRegexes)
+  for (llvm::Regex  : AllowedSymbolRegexes)
 if (RE.match(FromDeclName))
   return;
   std::string ReplaceName =

diff  --git a/clang-tools-extra/clang-change-namespace/ChangeNamespace.h 
b/clang-tools-extra/clang-change-namespace/ChangeNamespace.h
index 147675911941..d35119b70a69 100644
--- a/clang-tools-extra/clang-change-namespace/ChangeNamespace.h
+++ b/clang-tools-extra/clang-change-namespace/ChangeNamespace.h
@@ -49,7 +49,7 @@ class ChangeNamespaceTool : public 
ast_matchers::MatchFinder::MatchCallback {
   // files matching `FilePattern`.
   ChangeNamespaceTool(
   llvm::StringRef OldNs, llvm::StringRef NewNs, llvm::StringRef 
FilePattern,
-  llvm::ArrayRef WhiteListedSymbolPatterns,
+  llvm::ArrayRef AllowedSymbolPatterns,
   std::map *FileToReplacements,
   llvm::StringRef FallbackStyle = "LLVM");
 
@@ -166,7 +166,7 @@ class ChangeNamespaceTool : public 
ast_matchers::MatchFinder::MatchCallback {
   llvm::SmallPtrSet ProcessedFuncRefs;
   // Patterns of symbol names whose references are not expected to be updated
   // when changing namespaces around them.
-  std::vector WhiteListedSymbolRegexes;
+  std::vector AllowedSymbolRegexes;
 };
 
 } // namespace change_namespace

diff  --git 
a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp 
b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
index d54fe7347cf3..61754fe41bc1 100644
--- a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
+++ b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
@@ -72,20 +72,20 @@ cl::opt Style("style",
cl::desc("The style name used for reformatting."),
cl::init("LLVM"), cl::cat(ChangeNamespaceCategory));
 
-cl::opt WhiteListFile(
-"whitelist_file",
+cl::opt AllowedFile(
+"allowed_file",
 cl::desc("A file containing regexes of symbol names that are not expected "
  "to be updated when changing namespaces around them."),
 cl::init(""), cl::cat(ChangeNamespaceCategory));
 
-llvm::ErrorOr> GetWhiteListedSymbolPatterns() {
+llvm::ErrorOr> GetAllowedSymbolPatterns() {
   std::vector Patterns;
-  if (WhiteListFile.empty())
+  if (AllowedFile.empty())
 return Patterns;
 
   llvm::SmallVector Lines;
   llvm::ErrorOr> File =
-  llvm::MemoryBuffer::getFile(WhiteListFile);
+  llvm::MemoryBuffer::getFile(AllowedFile);
   if (!File)
 return File.getError();
   llvm::StringRef Content = 

Re: [PATCH] D82244: [SanitizeCoverage] Rename -fsanitize-coverage-{white, black}list to -fsanitize-coverage-{allow,block}list

2020-06-20 Thread Eric Christopher via cfe-commits
On Fri, Jun 19, 2020 at 10:43 PM Fangrui Song via Phabricator <
revi...@reviews.llvm.org> wrote:

> MaskRay added inline comments.
>
>
> 
> Comment at: clang/docs/ClangCommandLineReference.rst:891
>
>  Restrict sanitizer coverage instrumentation exclusively to modules and
> functions that match the provided special case list, except the blacklisted
> ones
>
> 
> echristo wrote:
> > MaskRay wrote:
> > > echristo wrote:
> > > > MaskRay wrote:
> > > > > echristo wrote:
> > > > > > I'd remove the uses of blacklist and whitelist here and below.
> Just have the language and the documentation be for the new option.
> > > > > `clang-tblgen -gen-opt-docs` does not seem to provide a feature to
> hide an option. HelpHidden does not hide the option.
> > > > Please remove blacklist and whitelist from the option description.
> > > I can do that but the next person updating the documentation will add
> them back.
> > >
> > > I believe `clang-tblgen -gen-opt-docs` just doesn't have the feature.
> Maybe we can delete the old options earlier so that we don't need to worry
> about the documentation.
> > Ugh. Yes, I hope so too. Can you raise it on cfe-dev?
> I can but I need to understand more about `clang-tblgen -gen-opt-docs`
> first...
>
>
I meant deleting the old options :)

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] d313cb6 - Update redirected output file.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:30:16-07:00
New Revision: d313cb6e956de9448e4b979763ee8d12ce4103cb

URL: 
https://github.com/llvm/llvm-project/commit/d313cb6e956de9448e4b979763ee8d12ce4103cb
DIFF: 
https://github.com/llvm/llvm-project/commit/d313cb6e956de9448e4b979763ee8d12ce4103cb.diff

LOG: Update redirected output file.

Added: 


Modified: 
clang-tools-extra/test/clang-change-namespace/allow-list.cpp

Removed: 




diff  --git a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp 
b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
index 3f93cb7c9892..7a941dcb2aa3 100644
--- a/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
+++ b/clang-tools-extra/test/clang-change-namespace/allow-list.cpp
@@ -1,4 +1,4 @@
-// RUN: echo "^std::.*$" > %T/allowed-list.txt
+// RUN: echo "^std::.*$" > %T/allow-list.txt
 // RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" 
--file_pattern ".*" --allowed_file %T/allow-list.txt %s -- | sed 's,// 
CHECK.*,,' | FileCheck %s
 
 #include "Inputs/fake-std.h"



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 1f593f4 - [AST/Lex/Parse/Sema] As part of using inclusive language within

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-20T01:15:32-07:00
New Revision: 1f593f46f35b3afb1ba6e4700285cf8fd1b81bc7

URL: 
https://github.com/llvm/llvm-project/commit/1f593f46f35b3afb1ba6e4700285cf8fd1b81bc7
DIFF: 
https://github.com/llvm/llvm-project/commit/1f593f46f35b3afb1ba6e4700285cf8fd1b81bc7.diff

LOG: [AST/Lex/Parse/Sema] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang/lib/AST/ExprConstant.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Lex/Lexer.cpp
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/ParsePragma.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaDeclObjC.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaStmt.cpp

Removed: 




diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 870bf7696093..640bdd0d45e5 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -9749,7 +9749,7 @@ static bool EvaluateArrayNewConstructExpr(EvalInfo , 
LValue ,
 
 // Return true iff the given array filler may depend on the element index.
 static bool MaybeElementDependentArrayFiller(const Expr *FillerExpr) {
-  // For now, just whitelist non-class value-initialization and initialization
+  // For now, just allow non-class value-initialization and initialization
   // lists comprised of them.
   if (isa(FillerExpr))
 return false;
@@ -10615,9 +10615,9 @@ static bool isUserWritingOffTheEnd(const ASTContext 
, const LValue ) {
   //   the array at the end was flexible, or if it had 0 or 1 elements. This
   //   broke some common standard library extensions (PR30346), but was
   //   otherwise seemingly fine. It may be useful to reintroduce this behavior
-  //   with some sort of whitelist. OTOH, it seems that GCC is always
+  //   with some sort of list. OTOH, it seems that GCC is always
   //   conservative with the last element in structs (if it's an array), so our
-  //   current behavior is more compatible than a whitelisting approach would
+  //   current behavior is more compatible than an explicit list approach would
   //   be.
   return LVal.InvalidBase &&
  Designator.Entries.size() == Designator.MostDerivedPathLength &&

diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index e57ad7b9eeaf..af04b75392f5 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -87,7 +87,7 @@ class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public 
OSTargetInfo {
 public:
   DarwinTargetInfo(const llvm::Triple , const TargetOptions )
   : OSTargetInfo(Triple, Opts) {
-// By default, no TLS, and we whitelist permitted architecture/OS
+// By default, no TLS, and we list permitted architecture/OS
 // combinations.
 this->TLSSupported = false;
 

diff  --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 016263108602..a559ca3eac2b 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -1862,7 +1862,7 @@ const char *Lexer::LexUDSuffix(Token , const char 
*CurPtr,
 char Next = getCharAndSizeNoWarn(CurPtr + Consumed, NextSize,
  getLangOpts());
 if (!isIdentifierBody(Next)) {
-  // End of suffix. Check whether this is on the whitelist.
+  // End of suffix. Check whether this is on the allowed list.
   const StringRef CompleteSuffix(Buffer, Chars);
   IsUDSuffix = StringLiteralParser::isValidUDSuffix(getLangOpts(),
 CompleteSuffix);

diff  --git a/clang/lib/Parse/ParseDeclCXX.cpp 
b/clang/lib/Parse/ParseDeclCXX.cpp
index 7a8a94203190..a236a82213fb 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -4387,7 +4387,7 @@ void Parser::ParseMicrosoftAttributes(ParsedAttributes 
,
 BalancedDelimiterTracker T(*this, tok::l_square);
 T.consumeOpen();
 
-// Skip most ms attributes except for a whitelist.
+// Skip most ms attributes except for a specific list.
 while (true) {
   SkipUntil(tok::r_square, tok::identifier, StopAtSemi | StopBeforeMatch);
   if (Tok.isNot(tok::identifier)) // ']', but also eof

diff  --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp
index 2631c3556273..eacb54e81ae6 100644
--- a/clang/lib/Parse/ParsePragma.cpp
+++ b/clang/lib/Parse/ParsePragma.cpp
@@ -2725,7 +2725,7 @@ void PragmaCommentHandler::HandlePragma(Preprocessor ,
 return;
   }
 
-  // Verify that this is one of the 5 whitelisted options.
+  // Verify that this is one of the 5 explicitly listed options.
   IdentifierInfo *II = Tok.getIdentifierInfo();
   PragmaMSCommentKind Kind =
 llvm::StringSwitch(II->getName())
@@ -2766,7 +2766,7 @@ void PragmaCommentHandler::HandlePragma(Preprocessor ,
   // 

[clang-tools-extra] a146991 - Update error to read a little better when an error occurs.

2020-06-20 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T23:34:30-07:00
New Revision: a1469914fd7542526693b07a26a0bdcaa27591a3

URL: 
https://github.com/llvm/llvm-project/commit/a1469914fd7542526693b07a26a0bdcaa27591a3
DIFF: 
https://github.com/llvm/llvm-project/commit/a1469914fd7542526693b07a26a0bdcaa27591a3.diff

LOG: Update error to read a little better when an error occurs.

Added: 


Modified: 
clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp

Removed: 




diff  --git 
a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp 
b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
index 61754fe41bc1..babc207cb0e0 100644
--- a/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
+++ b/clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
@@ -106,7 +106,7 @@ int main(int argc, const char **argv) {
   llvm::ErrorOr> AllowedPatterns =
   GetAllowedSymbolPatterns();
   if (!AllowedPatterns) {
-llvm::errs() << "Failed to open Allowed file " << AllowedFile << ". "
+llvm::errs() << "Failed to open allow file " << AllowedFile << ". "
  << AllowedPatterns.getError().message() << "\n";
 return 1;
   }



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] f8a463c - As part of using inclusive language within the llvm project,

2020-06-19 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T15:43:51-07:00
New Revision: f8a463c170964bff7e239bb8268a4927a4547d3c

URL: 
https://github.com/llvm/llvm-project/commit/f8a463c170964bff7e239bb8268a4927a4547d3c
DIFF: 
https://github.com/llvm/llvm-project/commit/f8a463c170964bff7e239bb8268a4927a4547d3c.diff

LOG: As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp 
b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
index 08f817a4eeab..0a3861e79a3d 100644
--- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
@@ -712,7 +712,7 @@ bool 
ForLoopIndexUseVisitor::TraverseArraySubscriptExpr(ArraySubscriptExpr *E) {
 /// If we encounter a reference to IndexVar in an unpruned branch of the
 /// traversal, mark this loop as unconvertible.
 ///
-/// This implements the whitelist for convertible loops: any usages of IndexVar
+/// This implements inclusions for convertible loops: any usages of IndexVar
 /// not explicitly considered convertible by this traversal will be caught by
 /// this function.
 ///



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 937c135 - As part of using inclusive language within the llvm project,

2020-06-19 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T15:41:06-07:00
New Revision: 937c135dd57e86ccd3fd64ca7b07915a75157986

URL: 
https://github.com/llvm/llvm-project/commit/937c135dd57e86ccd3fd64ca7b07915a75157986
DIFF: 
https://github.com/llvm/llvm-project/commit/937c135dd57e86ccd3fd64ca7b07915a75157986.diff

LOG: As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang-tools-extra/clangd/QueryDriverDatabase.cpp
clang-tools-extra/clangd/XRefs.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/QueryDriverDatabase.cpp 
b/clang-tools-extra/clangd/QueryDriverDatabase.cpp
index ba3aa0d66741..9d731f5563cf 100644
--- a/clang-tools-extra/clangd/QueryDriverDatabase.cpp
+++ b/clang-tools-extra/clangd/QueryDriverDatabase.cpp
@@ -27,7 +27,7 @@
 // First argument of the command line received from underlying compilation
 // database is used as compiler driver path. Due to this arbitrary binary
 // execution, this mechanism is not used by default and only executes binaries
-// in the paths that are explicitly whitelisted by the user.
+// in the paths that are explicitly included by the user.
 
 #include "GlobalCompilationDatabase.h"
 #include "support/Logger.h"
@@ -94,7 +94,7 @@ extractSystemIncludes(PathRef Driver, llvm::StringRef Lang,
   SPAN_ATTACH(Tracer, "lang", Lang);
 
   if (!QueryDriverRegex.match(Driver)) {
-vlog("System include extraction: not whitelisted driver {0}", Driver);
+vlog("System include extraction: not allowed driver {0}", Driver);
 return {};
   }
 

diff  --git a/clang-tools-extra/clangd/XRefs.cpp 
b/clang-tools-extra/clangd/XRefs.cpp
index 6aa031541846..a7bbfd4f967c 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -363,8 +363,8 @@ locateSymbolTextually(const SpelledWord , ParsedAST 
,
   if ((Word.ExpandedToken && !isDependentName(NodeKind)) ||
   !Word.LikelyIdentifier || !Index)
 return {};
-  // We don't want to handle words in string literals. It'd be nice to 
whitelist
-  // comments instead, but they're not retained in TokenBuffer.
+  // We don't want to handle words in string literals. It'd be nice to include
+  // comments, but they're not retained in TokenBuffer.
   if (Word.PartOfSpelledToken &&
   isStringLiteral(Word.PartOfSpelledToken->kind()))
 return {};
@@ -469,8 +469,8 @@ const syntax::Token *findNearbyIdentifier(const SpelledWord 
,
   // Unlikely identifiers are OK if they were used as identifiers nearby.
   if (Word.ExpandedToken)
 return nullptr;
-  // We don't want to handle words in string literals. It'd be nice to 
whitelist
-  // comments instead, but they're not retained in TokenBuffer.
+  // We don't want to handle words in string literals. It'd be nice to include
+  // comments, but they're not retained in TokenBuffer.
   if (Word.PartOfSpelledToken &&
   isStringLiteral(Word.PartOfSpelledToken->kind()))
 return {};



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] f92011d - As part of using inclusive language within the llvm project,

2020-06-19 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-06-19T15:12:18-07:00
New Revision: f92011d875cfdca1ed97bf0ab6956364c604b578

URL: 
https://github.com/llvm/llvm-project/commit/f92011d875cfdca1ed97bf0ab6956364c604b578
DIFF: 
https://github.com/llvm/llvm-project/commit/f92011d875cfdca1ed97bf0ab6956364c604b578.diff

LOG: As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

Added: 


Modified: 
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/Diagnostics.cpp
clang-tools-extra/clangd/Hover.cpp
clang-tools-extra/clangd/refactor/Rename.cpp
clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp
clang-tools-extra/clangd/unittests/RenameTests.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/CodeComplete.cpp 
b/clang-tools-extra/clangd/CodeComplete.cpp
index f69424c63be1..f79033ac9514 100644
--- a/clang-tools-extra/clangd/CodeComplete.cpp
+++ b/clang-tools-extra/clangd/CodeComplete.cpp
@@ -675,8 +675,8 @@ static bool isInjectedClass(const NamedDecl ) {
   return false;
 }
 
-// Some member calls are blacklisted because they're so rarely useful.
-static bool isBlacklistedMember(const NamedDecl ) {
+// Some member calls are excluded because they're so rarely useful.
+static bool isExcludedMember(const NamedDecl ) {
   // Destructor completion is rarely useful, and works inconsistently.
   // (s.^ completes ~string, but s.~st^ is an error).
   if (D.getKind() == Decl::CXXDestructor)
@@ -759,7 +759,7 @@ struct CompletionRecorder : public CodeCompleteConsumer {
 continue;
   if (Result.Declaration &&
   !Context.getBaseType().isNull() // is this a member-access context?
-  && isBlacklistedMember(*Result.Declaration))
+  && isExcludedMember(*Result.Declaration))
 continue;
   // Skip injected class name when no class scope is not explicitly set.
   // E.g. show injected A::A in `using A::A^` but not in "A^".

diff  --git a/clang-tools-extra/clangd/Diagnostics.cpp 
b/clang-tools-extra/clangd/Diagnostics.cpp
index da554ff8c331..674fa0dbf9ec 100644
--- a/clang-tools-extra/clangd/Diagnostics.cpp
+++ b/clang-tools-extra/clangd/Diagnostics.cpp
@@ -76,7 +76,7 @@ bool mentionsMainFile(const Diag ) {
   return false;
 }
 
-bool isBlacklisted(const Diag ) {
+bool isExcluded(const Diag ) {
   // clang will always fail parsing MS ASM, we don't link in desc + asm parser.
   if (D.ID == clang::diag::err_msasm_unable_to_create_target ||
   D.ID == clang::diag::err_msasm_unsupported_arch)
@@ -738,7 +738,7 @@ void StoreDiags::flushLastDiag() {
 LastDiag.reset();
   });
 
-  if (isBlacklisted(*LastDiag))
+  if (isExcluded(*LastDiag))
 return;
   // Move errors that occur from headers into main file.
   if (!LastDiag->InsideMainFile && LastDiagLoc && LastDiagOriginallyError) {

diff  --git a/clang-tools-extra/clangd/Hover.cpp 
b/clang-tools-extra/clangd/Hover.cpp
index 1cc564be5cf5..2861d63d4d00 100644
--- a/clang-tools-extra/clangd/Hover.cpp
+++ b/clang-tools-extra/clangd/Hover.cpp
@@ -580,7 +580,7 @@ HoverInfo getHoverContents(const DefinedMacro , 
ParsedAST ) {
 
 bool isLiteral(const Expr *E) {
   // Unfortunately there's no common base Literal classes inherits from
-  // (apart from Expr), therefore this is a nasty blacklist.
+  // (apart from Expr), therefore these exclusions.
   return llvm::isa(E) || llvm::isa(E) ||
  llvm::isa(E) ||
  llvm::isa(E) ||

diff  --git a/clang-tools-extra/clangd/refactor/Rename.cpp 
b/clang-tools-extra/clangd/refactor/Rename.cpp
index c08f6ea805aa..ea75de6e86ea 100644
--- a/clang-tools-extra/clangd/refactor/Rename.cpp
+++ b/clang-tools-extra/clangd/refactor/Rename.cpp
@@ -98,10 +98,10 @@ llvm::DenseSet locateDeclAt(ParsedAST 
,
   return Result;
 }
 
-// By default, we blacklist C++ standard symbols and protobuf symbols as rename
+// By default, we exclude C++ standard symbols and protobuf symbols as rename
 // these symbols would change system/generated files which are unlikely to be
 // modified.
-bool isBlacklisted(const NamedDecl ) {
+bool isExcluded(const NamedDecl ) {
   if (isProtoFile(RenameDecl.getLocation(),
   RenameDecl.getASTContext().getSourceManager()))
 return true;
@@ -138,7 +138,7 @@ llvm::Optional renameable(const NamedDecl 
,
   if (RenameDecl.getParentFunctionOrMethod())
 return None;
 
-  if (isBlacklisted(RenameDecl))
+  if (isExcluded(RenameDecl))
 return ReasonToReject::UnsupportedSymbol;
 
   // Check whether the symbol being rename is indexable.

diff  --git a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp 
b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp
index 69bfe6731418..104f8ba63dd0 100644
--- a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp
+++ b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp
@@ -339,7 +339,7 @@ const 

Re: [clang] 059ba74 - Revert "[codeview] Put !heapallocsite on calls to operator new"

2020-06-09 Thread Eric Christopher via cfe-commits
FWIW before you reapply this let me know. I've seen some other failures
associated and would like to give it a run through.

-eric

On Sat, Jun 6, 2020 at 4:38 PM Douglas Yung via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

>
> Author: Douglas Yung
> Date: 2020-06-06T23:30:46Z
> New Revision: 059ba74bb6f6166ca7c1783ef81dd37a5209b758
>
> URL:
> https://github.com/llvm/llvm-project/commit/059ba74bb6f6166ca7c1783ef81dd37a5209b758
> DIFF:
> https://github.com/llvm/llvm-project/commit/059ba74bb6f6166ca7c1783ef81dd37a5209b758.diff
>
> LOG: Revert "[codeview] Put !heapallocsite on calls to operator new"
>
> This reverts commit 672ed5386024ba5cee53e19d637b7920a4889837.
>
> This commit is hitting an assertion failure across multiple bots in the
> test:
> Profile- :: instrprof-gcov-multithread_fork.test
>
> Failing bots include:
> http://lab.llvm.org:8011/builders/llvm-avr-linux/builds/2205
> http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/8967
> http://lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/10789
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/27750
> http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/16751
>
> Added:
>
>
> Modified:
> clang/lib/CodeGen/CGCall.cpp
> clang/lib/CodeGen/CGDebugInfo.cpp
> clang/lib/CodeGen/CGDebugInfo.h
> clang/lib/CodeGen/CGExprCXX.cpp
> clang/lib/CodeGen/CGExprScalar.cpp
> clang/test/CodeGen/debug-info-codeview-heapallocsite.c
>
> Removed:
> clang/test/CodeGenCXX/debug-info-codeview-heapallocsite.cpp
>
>
>
> 
> diff  --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
> index 136782fccf40..6bde3124555b 100644
> --- a/clang/lib/CodeGen/CGCall.cpp
> +++ b/clang/lib/CodeGen/CGCall.cpp
> @@ -4951,7 +4951,7 @@ RValue CodeGenFunction::EmitCall(const
> CGFunctionInfo ,
>// Add metadata for calls to MSAllocator functions
>if (getDebugInfo() && TargetDecl &&
>TargetDecl->hasAttr())
> -getDebugInfo()->addHeapAllocSiteMetadata(CI, RetTy->getPointeeType(),
> Loc);
> +getDebugInfo()->addHeapAllocSiteMetadata(CI, RetTy, Loc);
>
>// 4. Finish the call.
>
>
> diff  --git a/clang/lib/CodeGen/CGDebugInfo.cpp
> b/clang/lib/CodeGen/CGDebugInfo.cpp
> index 1737154d179a..cc50ec6a8c89 100644
> --- a/clang/lib/CodeGen/CGDebugInfo.cpp
> +++ b/clang/lib/CodeGen/CGDebugInfo.cpp
> @@ -2146,14 +2146,16 @@ llvm::DIType
> *CGDebugInfo::getOrCreateStandaloneType(QualType D,
>return T;
>  }
>
> -void CGDebugInfo::addHeapAllocSiteMetadata(llvm::CallBase *CI,
> -   QualType AllocatedTy,
> +void CGDebugInfo::addHeapAllocSiteMetadata(llvm::Instruction *CI,
> +   QualType D,
> SourceLocation Loc) {
>llvm::MDNode *node;
> -  if (AllocatedTy->isVoidType())
> +  if (D.getTypePtr()->isVoidPointerType()) {
>  node = llvm::MDNode::get(CGM.getLLVMContext(), None);
> -  else
> -node = getOrCreateType(AllocatedTy, getOrCreateFile(Loc));
> +  } else {
> +QualType PointeeTy = D.getTypePtr()->getPointeeType();
> +node = getOrCreateType(PointeeTy, getOrCreateFile(Loc));
> +  }
>
>CI->setMetadata("heapallocsite", node);
>  }
>
> diff  --git a/clang/lib/CodeGen/CGDebugInfo.h
> b/clang/lib/CodeGen/CGDebugInfo.h
> index 96ef6c7c1d27..367047e79dc9 100644
> --- a/clang/lib/CodeGen/CGDebugInfo.h
> +++ b/clang/lib/CodeGen/CGDebugInfo.h
> @@ -509,7 +509,7 @@ class CGDebugInfo {
>llvm::DIType *getOrCreateStandaloneType(QualType Ty, SourceLocation
> Loc);
>
>/// Add heapallocsite metadata for MSAllocator calls.
> -  void addHeapAllocSiteMetadata(llvm::CallBase *CallSite, QualType
> AllocatedTy,
> +  void addHeapAllocSiteMetadata(llvm::Instruction *CallSite, QualType Ty,
>  SourceLocation Loc);
>
>void completeType(const EnumDecl *ED);
>
> diff  --git a/clang/lib/CodeGen/CGExprCXX.cpp
> b/clang/lib/CodeGen/CGExprCXX.cpp
> index dfae2bc5e47a..d0012337cdd3 100644
> --- a/clang/lib/CodeGen/CGExprCXX.cpp
> +++ b/clang/lib/CodeGen/CGExprCXX.cpp
> @@ -1638,13 +1638,6 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const
> CXXNewExpr *E) {
>  RValue RV =
>EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
>
> -// Set !heapallocsite metadata on the call to operator new.
> -if (getDebugInfo()) {
> -  if (auto *newCall = dyn_cast(RV.getScalarVal()))
> -getDebugInfo()->addHeapAllocSiteMetadata(newCall, allocType,
> - E->getExprLoc());
> -}
> -
>  // If this was a call to a global replaceable allocation function
> that does
>  // not take an alignment argument, the allocator is known to produce
>  // storage that's suitably aligned for any object that fits, up to a
> known
>
> diff  --git a/clang/lib/CodeGen/CGExprScalar.cpp
> 

[clang] c554c5e - Fix full unrolling with new pass manager.

2020-05-29 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-05-29T20:08:21-07:00
New Revision: c554c5e159aee43c5cd8236e077817e9f29dea78

URL: 
https://github.com/llvm/llvm-project/commit/c554c5e159aee43c5cd8236e077817e9f29dea78
DIFF: 
https://github.com/llvm/llvm-project/commit/c554c5e159aee43c5cd8236e077817e9f29dea78.diff

LOG: Fix full unrolling with new pass manager.

Last we looked at this and couldn't come up with a reason to change
it, but with a pragma for full loop unrolling we bypass every other
loop unroll and then fail to fully unroll a loop when the pragma is set.

Move the OnlyWhenForced out of the check and into the initialization
of the full unroll pass in the new pass manager. This doesn't show up
with the old pass manager.

Add a new option to opt so that we can turn off loop unrolling
manually since this is a difference between clang and opt.

Tested with check-clang and check-llvm.

Added: 
llvm/test/Transforms/LoopUnroll/FullUnroll.ll

Modified: 
clang/test/Misc/loop-opt-setup.c
llvm/lib/Passes/PassBuilder.cpp
llvm/tools/opt/NewPMDriver.cpp

Removed: 




diff  --git a/clang/test/Misc/loop-opt-setup.c 
b/clang/test/Misc/loop-opt-setup.c
index f283e803a7d1..868c716c6ed7 100644
--- a/clang/test/Misc/loop-opt-setup.c
+++ b/clang/test/Misc/loop-opt-setup.c
@@ -1,5 +1,5 @@
-// RUN: %clang -O1 -fexperimental-new-pass-manager -fno-unroll-loops -S -o - 
%s -emit-llvm | FileCheck %s
-// RUN: %clang -O1 -fno-experimental-new-pass-manager -fno-unroll-loops -S -o 
- %s -emit-llvm | FileCheck %s
+// RUN: %clang -O1 -fexperimental-new-pass-manager -fno-unroll-loops -S -o - 
%s -emit-llvm | FileCheck %s -check-prefix=CHECK-NEWPM
+// RUN: %clang -O1 -fno-experimental-new-pass-manager -fno-unroll-loops -S -o 
- %s -emit-llvm | FileCheck %s -check-prefix=CHECK-OLDPM
 extern int a[16];
 int b = 0;
 int foo(void) {
@@ -8,5 +8,35 @@ int foo(void) {
 a[i] = b += 2;
   return b;
 }
-// CHECK-NOT: br i1
+// Check br i1 to make sure that the loop is fully unrolled
+// CHECK-LABEL-NEWPM: foo
+// CHECK-NOT-NEWPM: br i1
+// CHECK-LABEL-OLDPM: foo
+// CHECK-NOT-OLDPM: br i1
 
+void Helper() {
+  const int *nodes[5];
+  int num_active = 5;
+
+  while (num_active)
+#pragma clang loop unroll(full)
+for (int i = 0; i < 5; ++i)
+  if (nodes[i])
+--num_active;
+}
+
+// Check br i1 to make sure the loop is gone, there will still be a label 
branch for the infinite loop.
+// CHECK-LABEL-NEWPM: Helper
+// CHECK-NEWPM: br label
+// CHECK-NEWPM-NOT: br i1
+// CHECK-NEWPM: br label
+
+// The old pass manager doesn't remove the while loop so check for 5 load i32*.
+// CHECK-LABEL-OLDPM: Helper
+// CHECK-OLDPM: br label
+// CHECK-OLDPM: load i32*
+// CHECK-OLDPM: load i32*
+// CHECK-OLDPM: load i32*
+// CHECK-OLDPM: load i32*
+// CHECK-OLDPM: load i32*
+// CHECK-OLDPM: ret

diff  --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 1b1701cbe261..fda2af7e80b3 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -519,12 +519,13 @@ 
PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
   LPM2.addPass(LoopDeletionPass());
   // Do not enable unrolling in PreLinkThinLTO phase during sample PGO
   // because it changes IR to makes profile annotation in back compile
-  // inaccurate.
-  if ((Phase != ThinLTOPhase::PreLink || !PGOOpt ||
-   PGOOpt->Action != PGOOptions::SampleUse) &&
-  PTO.LoopUnrolling)
+  // inaccurate. The normal unroller doesn't pay attention to forced full 
unroll
+  // attributes so we need to make sure and allow the full unroll pass to pay
+  // attention to it.
+  if (Phase != ThinLTOPhase::PreLink || !PGOOpt ||
+  PGOOpt->Action != PGOOptions::SampleUse)
 LPM2.addPass(LoopFullUnrollPass(Level.getSpeedupLevel(),
-/*OnlyWhenForced=*/false,
+/* OnlyWhenForced= */ !PTO.LoopUnrolling,
 PTO.ForgetAllSCEVInLoopUnroll));
 
   for (auto  : LoopOptimizerEndEPCallbacks)

diff  --git a/llvm/test/Transforms/LoopUnroll/FullUnroll.ll 
b/llvm/test/Transforms/LoopUnroll/FullUnroll.ll
new file mode 100644
index ..01936e487682
--- /dev/null
+++ b/llvm/test/Transforms/LoopUnroll/FullUnroll.ll
@@ -0,0 +1,77 @@
+; RUN: opt -passes='default' -disable-verify --mtriple x86_64-pc-linux-gnu 
-new-pm-disable-loop-unrolling=true \
+; RUN: -S -o - %s | FileCheck %s
+
+; This checks that the loop full unroller will fire in the new pass manager
+; when forced via #pragma in the source (or annotation in the code).
+target datalayout = 
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; We don't end up deleting the loop, merely turning it infinite, but we remove
+; everything inside of it so check for the loop structure and absence of
+; conditional branches.
+; 

[clang] 97a133f - Temporarily Revert "[Clang][AArch64] Capturing proper pointer alignment for Neon vld1 intrinsicts"

2020-05-26 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-05-26T18:51:00-07:00
New Revision: 97a133f15724aa7ddf5d9b62dc9c0657a4efd115

URL: 
https://github.com/llvm/llvm-project/commit/97a133f15724aa7ddf5d9b62dc9c0657a4efd115
DIFF: 
https://github.com/llvm/llvm-project/commit/97a133f15724aa7ddf5d9b62dc9c0657a4efd115.diff

LOG: Temporarily Revert "[Clang][AArch64] Capturing proper pointer alignment 
for Neon vld1 intrinsicts"
as it's causing crashes on code generation and 
https://bugs.llvm.org/show_bug.cgi?id=46084

This reverts commit 98cad555e29187a03e2bc3db5780762981913902.

Added: 


Modified: 
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/aarch64-neon-intrinsics.c

Removed: 




diff  --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index bef0ad27145f..b5129249c016 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -10329,9 +10329,9 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned 
BuiltinID,
   }
   case NEON::BI__builtin_neon_vld1_v:
   case NEON::BI__builtin_neon_vld1q_v: {
-auto Alignment = CGM.getNaturalPointeeTypeAlignment(
-E->getArg(0)->IgnoreParenCasts()->getType());
 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(VTy));
+auto Alignment = CharUnits::fromQuantity(
+BuiltinID == NEON::BI__builtin_neon_vld1_v ? 8 : 16);
 return Builder.CreateAlignedLoad(VTy, Ops[0], Alignment);
   }
   case NEON::BI__builtin_neon_vst1_v:
@@ -10344,8 +10344,8 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned 
BuiltinID,
 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
 Ty = llvm::PointerType::getUnqual(VTy->getElementType());
 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
-auto Alignment = CGM.getNaturalPointeeTypeAlignment(
-E->getArg(0)->IgnoreParenCasts()->getType());
+auto Alignment = CharUnits::fromQuantity(
+BuiltinID == NEON::BI__builtin_neon_vld1_lane_v ? 8 : 16);
 Ops[0] =
 Builder.CreateAlignedLoad(VTy->getElementType(), Ops[0], Alignment);
 return Builder.CreateInsertElement(Ops[1], Ops[0], Ops[2], "vld1_lane");
@@ -10355,8 +10355,8 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned 
BuiltinID,
 Value *V = UndefValue::get(Ty);
 Ty = llvm::PointerType::getUnqual(VTy->getElementType());
 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
-auto Alignment = CGM.getNaturalPointeeTypeAlignment(
-E->getArg(0)->IgnoreParenCasts()->getType());
+auto Alignment = CharUnits::fromQuantity(
+BuiltinID == NEON::BI__builtin_neon_vld1_dup_v ? 8 : 16);
 Ops[0] =
 Builder.CreateAlignedLoad(VTy->getElementType(), Ops[0], Alignment);
 llvm::Constant *CI = ConstantInt::get(Int32Ty, 0);

diff  --git a/clang/test/CodeGen/aarch64-neon-intrinsics.c 
b/clang/test/CodeGen/aarch64-neon-intrinsics.c
index 1fb245f3d342..7744b4f4a159 100644
--- a/clang/test/CodeGen/aarch64-neon-intrinsics.c
+++ b/clang/test/CodeGen/aarch64-neon-intrinsics.c
@@ -8956,7 +8956,7 @@ float64_t test_vrsqrted_f64(float64_t a) {
 
 // CHECK-LABEL: @test_vld1q_u8(
 // CHECK:   [[TMP0:%.*]] = bitcast i8* %a to <16 x i8>*
-// CHECK:   [[TMP1:%.*]] = load <16 x i8>, <16 x i8>* [[TMP0]], align 1
+// CHECK:   [[TMP1:%.*]] = load <16 x i8>, <16 x i8>* [[TMP0]]
 // CHECK:   ret <16 x i8> [[TMP1]]
 uint8x16_t test_vld1q_u8(uint8_t const *a) {
   return vld1q_u8(a);
@@ -8965,7 +8965,7 @@ uint8x16_t test_vld1q_u8(uint8_t const *a) {
 // CHECK-LABEL: @test_vld1q_u16(
 // CHECK:   [[TMP0:%.*]] = bitcast i16* %a to i8*
 // CHECK:   [[TMP1:%.*]] = bitcast i8* [[TMP0]] to <8 x i16>*
-// CHECK:   [[TMP2:%.*]] = load <8 x i16>, <8 x i16>* [[TMP1]], align 2
+// CHECK:   [[TMP2:%.*]] = load <8 x i16>, <8 x i16>* [[TMP1]]
 // CHECK:   ret <8 x i16> [[TMP2]]
 uint16x8_t test_vld1q_u16(uint16_t const *a) {
   return vld1q_u16(a);
@@ -8974,7 +8974,7 @@ uint16x8_t test_vld1q_u16(uint16_t const *a) {
 // CHECK-LABEL: @test_vld1q_u32(
 // CHECK:   [[TMP0:%.*]] = bitcast i32* %a to i8*
 // CHECK:   [[TMP1:%.*]] = bitcast i8* [[TMP0]] to <4 x i32>*
-// CHECK:   [[TMP2:%.*]] = load <4 x i32>, <4 x i32>* [[TMP1]], align 4
+// CHECK:   [[TMP2:%.*]] = load <4 x i32>, <4 x i32>* [[TMP1]]
 // CHECK:   ret <4 x i32> [[TMP2]]
 uint32x4_t test_vld1q_u32(uint32_t const *a) {
   return vld1q_u32(a);
@@ -8983,7 +8983,7 @@ uint32x4_t test_vld1q_u32(uint32_t const *a) {
 // CHECK-LABEL: @test_vld1q_u64(
 // CHECK:   [[TMP0:%.*]] = bitcast i64* %a to i8*
 // CHECK:   [[TMP1:%.*]] = bitcast i8* [[TMP0]] to <2 x i64>*
-// CHECK:   [[TMP2:%.*]] = load <2 x i64>, <2 x i64>* [[TMP1]], align 8
+// CHECK:   [[TMP2:%.*]] = load <2 x i64>, <2 x i64>* [[TMP1]]
 // CHECK:   ret <2 x i64> [[TMP2]]
 uint64x2_t test_vld1q_u64(uint64_t const *a) {
   return vld1q_u64(a);
@@ -8991,7 +8991,7 @@ uint64x2_t test_vld1q_u64(uint64_t const *a) {
 
 // CHECK-LABEL: @test_vld1q_s8(
 // CHECK:   [[TMP0:%.*]] = bitcast 

Re: [clang] d82538b - Fix -Wunused compiler warning.

2020-05-11 Thread Eric Christopher via cfe-commits
Very much so. Also nice all_of use! I'd have never thought about that :)

-eric

On Mon, May 11, 2020 at 7:03 PM David Blaikie via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

>
>
> On Mon, May 11, 2020 at 12:21 AM Haojian Wu via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>>
>> Author: Haojian Wu
>> Date: 2020-05-11T09:20:48+02:00
>> New Revision: d82538b3f691f3ba1cb7a945a5f8594f71816fdf
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/d82538b3f691f3ba1cb7a945a5f8594f71816fdf
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/d82538b3f691f3ba1cb7a945a5f8594f71816fdf.diff
>>
>> LOG: Fix -Wunused compiler warning.
>>
>> Added:
>>
>>
>> Modified:
>> clang/lib/AST/Expr.cpp
>>
>> Removed:
>>
>>
>>
>>
>> 
>> diff  --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
>> index 2a0e0425ef1f..8b327300fb2d 100644
>> --- a/clang/lib/AST/Expr.cpp
>> +++ b/clang/lib/AST/Expr.cpp
>> @@ -4686,8 +4686,10 @@ RecoveryExpr::RecoveryExpr(ASTContext ,
>> QualType T, SourceLocation BeginLoc,
>>  : Expr(RecoveryExprClass, T, VK_LValue, OK_Ordinary),
>> BeginLoc(BeginLoc),
>>EndLoc(EndLoc), NumExprs(SubExprs.size()) {
>>assert(!T.isNull());
>> +#ifndef NDEBUG // avoid -Wunused warnings.
>>for (auto *E : SubExprs)
>>  assert(E != nullptr);
>> +#endif
>>
>
> This might be better written as:
>
> assert(llvm::all_of(SubExprs, [](Expr* E) { return E != nullptr; }));
>
> & probably include some kind of message (... && "message") about this
> precondition.
>
>
>>
>>llvm::copy(SubExprs, getTrailingObjects());
>>setDependence(computeDependence(this));
>>
>>
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D72281: [Matrix] Add matrix type to Clang.

2020-05-11 Thread Eric Christopher via cfe-commits
FWIW this broke lldb builds due to an unhandled enumeration.

I've fixed them in:

commit cd7cb1f4ce3ffc8be1146eeba28ae7dc50089459 (origin/master, origin/HEAD)
Author: Eric Christopher 
Date:   Mon May 11 13:44:12 2020 -0700

Update lldb for rG10658691951f to avoid Werror messages around
new unhandled matrix types.

Might want to rethink how they're being (not) handled though. :)

-eric

On Mon, May 11, 2020 at 11:20 AM Florian Hahn via Phabricator via
cfe-commits  wrote:

> This revision was automatically updated to reflect the committed changes.
> Closed by commit rG10658691951f: [Matrix] Add matrix type to Clang.
> (authored by fhahn).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D72281?vs=262759=263222#toc
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D72281/new/
>
> https://reviews.llvm.org/D72281
>
> Files:
>   clang/include/clang/AST/ASTContext.h
>   clang/include/clang/AST/RecursiveASTVisitor.h
>   clang/include/clang/AST/Type.h
>   clang/include/clang/AST/TypeLoc.h
>   clang/include/clang/AST/TypeProperties.td
>   clang/include/clang/Basic/Attr.td
>   clang/include/clang/Basic/DiagnosticSemaKinds.td
>   clang/include/clang/Basic/Features.def
>   clang/include/clang/Basic/LangOptions.def
>   clang/include/clang/Basic/TypeNodes.td
>   clang/include/clang/Driver/Options.td
>   clang/include/clang/Sema/Sema.h
>   clang/include/clang/Serialization/TypeBitCodes.def
>   clang/lib/AST/ASTContext.cpp
>   clang/lib/AST/ASTStructuralEquivalence.cpp
>   clang/lib/AST/ExprConstant.cpp
>   clang/lib/AST/ItaniumMangle.cpp
>   clang/lib/AST/MicrosoftMangle.cpp
>   clang/lib/AST/Type.cpp
>   clang/lib/AST/TypePrinter.cpp
>   clang/lib/CodeGen/CGDebugInfo.cpp
>   clang/lib/CodeGen/CGDebugInfo.h
>   clang/lib/CodeGen/CGExpr.cpp
>   clang/lib/CodeGen/CodeGenFunction.cpp
>   clang/lib/CodeGen/CodeGenTypes.cpp
>   clang/lib/CodeGen/ItaniumCXXABI.cpp
>   clang/lib/Driver/ToolChains/Clang.cpp
>   clang/lib/Frontend/CompilerInvocation.cpp
>   clang/lib/Sema/SemaExpr.cpp
>   clang/lib/Sema/SemaLookup.cpp
>   clang/lib/Sema/SemaTemplate.cpp
>   clang/lib/Sema/SemaTemplateDeduction.cpp
>   clang/lib/Sema/SemaType.cpp
>   clang/lib/Sema/TreeTransform.h
>   clang/lib/Serialization/ASTReader.cpp
>   clang/lib/Serialization/ASTWriter.cpp
>   clang/test/CodeGen/debug-info-matrix-types.c
>   clang/test/CodeGen/matrix-type.c
>   clang/test/CodeGenCXX/matrix-type.cpp
>   clang/test/Parser/matrix-type-disabled.c
>   clang/test/SemaCXX/matrix-type.cpp
>   clang/tools/libclang/CIndex.cpp
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 35edd70 - Temporarily revert "build: use `find_package(Python3)` if available"

2020-04-28 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-04-28T16:41:22-07:00
New Revision: 35edd704e0fda09e8e634515c0b451d4a8b6b914

URL: 
https://github.com/llvm/llvm-project/commit/35edd704e0fda09e8e634515c0b451d4a8b6b914
DIFF: 
https://github.com/llvm/llvm-project/commit/35edd704e0fda09e8e634515c0b451d4a8b6b914.diff

LOG: Temporarily revert "build: use `find_package(Python3)` if available"
as it seems to be causing multiple people problems with running tests
and building.

This reverts commit c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6.

Added: 


Modified: 
clang-tools-extra/test/lit.site.cfg.py.in
clang/CMakeLists.txt
clang/bindings/python/tests/CMakeLists.txt
clang/test/lit.site.cfg.py.in
clang/utils/perf-training/CMakeLists.txt
clang/utils/perf-training/lit.site.cfg.in
clang/utils/perf-training/order-files.lit.site.cfg.in
lld/CMakeLists.txt
lld/test/Unit/lit.site.cfg.py.in
lld/test/lit.site.cfg.py.in
llvm/CMakeLists.txt
llvm/cmake/config-ix.cmake
llvm/cmake/modules/AddLLVM.cmake
llvm/test/lit.site.cfg.py.in
llvm/tools/llvm-shlib/CMakeLists.txt

Removed: 




diff  --git a/clang-tools-extra/test/lit.site.cfg.py.in 
b/clang-tools-extra/test/lit.site.cfg.py.in
index 5dc112a56126..a970e7fafc1f 100644
--- a/clang-tools-extra/test/lit.site.cfg.py.in
+++ b/clang-tools-extra/test/lit.site.cfg.py.in
@@ -8,7 +8,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
 config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
 config.clang_libs_dir = "@SHLIBDIR@"
-config.python_executable = "@Python3_EXECUTABLE@"
+config.python_executable = "@PYTHON_EXECUTABLE@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@
 

diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 7dadc5f6e917..88e556fd88a0 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -130,38 +130,16 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
   set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY 
${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
 
   if(LLVM_INCLUDE_TESTS)
-if(CMAKE_VERSION VERSION_LESS 3.12)
-  include(FindPythonInterp)
-  if(NOT PYTHONINTERP_FOUND)
-message(FATAL_ERROR
-  "Unable to find Python interpreter, required for builds and testing.
+include(FindPythonInterp)
+if(NOT PYTHONINTERP_FOUND)
+  message(FATAL_ERROR
+"Unable to find Python interpreter, required for builds and testing.
 
-  Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
-  endif()
-
-  if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
-message(FATAL_ERROR "Python 2.7 or newer is required")
-  endif()
+Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
+endif()
 
-  add_executable(Python3::Interpreter IMPORTED)
-  set_target_properties(Python3::Interpreter PROPERTIES
-IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
-  set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
-else()
-  find_package(Python3 COMPONENTS Interpreter)
-  if(NOT Python3_Interpreter_FOUND)
-message(WARNING "Python3 not found, using python2 as a fallback")
-find_package(Python2 COMPONENTS Interpreter REQUIRED)
-if(Python2_VERSION VERSION_LESS 2.7)
-  message(SEND_ERROR "Python 2.7 or newer is required")
-endif()
-
-# Treat python2 as python3
-add_executable(Python3::Interpreter IMPORTED)
-set_target_properties(Python3::Interpreter PROPERTIES
-  IMPORTED_LOCATION ${Python2_EXECUTABLE})
-set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
-  endif()
+if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
+  message(FATAL_ERROR "Python 2.7 or newer is required")
 endif()
 
 # Check prebuilt llvm/utils.

diff  --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index 3f58c4bde8e7..626256af9c1b 100644
--- a/clang/bindings/python/tests/CMakeLists.txt
+++ b/clang/bindings/python/tests/CMakeLists.txt
@@ -3,7 +3,7 @@
 add_custom_target(check-clang-python
 COMMAND ${CMAKE_COMMAND} -E env
 CLANG_LIBRARY_PATH=$
-"${Python3_EXECUTABLE}" -m unittest discover
+${PYTHON_EXECUTABLE} -m unittest discover
 DEPENDS libclang
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 

diff  --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 4527ccadbb4a..daec694bd128 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -27,7 +27,7 @@ config.enable_backtrace = @ENABLE_BACKTRACES@
 config.enable_experimental_new_pass_manager = 
@ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER@
 config.enable_threads = @LLVM_ENABLE_THREADS@
 config.host_arch = "@HOST_ARCH@"
-config.python_executable = "@Python3_EXECUTABLE@"
+config.python_executable = 

[clang] 35edd70 - Temporarily revert "build: use `find_package(Python3)` if available"

2020-04-28 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-04-28T16:41:22-07:00
New Revision: 35edd704e0fda09e8e634515c0b451d4a8b6b914

URL: 
https://github.com/llvm/llvm-project/commit/35edd704e0fda09e8e634515c0b451d4a8b6b914
DIFF: 
https://github.com/llvm/llvm-project/commit/35edd704e0fda09e8e634515c0b451d4a8b6b914.diff

LOG: Temporarily revert "build: use `find_package(Python3)` if available"
as it seems to be causing multiple people problems with running tests
and building.

This reverts commit c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6.

Added: 


Modified: 
clang-tools-extra/test/lit.site.cfg.py.in
clang/CMakeLists.txt
clang/bindings/python/tests/CMakeLists.txt
clang/test/lit.site.cfg.py.in
clang/utils/perf-training/CMakeLists.txt
clang/utils/perf-training/lit.site.cfg.in
clang/utils/perf-training/order-files.lit.site.cfg.in
lld/CMakeLists.txt
lld/test/Unit/lit.site.cfg.py.in
lld/test/lit.site.cfg.py.in
llvm/CMakeLists.txt
llvm/cmake/config-ix.cmake
llvm/cmake/modules/AddLLVM.cmake
llvm/test/lit.site.cfg.py.in
llvm/tools/llvm-shlib/CMakeLists.txt

Removed: 




diff  --git a/clang-tools-extra/test/lit.site.cfg.py.in 
b/clang-tools-extra/test/lit.site.cfg.py.in
index 5dc112a56126..a970e7fafc1f 100644
--- a/clang-tools-extra/test/lit.site.cfg.py.in
+++ b/clang-tools-extra/test/lit.site.cfg.py.in
@@ -8,7 +8,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
 config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
 config.clang_libs_dir = "@SHLIBDIR@"
-config.python_executable = "@Python3_EXECUTABLE@"
+config.python_executable = "@PYTHON_EXECUTABLE@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@
 

diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 7dadc5f6e917..88e556fd88a0 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -130,38 +130,16 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
   set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY 
${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
 
   if(LLVM_INCLUDE_TESTS)
-if(CMAKE_VERSION VERSION_LESS 3.12)
-  include(FindPythonInterp)
-  if(NOT PYTHONINTERP_FOUND)
-message(FATAL_ERROR
-  "Unable to find Python interpreter, required for builds and testing.
+include(FindPythonInterp)
+if(NOT PYTHONINTERP_FOUND)
+  message(FATAL_ERROR
+"Unable to find Python interpreter, required for builds and testing.
 
-  Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
-  endif()
-
-  if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
-message(FATAL_ERROR "Python 2.7 or newer is required")
-  endif()
+Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
+endif()
 
-  add_executable(Python3::Interpreter IMPORTED)
-  set_target_properties(Python3::Interpreter PROPERTIES
-IMPORTED_LOCATION ${PYTHON_EXECUTABLE})
-  set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
-else()
-  find_package(Python3 COMPONENTS Interpreter)
-  if(NOT Python3_Interpreter_FOUND)
-message(WARNING "Python3 not found, using python2 as a fallback")
-find_package(Python2 COMPONENTS Interpreter REQUIRED)
-if(Python2_VERSION VERSION_LESS 2.7)
-  message(SEND_ERROR "Python 2.7 or newer is required")
-endif()
-
-# Treat python2 as python3
-add_executable(Python3::Interpreter IMPORTED)
-set_target_properties(Python3::Interpreter PROPERTIES
-  IMPORTED_LOCATION ${Python2_EXECUTABLE})
-set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
-  endif()
+if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
+  message(FATAL_ERROR "Python 2.7 or newer is required")
 endif()
 
 # Check prebuilt llvm/utils.

diff  --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index 3f58c4bde8e7..626256af9c1b 100644
--- a/clang/bindings/python/tests/CMakeLists.txt
+++ b/clang/bindings/python/tests/CMakeLists.txt
@@ -3,7 +3,7 @@
 add_custom_target(check-clang-python
 COMMAND ${CMAKE_COMMAND} -E env
 CLANG_LIBRARY_PATH=$
-"${Python3_EXECUTABLE}" -m unittest discover
+${PYTHON_EXECUTABLE} -m unittest discover
 DEPENDS libclang
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 

diff  --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 4527ccadbb4a..daec694bd128 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -27,7 +27,7 @@ config.enable_backtrace = @ENABLE_BACKTRACES@
 config.enable_experimental_new_pass_manager = 
@ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER@
 config.enable_threads = @LLVM_ENABLE_THREADS@
 config.host_arch = "@HOST_ARCH@"
-config.python_executable = "@Python3_EXECUTABLE@"
+config.python_executable = 

Re: [PATCH] D78501: Add a facility to get system cache directory and use it in clangd

2020-04-28 Thread Eric Christopher via cfe-commits
I've had to temporarily revert this as it was breaking some tests:

.../sources/llvm-project/llvm/unittests/Support/Path.cpp:334:5: error:
use of undeclared identifier 'set'
set(Value);
^
1 error generated.

Happy to help diagnose this with you if you need some assistance.

Thanks!

-eric

On Tue, Apr 28, 2020 at 3:07 PM Vojtěch Štěpančík via Phabricator via
llvm-commits  wrote:

> VojtechStep added a comment.
>
> Great, thanks for the fixes!
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D78501/new/
>
> https://reviews.llvm.org/D78501
>
>
>
> ___
> llvm-commits mailing list
> llvm-comm...@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] faf2dce - Temporarily revert "Add a facility to get system cache directory and use it in clangd"

2020-04-28 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-04-28T15:49:46-07:00
New Revision: faf2dce1dd6ae25aa75d2685ac7bb27ec31e2ced

URL: 
https://github.com/llvm/llvm-project/commit/faf2dce1dd6ae25aa75d2685ac7bb27ec31e2ced
DIFF: 
https://github.com/llvm/llvm-project/commit/faf2dce1dd6ae25aa75d2685ac7bb27ec31e2ced.diff

LOG: Temporarily revert "Add a facility to get system cache directory and use 
it in clangd"

This reverts commit ad38f4b371bdca214e3a3cda9a76ec2213215c68.

As it broke building the unittests:

.../sources/llvm-project/llvm/unittests/Support/Path.cpp:334:5: error: use of 
undeclared identifier 'set'
set(Value);
^
1 error generated.

Added: 


Modified: 
clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp
llvm/include/llvm/Support/Path.h
llvm/lib/Support/Unix/Path.inc
llvm/lib/Support/Windows/Path.inc
llvm/unittests/Support/Path.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp 
b/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp
index 765b710ba149..b07728ee6a2c 100644
--- a/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp
+++ b/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp
@@ -36,13 +36,18 @@ std::string getShardPathFromFilePath(llvm::StringRef 
ShardRoot,
   return std::string(ShardRootSS.str());
 }
 
-// Uses disk as a storage for index shards.
+// Uses disk as a storage for index shards. Creates a directory called
+// ".clangd/index/" under the path provided during construction.
 class DiskBackedIndexStorage : public BackgroundIndexStorage {
   std::string DiskShardRoot;
 
 public:
-  // Creates `DiskShardRoot` and any parents during construction.
-  DiskBackedIndexStorage(llvm::StringRef Directory) : DiskShardRoot(Directory) 
{
+  // Sets DiskShardRoot to (Directory + ".clangd/index/") which is the base
+  // directory for all shard files.
+  DiskBackedIndexStorage(llvm::StringRef Directory) {
+llvm::SmallString<128> CDBDirectory(Directory);
+llvm::sys::path::append(CDBDirectory, ".clangd", "index");
+DiskShardRoot = std::string(CDBDirectory.str());
 std::error_code OK;
 std::error_code EC = llvm::sys::fs::create_directories(DiskShardRoot);
 if (EC != OK) {
@@ -95,31 +100,26 @@ class NullStorage : public BackgroundIndexStorage {
 };
 
 // Creates and owns IndexStorages for multiple CDBs.
-// When a CDB root is found, shards are stored in $ROOT/.clangd/index.
-// When no root is found, the fallback path is ~/.cache/clangd/index.
 class DiskBackedIndexStorageManager {
 public:
   DiskBackedIndexStorageManager(
   std::function(PathRef)> GetProjectInfo)
   : IndexStorageMapMu(std::make_unique()),
 GetProjectInfo(std::move(GetProjectInfo)) {
-llvm::SmallString<128> FallbackDir;
-if (llvm::sys::path::cache_directory(FallbackDir))
-  llvm::sys::path::append(FallbackDir, "clangd", "index");
-this->FallbackDir = FallbackDir.str().str();
+llvm::SmallString<128> HomeDir;
+llvm::sys::path::home_directory(HomeDir);
+this->HomeDir = HomeDir.str().str();
   }
 
   // Creates or fetches to storage from cache for the specified project.
   BackgroundIndexStorage *operator()(PathRef File) {
 std::lock_guard Lock(*IndexStorageMapMu);
-llvm::SmallString<128> StorageDir(FallbackDir);
-if (auto PI = GetProjectInfo(File)) {
-  StorageDir = PI->SourceRoot;
-  llvm::sys::path::append(StorageDir, ".clangd", "index");
-}
-auto  = IndexStorageMap[StorageDir];
+Path CDBDirectory = HomeDir;
+if (auto PI = GetProjectInfo(File))
+  CDBDirectory = PI->SourceRoot;
+auto  = IndexStorageMap[CDBDirectory];
 if (!IndexStorage)
-  IndexStorage = create(StorageDir);
+  IndexStorage = create(CDBDirectory);
 return IndexStorage.get();
   }
 
@@ -132,7 +132,7 @@ class DiskBackedIndexStorageManager {
 return std::make_unique(CDBDirectory);
   }
 
-  Path FallbackDir;
+  Path HomeDir;
 
   llvm::StringMap> IndexStorageMap;
   std::unique_ptr IndexStorageMapMu;

diff  --git a/llvm/include/llvm/Support/Path.h 
b/llvm/include/llvm/Support/Path.h
index 9edd9c4183ee..728b63c54c05 100644
--- a/llvm/include/llvm/Support/Path.h
+++ b/llvm/include/llvm/Support/Path.h
@@ -368,13 +368,6 @@ void system_temp_directory(bool erasedOnReboot, 
SmallVectorImpl );
 /// @result True if a home directory is set, false otherwise.
 bool home_directory(SmallVectorImpl );
 
-/// Get the directory where installed packages should put their
-/// machine-local cache, e.g. $XDG_CACHE_HOME.
-///
-/// @param result Holds the resulting path name.
-/// @result True if the appropriate path was determined, it need not exist.
-bool cache_directory(SmallVectorImpl );
-
 /// Has root name?
 ///
 /// root_name != ""

diff  --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 783a7ace1005..001ab81b23af 100644
--- a/llvm/lib/Support/Unix/Path.inc

Re: [clang] 83f4372 - [CodeGen] fix clang test that runs the optimizer pipeline; NFC

2020-02-27 Thread Eric Christopher via cfe-commits
Sure. That sounds great. Thanks!

On Wed, Feb 26, 2020 at 10:45 AM Sanjay Patel 
wrote:

> To be clear - the test is checking IR instructions, but it's checking -O1
> IR for various targets.
> So there must be different expectations per target...
> But I just tried a test of turning everything down to -O0, and it all
> passed except for the "fast-math" run for AArch64.
> I can tweak that to not be so specific if that sounds like a reasonable
> solution.
>
> On Wed, Feb 26, 2020 at 1:05 PM Eric Christopher 
> wrote:
>
>> I mean anything that's testing assembly output out of clang is less than
>> ideal. There are some circumstances, but this doesn't seem like one of
>> them.
>>
>> On Wed, Feb 26, 2020, 9:10 AM Sanjay Patel 
>> wrote:
>>
>>> The test file dates back to:
>>> https://reviews.llvm.org/D5698
>>> ...and I'm not familiar with _Complex enough to say how to fix this
>>> properly (seems like the check lines are already limited such that -O0
>>> rather than -O1 would work?).
>>>
>>> But this file keeps wiggling unexpectedly, it's going to move again with
>>> https://reviews.llvm.org/D75130
>>>
>>> On Tue, Feb 25, 2020 at 1:15 PM Eric Christopher 
>>> wrote:
>>>
 Is there any way to pull this test out of clang and as an opt test?
 What's it trying to test?

 -eric

 On Tue, Feb 25, 2020 at 6:15 AM Sanjay Patel via cfe-commits <
 cfe-commits@lists.llvm.org> wrote:

>
> Author: Sanjay Patel
> Date: 2020-02-25T09:13:49-05:00
> New Revision: 83f4372f3a708ceaa800feff8b1bd92ae2c3be5f
>
> URL:
> https://github.com/llvm/llvm-project/commit/83f4372f3a708ceaa800feff8b1bd92ae2c3be5f
> DIFF:
> https://github.com/llvm/llvm-project/commit/83f4372f3a708ceaa800feff8b1bd92ae2c3be5f.diff
>
> LOG: [CodeGen] fix clang test that runs the optimizer pipeline; NFC
>
> There's already a FIXME note on this file; it can break when the
> underlying LLVM behavior changes independently of anything in clang.
>
> Added:
>
>
> Modified:
> clang/test/CodeGen/complex-math.c
>
> Removed:
>
>
>
>
> 
> diff  --git a/clang/test/CodeGen/complex-math.c
> b/clang/test/CodeGen/complex-math.c
> index e42418ad72c2..54dee473a364 100644
> --- a/clang/test/CodeGen/complex-math.c
> +++ b/clang/test/CodeGen/complex-math.c
> @@ -93,14 +93,15 @@ float _Complex mul_float_rc(float a, float
> _Complex b) {
>// X86: ret
>return a * b;
>  }
> +
>  float _Complex mul_float_cc(float _Complex a, float _Complex b) {
>// X86-LABEL: @mul_float_cc(
>// X86: %[[AC:[^ ]+]] = fmul
>// X86: %[[BD:[^ ]+]] = fmul
>// X86: %[[AD:[^ ]+]] = fmul
>// X86: %[[BC:[^ ]+]] = fmul
> -  // X86: %[[RR:[^ ]+]] = fsub float %[[AC]], %[[BD]]
> -  // X86: %[[RI:[^ ]+]] = fadd float
> +  // X86: %[[RR:[^ ]+]] = fsub
> +  // X86: %[[RI:[^ ]+]] = fadd
>// X86-DAG: %[[AD]]
>// X86-DAG: ,
>// X86-DAG: %[[BC]]
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D74918: Add method to TargetInfo to get CPU cache line size

2020-02-27 Thread Eric Christopher via cfe-commits
I'm agreed with James on all points fwiw.

On Thu, Feb 27, 2020, 2:00 PM James Y Knight via Phabricator <
revi...@reviews.llvm.org> wrote:

> jyknight requested changes to this revision.
> jyknight added a comment.
> This revision now requires changes to proceed.
>
> In D74918#1885869 , @zoecarver
> wrote:
>
> > @jyknight It would probably be best if we could account for CPUs who
> like to use aligned pairs when getting a cache line. It's probably also
> important that we don't change the value `getCPUCacheLineSize` returns, so,
> if we are going to account for that, we should probably update
> `getCPUCacheLineSize ` before this patch lands.
>
>
> It would be extremely unfortunate to go to all the trouble of attempting
> to return accurate results from the P0154 interfaces, and then to return an
> answer insufficient to actually achieve the performance benefit it's
> intended for, and then be unable to fix it due to ABI concerns. So, yes, I
> do believe that this issue must be decided.
>
> Additionally, my opinion here has really not changed from a couple of
> years ago. I continue to believe it was a mistake to standardize these
> constexpr values, and that absolutely the best course of action would be to
> continue to decline to implement this part of the standard, forever. (And
> that GCC should similarly also continue to decline to implement it).
>
> That said, the list of cacheline sizes collected in this review is still
> useful in any case, since it needs to be copied into LLVM's X86Subtarget to
> implement the backend getCacheLineSize function.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D74918/new/
>
> https://reviews.llvm.org/D74918
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 83f4372 - [CodeGen] fix clang test that runs the optimizer pipeline; NFC

2020-02-26 Thread Eric Christopher via cfe-commits
I mean anything that's testing assembly output out of clang is less than
ideal. There are some circumstances, but this doesn't seem like one of
them.

On Wed, Feb 26, 2020, 9:10 AM Sanjay Patel  wrote:

> The test file dates back to:
> https://reviews.llvm.org/D5698
> ...and I'm not familiar with _Complex enough to say how to fix this
> properly (seems like the check lines are already limited such that -O0
> rather than -O1 would work?).
>
> But this file keeps wiggling unexpectedly, it's going to move again with
> https://reviews.llvm.org/D75130
>
> On Tue, Feb 25, 2020 at 1:15 PM Eric Christopher 
> wrote:
>
>> Is there any way to pull this test out of clang and as an opt test?
>> What's it trying to test?
>>
>> -eric
>>
>> On Tue, Feb 25, 2020 at 6:15 AM Sanjay Patel via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>>
>>> Author: Sanjay Patel
>>> Date: 2020-02-25T09:13:49-05:00
>>> New Revision: 83f4372f3a708ceaa800feff8b1bd92ae2c3be5f
>>>
>>> URL:
>>> https://github.com/llvm/llvm-project/commit/83f4372f3a708ceaa800feff8b1bd92ae2c3be5f
>>> DIFF:
>>> https://github.com/llvm/llvm-project/commit/83f4372f3a708ceaa800feff8b1bd92ae2c3be5f.diff
>>>
>>> LOG: [CodeGen] fix clang test that runs the optimizer pipeline; NFC
>>>
>>> There's already a FIXME note on this file; it can break when the
>>> underlying LLVM behavior changes independently of anything in clang.
>>>
>>> Added:
>>>
>>>
>>> Modified:
>>> clang/test/CodeGen/complex-math.c
>>>
>>> Removed:
>>>
>>>
>>>
>>>
>>> 
>>> diff  --git a/clang/test/CodeGen/complex-math.c
>>> b/clang/test/CodeGen/complex-math.c
>>> index e42418ad72c2..54dee473a364 100644
>>> --- a/clang/test/CodeGen/complex-math.c
>>> +++ b/clang/test/CodeGen/complex-math.c
>>> @@ -93,14 +93,15 @@ float _Complex mul_float_rc(float a, float _Complex
>>> b) {
>>>// X86: ret
>>>return a * b;
>>>  }
>>> +
>>>  float _Complex mul_float_cc(float _Complex a, float _Complex b) {
>>>// X86-LABEL: @mul_float_cc(
>>>// X86: %[[AC:[^ ]+]] = fmul
>>>// X86: %[[BD:[^ ]+]] = fmul
>>>// X86: %[[AD:[^ ]+]] = fmul
>>>// X86: %[[BC:[^ ]+]] = fmul
>>> -  // X86: %[[RR:[^ ]+]] = fsub float %[[AC]], %[[BD]]
>>> -  // X86: %[[RI:[^ ]+]] = fadd float
>>> +  // X86: %[[RR:[^ ]+]] = fsub
>>> +  // X86: %[[RI:[^ ]+]] = fadd
>>>// X86-DAG: %[[AD]]
>>>// X86-DAG: ,
>>>// X86-DAG: %[[BC]]
>>>
>>>
>>>
>>> ___
>>> cfe-commits mailing list
>>> cfe-commits@lists.llvm.org
>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>>
>>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 83f4372 - [CodeGen] fix clang test that runs the optimizer pipeline; NFC

2020-02-25 Thread Eric Christopher via cfe-commits
Is there any way to pull this test out of clang and as an opt test? What's
it trying to test?

-eric

On Tue, Feb 25, 2020 at 6:15 AM Sanjay Patel via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

>
> Author: Sanjay Patel
> Date: 2020-02-25T09:13:49-05:00
> New Revision: 83f4372f3a708ceaa800feff8b1bd92ae2c3be5f
>
> URL:
> https://github.com/llvm/llvm-project/commit/83f4372f3a708ceaa800feff8b1bd92ae2c3be5f
> DIFF:
> https://github.com/llvm/llvm-project/commit/83f4372f3a708ceaa800feff8b1bd92ae2c3be5f.diff
>
> LOG: [CodeGen] fix clang test that runs the optimizer pipeline; NFC
>
> There's already a FIXME note on this file; it can break when the
> underlying LLVM behavior changes independently of anything in clang.
>
> Added:
>
>
> Modified:
> clang/test/CodeGen/complex-math.c
>
> Removed:
>
>
>
>
> 
> diff  --git a/clang/test/CodeGen/complex-math.c
> b/clang/test/CodeGen/complex-math.c
> index e42418ad72c2..54dee473a364 100644
> --- a/clang/test/CodeGen/complex-math.c
> +++ b/clang/test/CodeGen/complex-math.c
> @@ -93,14 +93,15 @@ float _Complex mul_float_rc(float a, float _Complex b)
> {
>// X86: ret
>return a * b;
>  }
> +
>  float _Complex mul_float_cc(float _Complex a, float _Complex b) {
>// X86-LABEL: @mul_float_cc(
>// X86: %[[AC:[^ ]+]] = fmul
>// X86: %[[BD:[^ ]+]] = fmul
>// X86: %[[AD:[^ ]+]] = fmul
>// X86: %[[BC:[^ ]+]] = fmul
> -  // X86: %[[RR:[^ ]+]] = fsub float %[[AC]], %[[BD]]
> -  // X86: %[[RI:[^ ]+]] = fadd float
> +  // X86: %[[RR:[^ ]+]] = fsub
> +  // X86: %[[RI:[^ ]+]] = fadd
>// X86-DAG: %[[AD]]
>// X86-DAG: ,
>// X86-DAG: %[[BC]]
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 28728bf - Fix a signed/unsigned warning promoted to error.

2020-02-18 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2020-02-18T17:49:22-08:00
New Revision: 28728bf06f556dc8be5bc1fa77129906ba68

URL: 
https://github.com/llvm/llvm-project/commit/28728bf06f556dc8be5bc1fa77129906ba68
DIFF: 
https://github.com/llvm/llvm-project/commit/28728bf06f556dc8be5bc1fa77129906ba68.diff

LOG: Fix a signed/unsigned warning promoted to error.

Added: 


Modified: 
clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp

Removed: 




diff  --git 
a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp 
b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
index d365bbbe3c43..2938e2b9c7cd 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
@@ -86,7 +86,7 @@ static bool checkParamDeclOfAncestorCallExprHasRValueRefType(
   if (const clang::CallExpr *TheCallExpr =
   tryGetCallExprAncestorForCxxConstructExpr(TheCxxConstructExpr,
 Context)) {
-for (int i = 0; i < TheCallExpr->getNumArgs(); ++i) {
+for (unsigned i = 0; i < TheCallExpr->getNumArgs(); ++i) {
   const Expr *Arg = TheCallExpr->getArg(i);
   if (Arg->getSourceRange() == TheCxxConstructExpr->getSourceRange()) {
 if (const auto *TheCallExprFuncProto =



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 24ab9b5 - Generalize the pass registration mechanism used by Polly to any third-party tool

2020-01-08 Thread Eric Christopher via cfe-commits
On Wed, Jan 8, 2020 at 1:40 AM Serge Guelton  wrote:

> On Tue, Jan 07, 2020 at 04:57:29PM -0800, Eric Christopher wrote:
> > >  ; CHECK-EP-VECTORIZER-START-NEXT: Running pass: NoOpFunctionPass
> > > +; CHECK-EXT: Running pass: {{.*}}::Bye on foo
> > >
> > > Why is this running on every test of the pass manager? It should
> be an
> > example
> > > run in the examples directory and not on by default? Same for
> every other
> > PM
> > > test. This seems like a bug?
> >
> > It's not. When the examples are active and if the appropriate cmake
> flag is
> > set
> > (which is not the case by default), the pass is linked in
> statically, and
> > is run
> > in the default pipeline. The CHECK-EXT prefix is disabled otherwise.
> That's
> > one
> > of the configuration I did test :-)
> >
> >
> >
> > I really don't think this is ideal. The examples directory shouldn't
> affect
> > tests being run or not or in what way. Can we back this part out and
> talk about
> > it a bit more? I don't think we should need to do this to test the
> > functionality.
>
> I can just error if LLVM_BYE_LINK_INTO_TOOLS=ON, and remove that part. It
> means
> less testing, but somehow Polly is already some kind of test case. Would
> that be okay with you?
>

I'd really like to avoid linking bye into any of the tools by default and
instead just come up with a different test mechanism to show it's working.

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 24ab9b5 - Generalize the pass registration mechanism used by Polly to any third-party tool

2020-01-08 Thread Eric Christopher via cfe-commits
On Wed, Jan 8, 2020 at 3:07 PM Michael Kruse 
wrote:

> Am Di., 7. Jan. 2020 um 18:57 Uhr schrieb Eric Christopher via
> cfe-commits :
> >> Is there anything I should have done? Probably reaching llvm-dev before
> >> commiting. Reaching the right reviewers has always been a challenge to
> me, I had
> >> hoped that the mail to llvm-dev would trigger some subscription :-)
> >
> >
> > Hrm. Probably finding some different reviewers, but I can't fault your
> attempts here. Usually you can look at the last few people to make
> substantial work in an area and loop them in via git log. :)
>
> In my experience adding more reviewers usually rarely to more people
> looking into the patch. Especially the people that make substantial
> work in an area and/or are code owners are added as reviewers to very
> many commits and cannot look into all of them.
>

As one of those added to a lot of patches I have a lot of sympathy here.
The answer isn't to avoid adding people with expertise in an area and no
one on the approval list had expertise or had recently hacked on the code.


> Note that in the patch in question, there are comments from people not
> in the reviewer list. For example, Mehdi with whom I also talked about
> this patch at the last LLVM DevMtg.
>
>
Yes, but none of them ack'd it.


> We also have a policy that allows post-commit reviews and reverts.
> Therefore I think we should not put that bar for allowing to commit
> too high.
>
>
I could, of course, have just asked this to be reverted I guess.


>
> >> >  ; CHECK-EP-VECTORIZER-START-NEXT: Running pass: NoOpFunctionPass
> >> > +; CHECK-EXT: Running pass: {{.*}}::Bye on foo
> >> >
> >> > Why is this running on every test of the pass manager? It should be
> an example
> >> > run in the examples directory and not on by default? Same for every
> other PM
> >> > test. This seems like a bug?
> >>
> >> It's not. When the examples are active and if the appropriate cmake
> flag is set
> >> (which is not the case by default), the pass is linked in statically,
> and is run
> >> in the default pipeline. The CHECK-EXT prefix is disabled otherwise.
> That's one
> >> of the configuration I did test :-)
> >>
> >
> > I really don't think this is ideal. The examples directory shouldn't
> affect tests being run or not or in what way. Can we back this part out and
> talk about it a bit more? I don't think we should need to do this to test
> the functionality.
>
> In a previous discussion [1] we discussed adding tutorial code to
> repository which naturally should also be tested to avoid bit-rot. How
> do you suggest to testing of examples should work? Note that LLVMHello
> is also tested, but not in the example directory.
>

llvm/tests/examples?

Thanks.

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 24ab9b5 - Generalize the pass registration mechanism used by Polly to any third-party tool

2020-01-07 Thread Eric Christopher via cfe-commits
Hi Serge!

Thanks for a lot of the answers here :)

>
> The proposed infrastructure makes this process smoother and non intrusive
> to the
> llvm-project codebase: all development can be done in a separate git repo,
> integration is controlled through cmake flags, and integration to
> clang/opt/bugpoint is built-in.
>
>
Sounds reasonably nice.


> > That being said, perhaps it is worth it? But I think we need to call out
> why we
> > want it. I would also have expected something to llvm-dev for a change
> of this
> > magnitude. I didn't see anyone from the pass manager hierarchy on the
> reviews
> > and the final reviewer wasn't someone who contributes to these areas
> typically.
>
> I've (obviously) mentioned this development on llvm-dev, see
>
> http://lists.llvm.org/pipermail/llvm-dev/2019-September/135326.html
>
> Is there anything I should have done? Probably reaching llvm-dev before
> commiting. Reaching the right reviewers has always been a challenge to me,
> I had
> hoped that the mail to llvm-dev would trigger some subscription :-)
>

Hrm. Probably finding some different reviewers, but I can't fault your
attempts here. Usually you can look at the last few people to make
substantial work in an area and loop them in via git log. :)

> In addition, what's with the OSX failure? It's currently turned off and
> was
> > breaking the bots, but does it mean that you don't expect this machinery
> to
> > work on OSX? That seems like a severely limiting factor for the project.
>
> I've setup github actions to test many configurations before merging [0],
> but missed one of
> them. I'm currently working on fixing that part.
>

Nice! Glad for the work here.


> >  ; CHECK-EP-VECTORIZER-START-NEXT: Running pass: NoOpFunctionPass
> > +; CHECK-EXT: Running pass: {{.*}}::Bye on foo
> >
> > Why is this running on every test of the pass manager? It should be an
> example
> > run in the examples directory and not on by default? Same for every
> other PM
> > test. This seems like a bug?
>
> It's not. When the examples are active and if the appropriate cmake flag
> is set
> (which is not the case by default), the pass is linked in statically, and
> is run
> in the default pipeline. The CHECK-EXT prefix is disabled otherwise.
> That's one
> of the configuration I did test :-)
>
>
I really don't think this is ideal. The examples directory shouldn't affect
tests being run or not or in what way. Can we back this part out and talk
about it a bit more? I don't think we should need to do this to test the
functionality.


> > Thanks!
>
> Thanks for giving me the opportunity to clarify some obscure points, hope
> it
> helps !
>
>
It very much did. Thanks for explaining.

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 24ab9b5 - Generalize the pass registration mechanism used by Polly to any third-party tool

2020-01-06 Thread Eric Christopher via cfe-commits
Hi Serge,

I have a few questions here about this:

In general this appears to be a lot more complex than the existing plugin
solutions and requires quite a lot of custom cmake rules that are difficult
to maintain. Why do we want this in general for the project? I understand
the desire to make polly less of a special case, but I don't think that the
overall complexity is worth the added ability to register polly plugins.
Perhaps disabling the polly plugin registration scheme is a better option?

That being said, perhaps it is worth it? But I think we need to call out
why we want it. I would also have expected something to llvm-dev for a
change of this magnitude. I didn't see anyone from the pass manager
hierarchy on the reviews and the final reviewer wasn't someone who
contributes to these areas typically.

In addition, what's with the OSX failure? It's currently turned off and was
breaking the bots, but does it mean that you don't expect this machinery to
work on OSX? That seems like a severely limiting factor for the project.

+One first needs to create an independent project and add it to either
``tools/``
+or, using the MonoRepo layout, at the root of the repo alongside other
projects.

This appears to be from an earlier incarnation of the patch? There's only
one layout now.


 ; CHECK-EP-VECTORIZER-START-NEXT: Running pass: NoOpFunctionPass
+; CHECK-EXT: Running pass: {{.*}}::Bye on foo

Why is this running on every test of the pass manager? It should be an
example run in the examples directory and not on by default? Same for every
other PM test. This seems like a bug?

Thanks!

-eric


On Thu, Jan 2, 2020 at 7:52 AM via cfe-commits 
wrote:

>
> Author: serge_sans_paille
> Date: 2020-01-02T16:45:31+01:00
> New Revision: 24ab9b537e61b3fe5e6a1019492ff6530d82a3ee
>
> URL:
> https://github.com/llvm/llvm-project/commit/24ab9b537e61b3fe5e6a1019492ff6530d82a3ee
> DIFF:
> https://github.com/llvm/llvm-project/commit/24ab9b537e61b3fe5e6a1019492ff6530d82a3ee.diff
>
> LOG: Generalize the pass registration mechanism used by Polly to any
> third-party tool
>
> There's quite a lot of references to Polly in the LLVM CMake codebase.
> However
> the registration pattern used by Polly could be useful to other external
> projects: thanks to that mechanism it would be possible to develop LLVM
> extension without touching the LLVM code base.
>
> This patch has two effects:
>
> 1. Remove all code specific to Polly in the llvm/clang codebase,
> replaicing it
>with a generic mechanism
>
> 2. Provide a generic mechanism to register compiler extensions.
>
> A compiler extension is similar to a pass plugin, with the notable
> difference
> that the compiler extension can be configured to be built dynamically (like
> plugins) or statically (like regular passes).
>
> As a result, people willing to add extra passes to clang/opt can do it
> using a
> separate code repo, but still have their pass be linked in clang/opt as
> built-in
> passes.
>
> Differential Revision: https://reviews.llvm.org/D61446
>
> Added:
> llvm/examples/Bye/Bye.cpp
> llvm/examples/Bye/CMakeLists.txt
> llvm/test/Feature/load_extension.ll
> polly/lib/Plugin/Polly.cpp
>
> Modified:
> clang/lib/CodeGen/BackendUtil.cpp
> clang/lib/CodeGen/CMakeLists.txt
> clang/tools/driver/CMakeLists.txt
> clang/tools/driver/cc1_main.cpp
> llvm/CMakeLists.txt
> llvm/cmake/modules/AddLLVM.cmake
> llvm/docs/WritingAnLLVMPass.rst
> llvm/examples/CMakeLists.txt
> llvm/include/llvm/Config/llvm-config.h.cmake
> llvm/test/Other/new-pm-defaults.ll
> llvm/test/Other/new-pm-thinlto-defaults.ll
> llvm/test/Other/opt-O0-pipeline.ll
> llvm/test/Other/opt-O2-pipeline.ll
> llvm/test/Other/opt-O3-pipeline.ll
> llvm/test/Other/opt-Os-pipeline.ll
> llvm/test/lit.cfg.py
> llvm/test/lit.site.cfg.py.in
> llvm/tools/CMakeLists.txt
> llvm/tools/bugpoint/CMakeLists.txt
> llvm/tools/bugpoint/bugpoint.cpp
> llvm/tools/opt/CMakeLists.txt
> llvm/tools/opt/NewPMDriver.cpp
> llvm/tools/opt/opt.cpp
> llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
> polly/include/polly/RegisterPasses.h
> polly/lib/CMakeLists.txt
> polly/lib/Support/RegisterPasses.cpp
> polly/test/Unit/lit.site.cfg.in
> polly/test/lit.site.cfg.in
> polly/test/update_check.py
>
> Removed:
> polly/lib/Polly.cpp
>
>
>
> 
> diff  --git a/clang/lib/CodeGen/BackendUtil.cpp
> b/clang/lib/CodeGen/BackendUtil.cpp
> index 645ef0165a53..ed881f2ddf68 100644
> --- a/clang/lib/CodeGen/BackendUtil.cpp
> +++ b/clang/lib/CodeGen/BackendUtil.cpp
> @@ -75,6 +75,10 @@
>  using namespace clang;
>  using namespace llvm;
>
> +#define HANDLE_EXTENSION(Ext)
>   \
> +  llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
> +#include "llvm/Support/Extension.def"
> +
>  namespace {
>
>  // Default filename used for profile generation.
> @@ 

Re: [PATCH] D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior

2019-12-26 Thread Eric Christopher via cfe-commits
You can sign up for an account by emailing the admin account.

On Thu, Dec 26, 2019, 5:04 PM Anton Yudintsev via Phabricator <
revi...@reviews.llvm.org> wrote:

> AntonYudintsev added a comment.
>
> I have found bug in clang-cl (win32 clang), related to recent inroduction
> of ffp-exception-behavior.
> Unfortunately, I don't have a working patch yet, and since LLVM bugtracker
> registration is closed, I can not even submit a bug.
>
> So, if it is not a trouble for you, I will email the bug description here.
>
> Please let me know if it isn't appropriate. Bug description:
> 
>
> Windows: clang-cl is generating call to non-existing lib function for
> win32 with /fp:except option.
> With recent ffp-exception-behavior=maytrap/strict, fp:except in clang-cl
> became generate FPE aware code.
>
> But in case of floorf and ceilf it generates call to non-existing library
> function.
>
> clang-cl.exe -m32 /Ox /fp:except testFloor.cpp /FA
> testFloor.cpp:
>
>   #include 
>   float ret(float v) {  return floorf(v); }
>
> resulting assember:
>
>   pusheax
>   movssxmm0, dword ptr [esp + 8]
>   movssdword ptr [esp], xmm0
>   call_floorf #no such function!!!
>   popeax
>   ret
>
> Expected behaviour:
>
> there is no floorf lib function. Like with cosf and other math functions,
> floorf in MSVC is implemented as inline function.
>
> So, it should be call to _floor (with apropriate conversion first).
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D62731/new/
>
> https://reviews.llvm.org/D62731
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 2369560 - Fix -Wunused-lambda-capture warnings.

2019-12-26 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-12-26T15:27:21-08:00
New Revision: 2369560f4a7720b19edfbf9de14ef061307ff773

URL: 
https://github.com/llvm/llvm-project/commit/2369560f4a7720b19edfbf9de14ef061307ff773
DIFF: 
https://github.com/llvm/llvm-project/commit/2369560f4a7720b19edfbf9de14ef061307ff773.diff

LOG: Fix -Wunused-lambda-capture warnings.

Added: 


Modified: 
clang-tools-extra/clang-query/QueryParser.cpp
clang/lib/ASTMatchers/Dynamic/Parser.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-query/QueryParser.cpp 
b/clang-tools-extra/clang-query/QueryParser.cpp
index db4b9a4b0530..a980722de9e6 100644
--- a/clang-tools-extra/clang-query/QueryParser.cpp
+++ b/clang-tools-extra/clang-query/QueryParser.cpp
@@ -26,7 +26,7 @@ namespace query {
 // is found before End, return StringRef().  Begin is adjusted to exclude the
 // lexed region.
 StringRef QueryParser::lexWord() {
-  Line = Line.drop_while([this](char c) {
+  Line = Line.drop_while([](char c) {
 // Don't trim newlines.
 return StringRef(" \t\v\f\r").contains(c);
   });

diff  --git a/clang/lib/ASTMatchers/Dynamic/Parser.cpp 
b/clang/lib/ASTMatchers/Dynamic/Parser.cpp
index 1781f2a6439f..77c9629f6f85 100644
--- a/clang/lib/ASTMatchers/Dynamic/Parser.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Parser.cpp
@@ -297,7 +297,7 @@ class Parser::CodeTokenizer {
 
   /// Consume all leading whitespace from \c Code.
   void consumeWhitespace() {
-Code = Code.drop_while([this](char c) {
+Code = Code.drop_while([](char c) {
   // Don't trim newlines.
   return StringRef(" \t\v\f\r").contains(c);
 });



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D71486: [clang-tools-extra] Fix switch coverage warning

2019-12-13 Thread Eric Christopher via cfe-commits
On Fri, Dec 13, 2019 at 1:18 PM Dávid Bolvanský via Phabricator <
revi...@reviews.llvm.org> wrote:

> xbolva00 added a comment.
>
> In D71486#1784079 , @sammccall
> wrote:
>
> > It should be possible to test this by adapting a test case from the
> original ed8dadb <
> https://reviews.llvm.org/rGed8dadb37c7e1a7f4889d868ac9b19bfe7762237>, but
> I'm not certain...
>

> This concern was not addressed/answered.


> The commit
> https://reviews.llvm.org/rG5623bd52acd34db2e9cfc11d1510407610a14db0
> claims that this was reviewed by rsmith, but I don't see rsmith's LGTM
> here..
>
>
Both of these were handled offline: Sam mentioned just getting something in
to stop the Werror breakage in #clang on Discord and Richard was looking
over my shoulder as I was fixing up the patch.

Apologies for not following up with an email to this effect.


>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D71486/new/
>
> https://reviews.llvm.org/D71486
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] 5623bd5 - Fix -Wswitch-coverage warning in clang-tidy after ak_addrspace introduction.

2019-12-13 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-12-13T12:57:48-08:00
New Revision: 5623bd52acd34db2e9cfc11d1510407610a14db0

URL: 
https://github.com/llvm/llvm-project/commit/5623bd52acd34db2e9cfc11d1510407610a14db0
DIFF: 
https://github.com/llvm/llvm-project/commit/5623bd52acd34db2e9cfc11d1510407610a14db0.diff

LOG: Fix -Wswitch-coverage warning in clang-tidy after ak_addrspace 
introduction.

Differential Revision: https://reviews.llvm.org/D71486
Reviewed By: rsmith

Added: 


Modified: 
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp 
b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index a349789a64d1..a5b6834316f4 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -521,6 +521,9 @@ void ClangTidyDiagnosticConsumer::forwardDiagnostic(const 
Diagnostic ) {
 case clang::DiagnosticsEngine::ak_attr:
   Builder << reinterpret_cast(Info.getRawArg(Index));
   break;
+case clang::DiagnosticsEngine::ak_addrspace:
+  Builder << static_cast(Info.getRawArg(Index));
+  break;
 }
   }
 }



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D71419: [clang] [test] Disable the test exhausting stack on NetBSD

2019-12-12 Thread Eric Christopher via cfe-commits
No worries, it happens.

On Thu, Dec 12, 2019, 10:59 PM Michał Górny  wrote:

> On Thu, 2019-12-12 at 14:47 -0800, Eric Christopher wrote:
> > As a quick note, this broke the test because you didn't update the line
> > numbers in the checks.
> >
> > Fixed thusly:
> >
> > echristo@athyra ~/r/llvm-project> git push
> > To github.com:llvm/llvm-project.git
> >6bed43f3c40..259a9b10390  master -> master
> >
> > :)
> >
>
> Thank you.  I'm sorry I didn't think that a such thing could happen.
>
> --
> Best regards,
> Michał Górny
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D71419: [clang] [test] Disable the test exhausting stack on NetBSD

2019-12-12 Thread Eric Christopher via cfe-commits
As a quick note, this broke the test because you didn't update the line
numbers in the checks.

Fixed thusly:

echristo@athyra ~/r/llvm-project> git push
To github.com:llvm/llvm-project.git
   6bed43f3c40..259a9b10390  master -> master

:)

-eric

On Thu, Dec 12, 2019 at 12:25 PM Petr Hosek via Phabricator via cfe-commits
 wrote:

> phosek accepted this revision.
> phosek added a comment.
> This revision is now accepted and ready to land.
>
> LGTM
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D71419/new/
>
> https://reviews.llvm.org/D71419
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 259a9b1 - Update line number after previous patch added an additional unsupported

2019-12-12 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-12-12T14:45:05-08:00
New Revision: 259a9b1039093a1d036c1e6efcae699873f93ba5

URL: 
https://github.com/llvm/llvm-project/commit/259a9b1039093a1d036c1e6efcae699873f93ba5
DIFF: 
https://github.com/llvm/llvm-project/commit/259a9b1039093a1d036c1e6efcae699873f93ba5.diff

LOG: Update line number after previous patch added an additional unsupported
and comment lines.

Added: 


Modified: 
clang/test/SemaTemplate/instantiation-depth-default.cpp

Removed: 




diff  --git a/clang/test/SemaTemplate/instantiation-depth-default.cpp 
b/clang/test/SemaTemplate/instantiation-depth-default.cpp
index 39410bd89b49..61619623c97c 100644
--- a/clang/test/SemaTemplate/instantiation-depth-default.cpp
+++ b/clang/test/SemaTemplate/instantiation-depth-default.cpp
@@ -9,10 +9,10 @@
 // UNSUPPORTED: system-netbsd
 
 template struct X : X {};
-// expected-error-re@8 {{recursive template instantiation exceeded maximum 
depth of 1024{{$
-// expected-note@8 {{instantiation of template class}}
-// expected-note@8 {{skipping 1023 contexts in backtrace}}
-// expected-note@8 {{use -ftemplate-depth=N to increase recursive template 
instantiation depth}}
+// expected-error-re@11 {{recursive template instantiation exceeded maximum 
depth of 1024{{$
+// expected-note@11 {{instantiation of template class}}
+// expected-note@11 {{skipping 1023 contexts in backtrace}}
+// expected-note@11 {{use -ftemplate-depth=N to increase recursive template 
instantiation depth}}
 
 X<0, int> x; // expected-note {{in instantiation of}}
 



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 7f9b513 - Reapply af57dbf12e54 "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="

2019-12-10 Thread Eric Christopher via cfe-commits
So you left some debugging code in that I've fixed thusly:

"Enclosing function uses fp intrinsics"

commit f4a7d5659df7cb56c1baa34a39e9fe2639472741
Author: Eric Christopher 
Date:   Tue Dec 10 15:02:29 2019 -0800

Remove debugging printf and reformat code.

On Thu, Dec 5, 2019 at 3:48 AM Melanie Blower via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

>
> Author: Melanie Blower
> Date: 2019-12-05T03:48:04-08:00
> New Revision: 7f9b5138470db1dc58f3bc05631284c653c9ed7a
>
> URL:
> https://github.com/llvm/llvm-project/commit/7f9b5138470db1dc58f3bc05631284c653c9ed7a
> DIFF:
> https://github.com/llvm/llvm-project/commit/7f9b5138470db1dc58f3bc05631284c653c9ed7a.diff
>
> LOG: Reapply af57dbf12e54 "Add support for options
> -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="
>
> Patch was reverted because
> https://bugs.llvm.org/show_bug.cgi?id=44048
> The original patch is modified to set the strictfp IR attribute
> explicitly in CodeGen instead of as a side effect of IRBuilder.
> In the 2nd attempt to reapply there was a windows lit test fail,
> the
> tests were fixed to use wildcard matching.
>
> Differential Revision: https://reviews.llvm.org/D62731
>
> Added:
> clang/test/CodeGen/fpconstrained.c
> clang/test/CodeGen/fpconstrained.cpp
> clang/test/Driver/fp-model.c
>
> Modified:
> clang/docs/UsersManual.rst
> clang/include/clang/AST/Decl.h
> clang/include/clang/AST/DeclBase.h
> clang/include/clang/Basic/DiagnosticDriverKinds.td
> clang/include/clang/Basic/DiagnosticGroups.td
> clang/include/clang/Basic/LangOptions.def
> clang/include/clang/Basic/LangOptions.h
> clang/include/clang/Driver/Options.td
> clang/lib/AST/Decl.cpp
> clang/lib/CodeGen/CGCall.cpp
> clang/lib/CodeGen/CodeGenFunction.cpp
> clang/lib/CodeGen/CodeGenFunction.h
> clang/lib/Driver/ToolChains/Clang.cpp
> clang/lib/Frontend/CompilerInvocation.cpp
> clang/lib/Sema/SemaExpr.cpp
> clang/lib/Serialization/ASTReaderDecl.cpp
> clang/lib/Serialization/ASTWriterDecl.cpp
> clang/test/Driver/clang_f_opts.c
> clang/test/Driver/fast-math.c
> llvm/include/llvm/IR/IRBuilder.h
> llvm/include/llvm/Target/TargetOptions.h
> llvm/unittests/IR/IRBuilderTest.cpp
>
> Removed:
>
>
>
>
> 
> diff  --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
> index 714681d7f4ce..62e2575c6b26 100644
> --- a/clang/docs/UsersManual.rst
> +++ b/clang/docs/UsersManual.rst
> @@ -1231,10 +1231,10 @@ are listed below.
>
>  **-f[no-]trapping-math**
>
> -   ``-fno-trapping-math`` allows optimizations that assume that
> -   floating point operations cannot generate traps such as divide-by-zero,
> -   overflow and underflow. Defaults to ``-ftrapping-math``.
> -   Currently this option has no effect.
> +   Control floating point exception behavior. ``-fno-trapping-math``
> allows optimizations that assume that floating point operations cannot
> generate traps such as divide-by-zero, overflow and underflow.
> +
> +- The option ``-ftrapping-math`` behaves identically to
> ``-ffp-exception-behavior=strict``.
> +- The option ``-fno-trapping-math`` behaves identically to
> ``-ffp-exception-behavior=ignore``.   This is the default.
>
>  .. option:: -ffp-contract=
>
> @@ -1319,6 +1319,52 @@ are listed below.
>
> Defaults to ``-fno-finite-math``.
>
> +.. _opt_frounding-math:
> +
> +**-f[no-]rounding-math**
> +
> +Force floating-point operations to honor the dynamically-set rounding
> mode by default.
> +
> +The result of a floating-point operation often cannot be exactly
> represented in the result type and therefore must be rounded.  IEEE 754
> describes
> diff erent rounding modes that control how to perform this rounding, not
> all of which are supported by all implementations.  C provides interfaces
> (``fesetround`` and ``fesetenv``) for dynamically controlling the rounding
> mode, and while it also recommends certain conventions for changing the
> rounding mode, these conventions are not typically enforced in the ABI.
> Since the rounding mode changes the numerical result of operations, the
> compiler must understand something about it in order to optimize floating
> point operations.
> +
> +Note that floating-point operations performed as part of constant
> initialization are formally performed prior to the start of the program and
> are therefore not subject to the current rounding mode.  This includes the
> initialization of global variables and local ``static`` variables.
> Floating-point operations in these contexts will be rounded using
> ``FE_TONEAREST``.
> +
> +- The option ``-fno-rounding-math`` allows the compiler to assume that
> the rounding mode is set to ``FE_TONEAREST``.  This is the default.
> +- The option ``-frounding-math`` forces the compiler to honor the
> dynamically-set rounding mode.  This 

[clang] f4a7d56 - Remove debugging printf and reformat code.

2019-12-10 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-12-10T15:04:45-08:00
New Revision: f4a7d5659df7cb56c1baa34a39e9fe2639472741

URL: 
https://github.com/llvm/llvm-project/commit/f4a7d5659df7cb56c1baa34a39e9fe2639472741
DIFF: 
https://github.com/llvm/llvm-project/commit/f4a7d5659df7cb56c1baa34a39e9fe2639472741.diff

LOG: Remove debugging printf and reformat code.

Added: 


Modified: 
clang/lib/Sema/SemaExpr.cpp

Removed: 




diff  --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index f6bcf899a7fb..a941d524b7f2 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -13010,11 +13010,9 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation 
OpLoc,
   (getLangOpts().getFPRoundingMode() != LangOptions::FPR_ToNearest ||
getLangOpts().getFPExceptionMode() != LangOptions::FPE_Ignore))
 // Mark the current function as usng floating point constrained intrinsics
-if (FunctionDecl *F = dyn_cast(CurContext))
-{
+if (FunctionDecl *F = dyn_cast(CurContext)) {
   F->setUsesFPIntrin(true);
-  printf("Enclosing function uses fp intrinsics\n");
-}
+}
 
   // Some of the binary operations require promoting operands of half vector to
   // float vectors and truncating the result back to half vector. For now, we 
do



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] d82b6ba - Revert "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."

2019-12-10 Thread Eric Christopher via cfe-commits
You don't need to revert for a missing differential revision, just close
the revision yourself :)

-eric

On Tue, Dec 10, 2019 at 11:51 AM Sourabh Singh Tomar via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

>
> Author: Sourabh Singh Tomar
> Date: 2019-12-11T01:20:40+05:30
> New Revision: d82b6ba21b32ddf00af886b9160feef88211773e
>
> URL:
> https://github.com/llvm/llvm-project/commit/d82b6ba21b32ddf00af886b9160feef88211773e
> DIFF:
> https://github.com/llvm/llvm-project/commit/d82b6ba21b32ddf00af886b9160feef88211773e.diff
>
> LOG: Revert "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is
> specified."
>
> This reverts commit 6ef01588f4d75ef43da4ed2a37ba7a8b8daab259.
> Missing Differetial revision.
>
> Added:
>
>
> Modified:
> clang/test/CodeGen/split-debug-output.c
> clang/test/CodeGen/thinlto-split-dwarf.c
> llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
> llvm/test/DebugInfo/X86/debug_addr.ll
> llvm/test/DebugInfo/X86/string-offsets-table.ll
>
> Removed:
>
>
>
>
> 
> diff  --git a/clang/test/CodeGen/split-debug-output.c
> b/clang/test/CodeGen/split-debug-output.c
> index 19569f8d574b..1507edd24849 100644
> --- a/clang/test/CodeGen/split-debug-output.c
> +++ b/clang/test/CodeGen/split-debug-output.c
> @@ -1,11 +1,7 @@
>  // REQUIRES: x86-registered-target
> -// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited
> -dwarf-version=4 -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj
> -o - %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=DWARFv4 %s
> -// RUN: llvm-dwarfdump -debug-info %t | FileCheck --check-prefix=DWARFv4
> %s
> -
> -// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited
> -dwarf-version=5 -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj
> -o - %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=DWARFv5 %s
> -// RUN: llvm-dwarfdump -debug-info %t | FileCheck --check-prefix=DWARFv5
> %s
> +// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited
> -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj -o - %s |
> llvm-dwarfdump -debug-info - | FileCheck %s
> +// RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
>
>  int f() { return 0; }
>
> -// DWARFv4: DW_AT_GNU_dwo_name ("foo.dwo")
> -// DWARFv5: DW_AT_dwo_name ("foo.dwo")
> +// CHECK: DW_AT_GNU_dwo_name ("foo.dwo")
>
> diff  --git a/clang/test/CodeGen/thinlto-split-dwarf.c
> b/clang/test/CodeGen/thinlto-split-dwarf.c
> index 419bd1320bb2..60649b0881bb 100644
> --- a/clang/test/CodeGen/thinlto-split-dwarf.c
> +++ b/clang/test/CodeGen/thinlto-split-dwarf.c
> @@ -13,31 +13,11 @@
>  // RUN:   -o %t.native.o -split-dwarf-file %t.file.dwo \
>  // RUN:   -split-dwarf-output %t.output.dwo -x ir %t.o
>
> -// RUN: llvm-dwarfdump %t.native.o | FileCheck --check-prefix=DWARFv4-O %s
> -// RUN: llvm-dwarfdump %t.output.dwo | FileCheck
> --check-prefix=DWARFv4-DWO %s
> +// RUN: llvm-dwarfdump %t.native.o | FileCheck --check-prefix=O %s
> +// RUN: llvm-dwarfdump %t.output.dwo | FileCheck --check-prefix=DWO %s
>
> -// DWARFv4-O: DW_AT_GNU_dwo_name ("{{.*}}.file.dwo")
> -// DWARFv4-O-NOT: DW_TAG_subprogram
> -// DWARFv4-DWO: DW_TAG_subprogram
> -
> -// RUN: %clang_cc1 -debug-info-kind=limited -dwarf-version=5 -triple
> x86_64-unknown-linux-gnu \
> -// RUN:   -flto=thin -emit-llvm-bc \
> -// RUN:   -o %t.o %s
> -
> -// RUN: llvm-lto2 run -thinlto-distributed-indexes %t.o \
> -// RUN:   -o %t2.index \
> -// RUN:   -r=%t.o,main,px
> -
> -// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu \
> -// RUN:   -emit-obj -fthinlto-index=%t.o.thinlto.bc \
> -// RUN:   -o %t.native.o -dwarf-version=5 -split-dwarf-file %t.file.dwo \
> -// RUN:   -split-dwarf-output %t.output.dwo -x ir %t.o
> -
> -// RUN: llvm-dwarfdump %t.native.o | FileCheck --check-prefix=DWARFv5-O %s
> -// RUN: llvm-dwarfdump %t.output.dwo | FileCheck
> --check-prefix=DWARFv5-DWO %s
> -
> -// DWARFv5-O: DW_AT_dwo_name ("{{.*}}.file.dwo")
> -// DWARFv5-O-NOT: DW_TAG_subprogram
> -// DWARFv5-DWO: DW_TAG_subprogram
> +// O: DW_AT_GNU_dwo_name ("{{.*}}.file.dwo")
> +// O-NOT: DW_TAG_subprogram
> +// DWO: DW_TAG_subprogram
>
>  int main() {}
>
> diff  --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> index f6039cc5bc00..89a0e350f8fe 100644
> --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
> @@ -856,13 +856,10 @@ void DwarfDebug::finishUnitAttributes(const
> DICompileUnit *DIUnit,
>  // This CU is either a clang module DWO or a skeleton CU.
>  NewCU.addUInt(Die, dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8,
>DIUnit->getDWOId());
> -if (!DIUnit->getSplitDebugFilename().empty()) {
> +if (!DIUnit->getSplitDebugFilename().empty())
>// This is a prefabricated skeleton CU.
> -  dwarf::Attribute attrDWOName = 

[clang-tools-extra] 52b1c94 - Turn off unused variable checking here since we're explicitly adding

2019-12-09 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-12-09T19:14:04-08:00
New Revision: 52b1c94a5fe47c8bb5e189bc40bfd50255ce5795

URL: 
https://github.com/llvm/llvm-project/commit/52b1c94a5fe47c8bb5e189bc40bfd50255ce5795
DIFF: 
https://github.com/llvm/llvm-project/commit/52b1c94a5fe47c8bb5e189bc40bfd50255ce5795.diff

LOG: Turn off unused variable checking here since we're explicitly adding
a command line for clang-tidy.

Added: 


Modified: 
clang-tools-extra/test/clang-tidy/checkers/cert-mem57-cpp-cpp17.cpp

Removed: 




diff  --git 
a/clang-tools-extra/test/clang-tidy/checkers/cert-mem57-cpp-cpp17.cpp 
b/clang-tools-extra/test/clang-tidy/checkers/cert-mem57-cpp-cpp17.cpp
index d393b229bda1..f26098682c2c 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/cert-mem57-cpp-cpp17.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/cert-mem57-cpp-cpp17.cpp
@@ -1,6 +1,6 @@
 // RUN: %check_clang_tidy %s -std=c++14 cert-mem57-cpp %t
-// RUN: clang-tidy --extra-arg='-std=c++17' --extra-arg='-faligned-allocation' 
-checks='-*,cert-mem57-cpp' --warnings-as-errors='*' %s
-// RUN: clang-tidy --extra-arg='-std=c++2a' --extra-arg='-faligned-allocation' 
-checks='-*,cert-mem57-cpp' --warnings-as-errors='*' %s
+// RUN: clang-tidy --extra-arg='-std=c++17' --extra-arg='-faligned-allocation' 
-checks='-*,cert-mem57-cpp' --extra-arg=-Wno-unused-variable 
--warnings-as-errors='*' %s
+// RUN: clang-tidy --extra-arg='-std=c++2a' --extra-arg='-faligned-allocation' 
-checks='-*,cert-mem57-cpp' --extra-arg=-Wno-unused-variable 
--warnings-as-errors='*' %s
 
 struct alignas(128) Vector {
   char Elems[128];



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 9c6b7f6 - Revert "[ARM][MVE] Add intrinsics for immediate shifts."

2019-12-09 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-12-09T16:47:38-08:00
New Revision: 9c6b7f68b807250e7c3aa01938339fdbd239c4ea

URL: 
https://github.com/llvm/llvm-project/commit/9c6b7f68b807250e7c3aa01938339fdbd239c4ea
DIFF: 
https://github.com/llvm/llvm-project/commit/9c6b7f68b807250e7c3aa01938339fdbd239c4ea.diff

LOG: Revert "[ARM][MVE] Add intrinsics for immediate shifts."
and two follow-on commits: one warning fix and one functionality.

As it's breaking at least the lto bot:

http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15132/steps/test-stage1-compiler/logs/stdio

This reverts commits:

 8d70f3c933a5b81a87a5ab1af0e3e98ee2cd7c67
 ff4dceef9201c5ae3924e92f6955977f243ac71d
 d97b3e3e65cd77a81b39732af84a1a4229e95091

Added: 


Modified: 
clang/include/clang/Basic/arm_mve.td
clang/include/clang/Basic/arm_mve_defs.td
clang/lib/CodeGen/CGBuiltin.cpp
clang/utils/TableGen/MveEmitter.cpp
llvm/include/llvm/IR/IntrinsicsARM.td
llvm/lib/Target/ARM/ARMInstrMVE.td

Removed: 
clang/test/CodeGen/arm-mve-intrinsics/vector-shift-imm.c
llvm/test/CodeGen/Thumb2/mve-intrinsics/vector-shift-imm.ll



diff  --git a/clang/include/clang/Basic/arm_mve.td 
b/clang/include/clang/Basic/arm_mve.td
index 426d3b5a2f44..f3d3f4124101 100644
--- a/clang/include/clang/Basic/arm_mve.td
+++ b/clang/include/clang/Basic/arm_mve.td
@@ -609,33 +609,6 @@ defm vstrhq: scatter_offset_both;
 defm vstrwq: scatter_offset_both;
 defm vstrdq: scatter_offset_both;
 
-multiclass PredicatedImmediateVectorShift<
-Immediate immtype, string predIntrName, list unsignedFlag = []> {
-  foreach predIntr = [IRInt] in {
-def _m_n: Intrinsic;
-def _x_n: Intrinsic;
-  }
-}
-
-let params = T.Int in {
-  def vshlq_n: Intrinsic;
-  defm vshlq: PredicatedImmediateVectorShift;
-
-  let pnt = PNT_NType in {
-def vshrq_n: Intrinsic;
-defm vshrq: PredicatedImmediateVectorShift;
-  }
-}
-
 // Base class for the scalar shift intrinsics.
 class ScalarShift:
   Intrinsic 
{

diff  --git a/clang/include/clang/Basic/arm_mve_defs.td 
b/clang/include/clang/Basic/arm_mve_defs.td
index 6bc9b35f0fc4..1d72cc45796c 100644
--- a/clang/include/clang/Basic/arm_mve_defs.td
+++ b/clang/include/clang/Basic/arm_mve_defs.td
@@ -66,10 +66,6 @@ def xor: IRBuilder<"CreateXor">;
 def sub: IRBuilder<"CreateSub">;
 def shl: IRBuilder<"CreateShl">;
 def lshr: IRBuilder<"CreateLShr">;
-def immshr: CGHelperFn<"MVEImmediateShr"> {
-  let special_params = [IRBuilderIntParam<1, "unsigned">,
-IRBuilderIntParam<2, "bool">];
-}
 def fadd: IRBuilder<"CreateFAdd">;
 def fmul: IRBuilder<"CreateFMul">;
 def fsub: IRBuilder<"CreateFSub">;
@@ -322,8 +318,8 @@ def imm_simd_vmvn : Immediate {
 //
 // imm_0toNm1 is the same but with the range offset by 1, i.e. 0 to N-1
 // inclusive.
-def imm_1toN : Immediate>;
-def imm_0toNm1 : Immediate>;
+def imm_1toN : Immediate>;
+def imm_0toNm1 : Immediate>;
 
 // imm_lane has to be the index of a vector lane in the main vector type, i.e
 // it can range from 0 to (128 / size of scalar)-1 inclusive. (e.g. vgetq_lane)

diff  --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 890019ac51c2..7447a5841599 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -6802,14 +6802,6 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned 
BuiltinID,
   }
 }
 
-template
-static Integer GetIntegerConstantValue(const Expr *E, ASTContext ) {
-  llvm::APSInt IntVal;
-  assert(E->isIntegerConstantExpr(IntVal, Context) &&
- "Sema should have checked this was a constant");
-  return IntVal.getExtValue();
-}
-
 static llvm::Value *SignOrZeroExtend(CGBuilderTy , llvm::Value *V,
  llvm::Type *T, bool Unsigned) {
   // Helper function called by Tablegen-constructed ARM MVE builtin codegen,
@@ -6817,27 +6809,6 @@ static llvm::Value *SignOrZeroExtend(CGBuilderTy 
, llvm::Value *V,
   return Unsigned ? Builder.CreateZExt(V, T) : Builder.CreateSExt(V, T);
 }
 
-static llvm::Value *MVEImmediateShr(CGBuilderTy , llvm::Value *V,
-uint32_t Shift, bool Unsigned) {
-  // MVE helper function for integer shift right. This must handle signed vs
-  // unsigned, and also deal specially with the case where the shift count is
-  // equal to the lane size. In LLVM IR, an LShr with that parameter would be
-  // undefined behavior, but in MVE it's legal, so we must convert it to code
-  // that is not undefined in IR.
-  unsigned LaneBits =
-  V->getType()->getVectorElementType()->getPrimitiveSizeInBits();
-  if (Shift == LaneBits) {
-// An unsigned shift of the full lane size always generates zero, so we can
-// simply emit a zero vector. A signed shift of the full lane size does the
-// same thing as shifting by one bit fewer.
-if (Unsigned)
-  return llvm::Constant::getNullValue(V->getType());
-

Re: [PATCH] D65410: [PassManager] First Pass implementation at -O1 pass pipeline

2019-11-25 Thread Eric Christopher via cfe-commits
Aha, found it in the revert. Bunch of tests use -O1 and probably have
something specific in O1 they wanted.

-eric

On Mon, Nov 25, 2019 at 8:55 PM Eric Christopher  wrote:
>
> Usually nice to give a link if there is one :)
>
> On Mon, Nov 25, 2019, 8:42 PM Muhammad Omair Javaid via Phabricator 
>  wrote:
>>
>> omjavaid reopened this revision.
>> omjavaid added a comment.
>> This revision is now accepted and ready to land.
>>
>> Re-opening this because I have reverted the commit due to failures seen on 
>> LLDB AArch64 buildbot with this commit.
>>
>>
>> Repository:
>>   rG LLVM Github Monorepo
>>
>> CHANGES SINCE LAST ACTION
>>   https://reviews.llvm.org/D65410/new/
>>
>> https://reviews.llvm.org/D65410
>>
>>
>>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D65410: [PassManager] First Pass implementation at -O1 pass pipeline

2019-11-25 Thread Eric Christopher via cfe-commits
Usually nice to give a link if there is one :)

On Mon, Nov 25, 2019, 8:42 PM Muhammad Omair Javaid via Phabricator <
revi...@reviews.llvm.org> wrote:

> omjavaid reopened this revision.
> omjavaid added a comment.
> This revision is now accepted and ready to land.
>
> Re-opening this because I have reverted the commit due to failures seen on
> LLDB AArch64 buildbot with this commit.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D65410/new/
>
> https://reviews.llvm.org/D65410
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 8ff85ed - As a follow-up to my initial mail to llvm-dev here's a first pass at the O1 described there.

2019-11-25 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-11-25T17:16:46-08:00
New Revision: 8ff85ed905a7306977d07a5cd67ab4d5a56fafb4

URL: 
https://github.com/llvm/llvm-project/commit/8ff85ed905a7306977d07a5cd67ab4d5a56fafb4
DIFF: 
https://github.com/llvm/llvm-project/commit/8ff85ed905a7306977d07a5cd67ab4d5a56fafb4.diff

LOG: As a follow-up to my initial mail to llvm-dev here's a first pass at the 
O1 described there.

This change doesn't include any change to move from selection dag to fast isel
and that will come with other numbers that should help inform that decision.
There also haven't been any real debuggability studies with this pipeline yet,
this is just the initial start done so that people could see it and we could 
start
tweaking after.

Test updates: Outside of the newpm tests most of the updates are coming from 
either
optimization passes not run anymore (and without a compelling argument at the 
moment)
that were largely used for canonicalization in clang.

Original post:

http://lists.llvm.org/pipermail/llvm-dev/2019-April/131494.html

Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65410

Added: 


Modified: 
clang/test/CodeGen/2008-07-30-implicit-initialization.c
clang/test/CodeGen/arm-fp16-arguments.c
clang/test/CodeGen/arm-vfp16-arguments2.cpp
clang/test/CodeGen/atomic-ops-libcall.c
clang/test/CodeGenCXX/atomicinit.cpp
clang/test/CodeGenCXX/auto-var-init.cpp
clang/test/CodeGenCXX/discard-name-values.cpp
clang/test/CodeGenCXX/microsoft-abi-dynamic-cast.cpp
clang/test/CodeGenCXX/microsoft-abi-typeid.cpp
clang/test/CodeGenCXX/nrvo.cpp
clang/test/CodeGenCXX/stack-reuse.cpp
clang/test/CodeGenCXX/wasm-args-returns.cpp
clang/test/CodeGenObjCXX/arc-blocks.mm
clang/test/CodeGenObjCXX/nrvo.mm
clang/test/Lexer/minimize_source_to_dependency_directives_invalid_error.c
clang/test/PCH/no-escaping-block-tail-calls.cpp
llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll
llvm/test/Feature/optnone-opt.ll
llvm/test/Other/new-pm-defaults.ll
llvm/test/Other/new-pm-thinlto-defaults.ll
llvm/test/Transforms/MemCpyOpt/lifetime.ll
llvm/test/Transforms/PhaseOrdering/simplifycfg-options.ll
llvm/test/Transforms/PhaseOrdering/two-shifts-by-sext.ll

Removed: 




diff  --git a/clang/test/CodeGen/2008-07-30-implicit-initialization.c 
b/clang/test/CodeGen/2008-07-30-implicit-initialization.c
index e77c70a140f9..f2621f4560ec 100644
--- a/clang/test/CodeGen/2008-07-30-implicit-initialization.c
+++ b/clang/test/CodeGen/2008-07-30-implicit-initialization.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -O1 -emit-llvm -o - %s | 
FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -O2 -emit-llvm -o - %s | 
FileCheck %s
 // CHECK-LABEL: define i32 @f0()
 // CHECK:   ret i32 0
 // CHECK-LABEL: define i32 @f1()

diff  --git a/clang/test/CodeGen/arm-fp16-arguments.c 
b/clang/test/CodeGen/arm-fp16-arguments.c
index d739f4b9c66a..34dc1a1cbf6a 100644
--- a/clang/test/CodeGen/arm-fp16-arguments.c
+++ b/clang/test/CodeGen/arm-fp16-arguments.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi 
soft -fallow-half-arguments-and-returns -emit-llvm -o - -O1 %s | FileCheck %s 
--check-prefix=CHECK --check-prefix=SOFT
-// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi 
hard -fallow-half-arguments-and-returns -emit-llvm -o - -O1 %s | FileCheck %s 
--check-prefix=CHECK --check-prefix=HARD
-// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi 
soft -fnative-half-arguments-and-returns -emit-llvm -o - -O1 %s | FileCheck %s 
--check-prefix=NATIVE
+// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi 
soft -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s 
--check-prefix=CHECK --check-prefix=SOFT
+// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi 
hard -fallow-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s 
--check-prefix=CHECK --check-prefix=HARD
+// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs -mfloat-abi 
soft -fnative-half-arguments-and-returns -emit-llvm -o - -O2 %s | FileCheck %s 
--check-prefix=NATIVE
 
 __fp16 g;
 

diff  --git a/clang/test/CodeGen/arm-vfp16-arguments2.cpp 
b/clang/test/CodeGen/arm-vfp16-arguments2.cpp
index 4f75971d8327..e436a5ecd6ab 100644
--- a/clang/test/CodeGen/arm-vfp16-arguments2.cpp
+++ b/clang/test/CodeGen/arm-vfp16-arguments2.cpp
@@ -1,12 +1,12 @@
 // RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs \
-// RUN:   -mfloat-abi soft -target-feature +neon -emit-llvm -o - -O1 %s \
+// RUN:   -mfloat-abi soft -target-feature +neon -emit-llvm -o - -O2 %s \
 // RUN:   | FileCheck %s 

[clang-tools-extra] e807569 - Fix an unused variable warning where a variable was only used in an assert.

2019-11-25 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-11-25T15:29:33-08:00
New Revision: e8075692589dc1274585bd7445f3e3b830b96c69

URL: 
https://github.com/llvm/llvm-project/commit/e8075692589dc1274585bd7445f3e3b830b96c69
DIFF: 
https://github.com/llvm/llvm-project/commit/e8075692589dc1274585bd7445f3e3b830b96c69.diff

LOG: Fix an unused variable warning where a variable was only used in an assert.

Added: 


Modified: 
clang-tools-extra/clangd/AST.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/AST.cpp 
b/clang-tools-extra/clangd/AST.cpp
index cd6a682007f2..e4d808921c01 100644
--- a/clang-tools-extra/clangd/AST.cpp
+++ b/clang-tools-extra/clangd/AST.cpp
@@ -457,8 +457,10 @@ std::string getQualification(ASTContext ,
  const DeclContext *DestContext,
  SourceLocation InsertionPoint, const NamedDecl 
*ND,
  llvm::ArrayRef VisibleNamespaces) {
-  for (llvm::StringRef NS : VisibleNamespaces)
+  for (llvm::StringRef NS : VisibleNamespaces) {
 assert(NS.endswith("::"));
+(void)NS;
+  }
   return getQualification(
   Context, DestContext, ND->getDeclContext(),
   [&](NestedNameSpecifier *NNS) {



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D70111: [DWARF5]Addition of alignment field in the typedef for dwarf5

2019-11-19 Thread Eric Christopher via cfe-commits
The C bindings, in general, don't have stability guarantees outside of
a few cases.

Whitequark owns all of this now though :)

-eric

On Tue, Nov 19, 2019 at 1:38 PM Adrian Prantl via Phabricator
 wrote:
>
> aprantl added a subscriber: echristo.
> aprantl added a comment.
>
> In D70111#1752215 , @dblaikie wrote:
>
> > I have some vague recollection that the DWARF C bindings didn't have 
> > stability guarantees? Does that sound familiar to anyone? What sort of 
> > changes have been made to them in the past?
>
>
> That does sound familiar. I'm not sure if this was formalized anywhere or if 
> we just all agreed on it verbally. @echristo might know?
>
> In that case there is a 3rd option which is to
>
> - update the C bindings and the go bindings in one commit.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D70111/new/
>
> https://reviews.llvm.org/D70111
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior

2019-11-18 Thread Eric Christopher via cfe-commits
No, it's just the bug that Jorge found. I understand it might have
highlighted an existing bug, but reverting back to clean is the best
bet here and then we can recommit when we get the latent bug fixed :)

On Mon, Nov 18, 2019 at 11:08 AM Melanie Blower via Phabricator
 wrote:
>
> mibintc added a comment.
>
> In D62731#1750312 , @echristo wrote:
>
> > In D62731#1749916 , @mibintc wrote:
> >
> > > Thanks I see it, I'm working on a patch. Previously there was no support 
> > > for frounding-math (unimplemented). This patch enables the option. In the 
> > > IR builder, there's a call to a runtime function in the exception handler 
> > > which is unexpectedly null.  I start by adding a null pointer check.
> >
> >
> > Had a crash on valid here for days, let's revert and then get a fix when 
> > recommitting. I'll respond to the thread when reverting. Thanks :)
>
>
> @echristo I just saw the bug was reported today, is the "crash on valid" 
> visible on the bots?  Can you provide url showing same? Thanks
> I opened https://bugs.llvm.org/show_bug.cgi?id=44048 for @jgorbe
>
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D62731/new/
>
> https://reviews.llvm.org/D62731
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior

2019-11-18 Thread Eric Christopher via cfe-commits
Hi All,

I've gone ahead and temporarily reverted here:

echristo@jhereg ~/s/llvm-project> git push
To github.com:llvm/llvm-project.git
   a77b66a0562..30e7ee3c4ba  master -> master

and we can just reapply when the issues are fixed. Thanks :)

-eric

On Mon, Nov 18, 2019 at 6:58 AM Melanie Blower via Phabricator via
cfe-commits  wrote:
>
> mibintc added a comment.
>
> Thanks I see it, I'm working on a patch. Previously there was no support for 
> frounding-math (unimplemented). This patch enables the option. In the IR 
> builder, there's a call to a runtime function in the exception handler which 
> is unexpectedly null.  I start by adding a null pointer check.
>
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D62731/new/
>
> https://reviews.llvm.org/D62731
>
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 30e7ee3 - Temporarily Revert "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="

2019-11-18 Thread Eric Christopher via cfe-commits

Author: Eric Christopher
Date: 2019-11-18T10:46:48-08:00
New Revision: 30e7ee3c4bac4a12ea584a879aa320bd4e035cc2

URL: 
https://github.com/llvm/llvm-project/commit/30e7ee3c4bac4a12ea584a879aa320bd4e035cc2
DIFF: 
https://github.com/llvm/llvm-project/commit/30e7ee3c4bac4a12ea584a879aa320bd4e035cc2.diff

LOG: Temporarily Revert "Add support for options -frounding-math, 
ftrapping-math, -ffp-model=, and -ffp-exception-behavior="
and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is 
on the original review thread.

This reverts commits af57dbf12e54f3a8ff48534bf1078f4de104c1cd and 
e6584b2b7b2de06f1e59aac41971760cac1e1b79

Added: 


Modified: 
clang/docs/UsersManual.rst
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Driver/clang_f_opts.c
clang/test/Driver/fast-math.c
llvm/include/llvm/IR/IRBuilder.h
llvm/include/llvm/IR/IntrinsicInst.h
llvm/include/llvm/Target/TargetOptions.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/IR/CMakeLists.txt
llvm/lib/IR/IntrinsicInst.cpp
llvm/unittests/IR/IRBuilderTest.cpp

Removed: 
clang/test/CodeGen/fpconstrained.c
clang/test/Driver/fp-model.c
llvm/include/llvm/IR/FPEnv.h
llvm/lib/IR/FPEnv.cpp



diff  --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index 62e2575c6b26..714681d7f4ce 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -1231,10 +1231,10 @@ are listed below.
 
 **-f[no-]trapping-math**
 
-   Control floating point exception behavior. ``-fno-trapping-math`` allows 
optimizations that assume that floating point operations cannot generate traps 
such as divide-by-zero, overflow and underflow.
-
-- The option ``-ftrapping-math`` behaves identically to 
``-ffp-exception-behavior=strict``.
-- The option ``-fno-trapping-math`` behaves identically to 
``-ffp-exception-behavior=ignore``.   This is the default.
+   ``-fno-trapping-math`` allows optimizations that assume that
+   floating point operations cannot generate traps such as divide-by-zero,
+   overflow and underflow. Defaults to ``-ftrapping-math``.
+   Currently this option has no effect.
 
 .. option:: -ffp-contract=
 
@@ -1319,52 +1319,6 @@ are listed below.
 
Defaults to ``-fno-finite-math``.
 
-.. _opt_frounding-math:
-
-**-f[no-]rounding-math**
-
-Force floating-point operations to honor the dynamically-set rounding mode by 
default.
-
-The result of a floating-point operation often cannot be exactly represented 
in the result type and therefore must be rounded.  IEEE 754 describes 
diff erent rounding modes that control how to perform this rounding, not all of 
which are supported by all implementations.  C provides interfaces 
(``fesetround`` and ``fesetenv``) for dynamically controlling the rounding 
mode, and while it also recommends certain conventions for changing the 
rounding mode, these conventions are not typically enforced in the ABI.  Since 
the rounding mode changes the numerical result of operations, the compiler must 
understand something about it in order to optimize floating point operations.
-
-Note that floating-point operations performed as part of constant 
initialization are formally performed prior to the start of the program and are 
therefore not subject to the current rounding mode.  This includes the 
initialization of global variables and local ``static`` variables.  
Floating-point operations in these contexts will be rounded using 
``FE_TONEAREST``.
-
-- The option ``-fno-rounding-math`` allows the compiler to assume that the 
rounding mode is set to ``FE_TONEAREST``.  This is the default.
-- The option ``-frounding-math`` forces the compiler to honor the 
dynamically-set rounding mode.  This prevents optimizations which might affect 
results if the rounding mode changes or is 
diff erent from the default; for example, it prevents floating-point operations 
from being reordered across most calls and prevents constant-folding when the 
result is not exactly representable.
-
-.. option:: -ffp-model=
-
-   Specify floating point behavior. ``-ffp-model`` is an umbrella
-   option that encompasses functionality provided by other, single
-   purpose, floating point options.  Valid values are: ``precise``, ``strict``,
-   and ``fast``.
-   Details:
-
-   * ``precise`` Disables optimizations that are not value-safe on 
floating-point data, although FP contraction (FMA) is enabled 
(``-ffp-contract=fast``).  This is the default behavior.
-   * ``strict`` Enables ``-frounding-math`` and 
``-ffp-exception-behavior=strict``, and disables contractions (FMA).  All of 
the ``-ffast-math`` enablements are 

Re: r374841 - [Modules][PCH] Hash input files content

2019-10-14 Thread Eric Christopher via cfe-commits
This was breaking a few bots and I couldn't find you on irc so I've
reverted it thusly:

echristo@jhereg ~/s/llvm-project> git llvm push
Pushing 1 commit:
  175b1b856ea Temporarily Revert [Modules][PCH] Hash input files
content as it's breaking a few bots.
Sendingcfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
Sendingcfe/trunk/include/clang/Driver/Options.td
Sendingcfe/trunk/include/clang/Lex/HeaderSearchOptions.h
Sendingcfe/trunk/include/clang/Serialization/ASTBitCodes.h
Sendingcfe/trunk/include/clang/Serialization/ASTReader.h
Sendingcfe/trunk/lib/Driver/ToolChains/Clang.cpp
Sendingcfe/trunk/lib/Frontend/CompilerInstance.cpp
Sendingcfe/trunk/lib/Frontend/CompilerInvocation.cpp
Sendingcfe/trunk/lib/Serialization/ASTReader.cpp
Sendingcfe/trunk/lib/Serialization/ASTWriter.cpp
Deleting   cfe/trunk/test/Modules/validate-file-content.m
Deleting   cfe/trunk/test/PCH/validate-file-content.m
Transmitting file data ..done
Committing transaction...
Committed revision 374842.
Committed 175b1b856ea to svn.

Sorry for the inconvenience!

-eric

On Mon, Oct 14, 2019 at 3:59 PM Bruno Cardoso Lopes via cfe-commits
 wrote:
>
> Author: bruno
> Date: Mon Oct 14 16:02:03 2019
> New Revision: 374841
>
> URL: http://llvm.org/viewvc/llvm-project?rev=374841=rev
> Log:
> [Modules][PCH] Hash input files content
>
> Summary:
> When files often get touched during builds, the mtime based validation
> leads to different problems in implicit modules builds, even when the
> content doesn't actually change:
>
> - Modules only: module invalidation due to out of date files. Usually causing 
> rebuild traffic.
> - Modules + PCH: build failures because clang cannot rebuild a module if it 
> comes from building a PCH.
> - PCH: build failures because clang cannot rebuild a PCH in case one of the 
> input headers has different mtime.
>
> This patch proposes hashing the content of input files (headers and
> module maps), which is performed during serialization time. When looking
> at input files for validation, clang only computes the hash in case
> there's a mtime mismatch.
>
> I've tested a couple of different hash algorithms availble in LLVM in
> face of building modules+pch for `#import `:
> - `hash_code`: performace diff within the noise, total module cache increased 
> by 0.07%.
> - `SHA1`: 5% slowdown. Haven't done real size measurements, but it'd be 
> BLOCK_ID+20 bytes per input file, instead of BLOCK_ID+8 bytes from 
> `hash_code`.
> - `MD5`: 3% slowdown. Like above, but BLOCK_ID+16 bytes per input file.
>
> Given the numbers above, the patch uses `hash_code`. The patch also
> improves invalidation error msgs to point out which type of problem the
> user is facing: "mtime", "size" or "content".
>
> rdar://problem/29320105
>
> Reviewers: dexonsmith, arphaman, rsmith, aprantl
>
> Subscribers: jkorous, cfe-commits, ributzka
>
> Tags: #clang
>
> Differential Revision: https://reviews.llvm.org/D67249
>
> Added:
> cfe/trunk/test/Modules/validate-file-content.m
> cfe/trunk/test/PCH/validate-file-content.m
> Modified:
> cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
> cfe/trunk/include/clang/Driver/Options.td
> cfe/trunk/include/clang/Lex/HeaderSearchOptions.h
> cfe/trunk/include/clang/Serialization/ASTBitCodes.h
> cfe/trunk/include/clang/Serialization/ASTReader.h
> cfe/trunk/lib/Driver/ToolChains/Clang.cpp
> cfe/trunk/lib/Frontend/CompilerInstance.cpp
> cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> cfe/trunk/lib/Serialization/ASTReader.cpp
> cfe/trunk/lib/Serialization/ASTWriter.cpp
>
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td?rev=374841=374840=374841=diff
> ==
> --- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Mon Oct 14 
> 16:02:03 2019
> @@ -18,13 +18,16 @@ def err_fe_pch_malformed : Error<
>  def err_fe_pch_malformed_block : Error<
>  "malformed block record in PCH file: '%0'">, DefaultFatal;
>  def err_fe_pch_file_modified : Error<
> -"file '%0' has been modified since the precompiled header '%1' was 
> built">,
> +"file '%0' has been modified since the precompiled header '%1' was built"
> +": %select{size|mtime|content}2 changed">,
>  DefaultFatal;
>  def err_fe_module_file_modified : Error<
> -"file '%0' has been modified since the module file '%1' was built">,
> +"file '%0' has been modified since the module file '%1' was built"
> +": %select{size|mtime|content}2 changed">,
>  DefaultFatal;
>  def err_fe_ast_file_modified : Error<
> -"file '%0' has been modified since the AST file '%1' was built">,
> +"file '%0' 

r374842 - Temporarily Revert [Modules][PCH] Hash input files content

2019-10-14 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Oct 14 16:14:24 2019
New Revision: 374842

URL: http://llvm.org/viewvc/llvm-project?rev=374842=rev
Log:
Temporarily Revert [Modules][PCH] Hash input files content
as it's breaking a few bots.

This reverts r374841 (git commit 2a1386c81de504b5bda44fbecf3f7b4cdfd748fc)

Removed:
cfe/trunk/test/Modules/validate-file-content.m
cfe/trunk/test/PCH/validate-file-content.m
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/include/clang/Lex/HeaderSearchOptions.h
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/lib/Frontend/CompilerInstance.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td?rev=374842=374841=374842=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSerializationKinds.td Mon Oct 14 
16:14:24 2019
@@ -18,16 +18,13 @@ def err_fe_pch_malformed : Error<
 def err_fe_pch_malformed_block : Error<
 "malformed block record in PCH file: '%0'">, DefaultFatal;
 def err_fe_pch_file_modified : Error<
-"file '%0' has been modified since the precompiled header '%1' was built"
-": %select{size|mtime|content}2 changed">,
+"file '%0' has been modified since the precompiled header '%1' was built">,
 DefaultFatal;
 def err_fe_module_file_modified : Error<
-"file '%0' has been modified since the module file '%1' was built"
-": %select{size|mtime|content}2 changed">,
+"file '%0' has been modified since the module file '%1' was built">,
 DefaultFatal;
 def err_fe_ast_file_modified : Error<
-"file '%0' has been modified since the AST file '%1' was built"
-": %select{size|mtime|content}2 changed">,
+"file '%0' has been modified since the AST file '%1' was built">,
 DefaultFatal;
 def err_fe_pch_file_overridden : Error<
 "file '%0' from the precompiled header has been overridden">;
@@ -402,8 +399,6 @@ def warn_module_uses_date_time : Warning
 def err_module_no_size_mtime_for_header : Error<
   "cannot emit module %0: %select{size|mtime}1 must be explicitly specified "
   "for missing header file \"%2\"">;
-def err_module_unable_to_hash_content : Error<
-  "failed to hash content for '%0' because memory buffer cannot be retrieved">;
 } // let CategoryName
 } // let Component
 

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=374842=374841=374842=diff
==
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Oct 14 16:14:24 2019
@@ -1368,28 +1368,6 @@ def fmodules_validate_system_headers : F
   HelpText<"Validate the system headers that a module depends on when loading 
the module">;
 def fno_modules_validate_system_headers : Flag<["-"], 
"fno-modules-validate-system-headers">,
   Group, Flags<[DriverOption]>;
-
-def fvalidate_ast_input_files_content:
-  Flag <["-"], "fvalidate-ast-input-files-content">,
-  Group, Flags<[CC1Option]>,
-  HelpText<"Compute and store the hash of input files used to build an AST."
-   " Files with mismatching mtime's are considered valid"
-   " if both contents is identical">;
-def fmodules_validate_input_files_content:
-  Flag <["-"], "fmodules-validate-input-files-content">,
-  Group, Flags<[DriverOption]>,
-  HelpText<"Validate PCM input files based on content if mtime differs">;
-def fno_modules_validate_input_files_content:
-  Flag <["-"], "fno_modules-validate-input-files-content">,
-  Group, Flags<[DriverOption]>;
-def fpch_validate_input_files_content:
-  Flag <["-"], "fpch-validate-input-files-content">,
-  Group, Flags<[DriverOption]>,
-  HelpText<"Validate PCH input files based on content if mtime differs">;
-def fno_pch_validate_input_files_content:
-  Flag <["-"], "fno_pch-validate-input-files-content">,
-  Group, Flags<[DriverOption]>;
-
 def fmodules : Flag <["-"], "fmodules">, Group,
   Flags<[DriverOption, CC1Option]>,
   HelpText<"Enable the 'modules' language feature">;

Modified: cfe/trunk/include/clang/Lex/HeaderSearchOptions.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/HeaderSearchOptions.h?rev=374842=374841=374842=diff
==
--- cfe/trunk/include/clang/Lex/HeaderSearchOptions.h (original)
+++ 

r374840 - Add -fno-experimental-pass-manager to make clear which pass manager

2019-10-14 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Oct 14 16:01:48 2019
New Revision: 374840

URL: http://llvm.org/viewvc/llvm-project?rev=374840=rev
Log:
Add -fno-experimental-pass-manager to make clear which pass manager
we're running and to make flipping the default not regress testing.

Modified:
cfe/trunk/test/Misc/loop-opt-setup.c

Modified: cfe/trunk/test/Misc/loop-opt-setup.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/loop-opt-setup.c?rev=374840=374839=374840=diff
==
--- cfe/trunk/test/Misc/loop-opt-setup.c (original)
+++ cfe/trunk/test/Misc/loop-opt-setup.c Mon Oct 14 16:01:48 2019
@@ -1,5 +1,5 @@
 // RUN: %clang -O1 -fexperimental-new-pass-manager -fno-unroll-loops -S -o - 
%s -emit-llvm | FileCheck %s
-// RUN: %clang -O1 -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
+// RUN: %clang -O1 -fno-experimental-new-pass-manager -fno-unroll-loops -S -o 
- %s -emit-llvm | FileCheck %s
 extern int a[16];
 int b = 0;
 int foo(void) {


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D68535: Fix loop unrolling initialization in the new pass manager

2019-10-14 Thread Eric Christopher via cfe-commits
Thanks for the text - I didn't have anything to add or change so I
just used it verbatim :)

Committed thusly:

Committed revision 374838.
Committed f64329154c3 to svn.

On Mon, Oct 7, 2019 at 9:36 AM Alina Sbirlea via Phabricator
 wrote:
>
> asbirlea added a comment.
>
> Maybe elaborate in the patch description what `determine when and how we will 
> unroll loops.` means?
> e.g.:
> "The default before and after this patch is for LoopUnroll to be enabled, and 
> for it to use a cost model to determine whether to unroll the loop 
> (`OnlyWhenForced = false`). Before this patch, disabling loop unroll would 
> not run the LoopUnroll pass. After this patch, the LoopUnroll pass is being 
> run, but it restricts unrolling to only the loops marked by a pragma 
> (`OnlyWhenForced = true`).
> In addition, this patch disables the UnrollAndJam pass when disabling 
> unrolling."
>
> Otherwise LGTM.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D68535/new/
>
> https://reviews.llvm.org/D68535
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r374838 - In the new pass manager use PTO.LoopUnrolling to determine when and how

2019-10-14 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Oct 14 15:56:07 2019
New Revision: 374838

URL: http://llvm.org/viewvc/llvm-project?rev=374838=rev
Log:
In the new pass manager use PTO.LoopUnrolling to determine when and how
we will unroll loops. Also comment a few occasions where we need to
know whether or not we're forcing the unwinder or not.

The default before and after this patch is for LoopUnroll to be enabled,
and for it to use a cost model to determine whether to unroll the loop
(`OnlyWhenForced = false`). Before this patch, disabling loop unroll
would not run the LoopUnroll pass. After this patch, the LoopUnroll pass
is being run, but it restricts unrolling to only the loops marked by a
pragma (`OnlyWhenForced = true`).

In addition, this patch disables the UnrollAndJam pass when disabling unrolling.

Testcase is in clang because it's controlling how the loop optimizer
is being set up and there's no other way to trigger the behavior.

Added:
cfe/trunk/test/Misc/loop-opt-setup.c

Added: cfe/trunk/test/Misc/loop-opt-setup.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/loop-opt-setup.c?rev=374838=auto
==
--- cfe/trunk/test/Misc/loop-opt-setup.c (added)
+++ cfe/trunk/test/Misc/loop-opt-setup.c Mon Oct 14 15:56:07 2019
@@ -0,0 +1,12 @@
+// RUN: %clang -O1 -fexperimental-new-pass-manager -fno-unroll-loops -S -o - 
%s -emit-llvm | FileCheck %s
+// RUN: %clang -O1 -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
+extern int a[16];
+int b = 0;
+int foo(void) {
+#pragma unroll
+  for (int i = 0; i < 16; ++i)
+a[i] = b += 2;
+  return b;
+}
+// CHECK-NOT: br i1
+


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D67216: [cfi] Add flag to always generate call frame information

2019-09-24 Thread Eric Christopher via cfe-commits
That said, prior art in gcc in this area:

-fasynchronous-unwind-tables

Generate unwind table in DWARF format, if supported by target machine.
The table is exact at each instruction boundary, so it can be used for
stack unwinding from asynchronous events (such as debugger or garbage
collector).

-eric

On Tue, Sep 24, 2019 at 8:43 AM Keith Walker via Phabricator
 wrote:
>
> keith.walker.arm added a comment.
>
> I feel that using a -g option make more sense.
>
> Maybe -gdwarf-frame, or -gdwarf-frame-always might be more user friendly as 
> it relates more to the DWARF section created rather than the section content.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D67216/new/
>
> https://reviews.llvm.org/D67216
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r366076 - fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic

2019-07-15 Thread Eric Christopher via cfe-commits
I'm going to cheat and make Nick do it :)

-eric

On Mon, Jul 15, 2019 at 5:12 PM Yonghong Song  wrote:
>
> HI, Eric,
>
> No problem!
>
> I just tried the following cmake (removing -DLLVM_ENABLE_ASSERTIONS=ON which 
> is used in my previous build)
>
> cmake -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
> -DCMAKE_C_COMPILER=/llvm8/bin/clang \
> -DCMAKE_CXX_COMPILER=/llvm8/bin/clang++ \
> -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON
> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install ..
>
> and cannot reproduce the issue. If you could send me the cmake
> command line which caused failure in your environment. That will
> be great!
>
> Thanks,
>
> Yonghong
>
> On 7/15/19, 4:50 PM, "Eric Christopher"  wrote:
>
> Just wanted to let you know I've temporarily reverted this here:
>
> echristo@jhereg ~/s/llvm-project> git llvm push
> Pushing 1 commit:
>   ba7decf8c91 Temporarily Revert "fix unnamed fiefield issue and add
> tests for __builtin_preserve_access_index intrinsic"
> Sendingcfe/trunk/lib/CodeGen/CGExpr.cpp
> Sendingcfe/trunk/lib/CodeGen/CodeGenFunction.h
> Deleting   cfe/trunk/test/CodeGen/builtin-preserve-access-index.c
> Deleting   cfe/trunk/test/Sema/builtin-preserve-access-index.c
> Transmitting file data ..done
> Committing transaction...
> Committed revision 366155.
> Committed ba7decf8c91 to svn.
>
> Since the testcase was causing problems in non-assert builds. Feel
> free to recommit when you fix that :)
>
> Thanks!
>
> -eric
>
> On Mon, Jul 15, 2019 at 8:42 AM Yonghong Song via cfe-commits
>  wrote:
> >
> > Author: yhs
> > Date: Mon Jul 15 08:42:41 2019
> > New Revision: 366076
> >
> > URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D366076-26view-3Drev=DwIBaQ=5VD0RTtNlTh3ycd41b3MUw=DA8e1B5r073vIqRrFz7MRA=dtjPkUWyM2j7LOCdes9xK0tSCe4BrvYtJpmJu_el7xE=LyV9cu6egVjs0MILQtMXrDRw1r2afyEdzsh_tKDRsQE=
> > Log:
> > fix unnamed fiefield issue and add tests for 
> __builtin_preserve_access_index intrinsic
> >
> > This is a followup patch for 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D61809=DwIBaQ=5VD0RTtNlTh3ycd41b3MUw=DA8e1B5r073vIqRrFz7MRA=dtjPkUWyM2j7LOCdes9xK0tSCe4BrvYtJpmJu_el7xE=zdwdBj89w175wBRDiJ8ts1YTR7VrNyt4IHp-29y6b8E=
>  .
> > Handle unnamed bitfield properly and add more test cases.
> >
> > Fixed the unnamed bitfield issue. The unnamed bitfield is ignored
> > by debug info, so we need to ignore such a struct/union member
> > when we try to get the member index in the debug info.
> >
> > D61809 contains two test cases but not enough as it does
> > not checking generated IRs in the fine grain level, and also
> > it does not have semantics checking tests.
> > This patch added unit tests for both code gen and semantics checking for
> > the new intrinsic.
> >
> > Signed-off-by: Yonghong Song 
> >
> > Added:
> > cfe/trunk/test/CodeGen/builtin-preserve-access-index.c
> > cfe/trunk/test/Sema/builtin-preserve-access-index.c
> > Modified:
> > cfe/trunk/lib/CodeGen/CGExpr.cpp
> > cfe/trunk/lib/CodeGen/CodeGenFunction.h
> >
> > Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
> > URL: 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_CodeGen_CGExpr.cpp-3Frev-3D366076-26r1-3D366075-26r2-3D366076-26view-3Ddiff=DwIBaQ=5VD0RTtNlTh3ycd41b3MUw=DA8e1B5r073vIqRrFz7MRA=dtjPkUWyM2j7LOCdes9xK0tSCe4BrvYtJpmJu_el7xE=wNn-0ZBP1UL0gaIGHoTeMMTdnpNcjwneAK5I8Y8AaJY=
> > 
> ==
> > --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
> > +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Jul 15 08:42:41 2019
> > @@ -3892,6 +3892,23 @@ LValue CodeGenFunction::EmitLValueForLam
> >return EmitLValueForField(LambdaLV, Field);
> >  }
> >
> > +/// Get the field index in the debug info. The debug info 
> structure/union
> > +/// will ignore the unnamed bitfields.
> > +unsigned CodeGenFunction::getDebugInfoFIndex(const RecordDecl *Rec,
> > + unsigned FieldIndex) {
> > +  unsigned I = 0, Skipped = 0;
> > +
> > +  for (auto F : Rec->getDefinition()->fields()) {
> > +if (I == FieldIndex)
> > +  break;
> > +if (F->isUnnamedBitfield())
> > +  Skipped++;
> > +I++;
> > +  }
> > +
> > +  return FieldIndex - Skipped;
> > +}
> > +
> >  /// Get the address of a zero-sized field within a record. The 
> resulting
> >  /// address doesn't necessarily have the right type.
> >  static Address emitAddrOfZeroSizeField(CodeGenFunction , Address 
> Base,
> > @@ -3931,7 +3948,7 @@ static Address 

Re: r366146 - add -fthinlto-index= option to clang-cl

2019-07-15 Thread Eric Christopher via cfe-commits
Hi Bob,

I've temporarily reverted this here:

echristo@jhereg ~/s/llvm-project> git llvm push
Pushing 1 commit:
  1dbd2f85903 Temporarily revert "add -fthinlto-index= option to clang-cl"
Sendingcfe/trunk/include/clang/Driver/Options.td
Deleting   cfe/trunk/test/Driver/cl-thinlto-backend.c
Transmitting file data .done
Committing transaction...
Committed revision 366157.
Committed 1dbd2f85903 to svn.

as I was seeing testsuite failures on darwin release+asserts with the
patch. Let's follow up offline if you can't duplicate.

Thanks!

-eric

On Mon, Jul 15, 2019 at 3:49 PM Bob Haarman via cfe-commits
 wrote:
>
> Author: inglorion
> Date: Mon Jul 15 15:50:04 2019
> New Revision: 366146
>
> URL: http://llvm.org/viewvc/llvm-project?rev=366146=rev
> Log:
> add -fthinlto-index= option to clang-cl
>
> Summary:
> This adds a -fthinlto-index= option to clang-cl, which allows it to
> be used to drive ThinLTO backend passes. This allows clang-cl to be
> used for distributed ThinLTO.
>
> Reviewers: tejohnson, pcc, rnk
>
> Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, cfe-commits
>
> Tags: #clang
>
> Differential Revision: https://reviews.llvm.org/D64458
>
> Added:
> cfe/trunk/test/Driver/cl-thinlto-backend.c
> Modified:
> cfe/trunk/include/clang/Driver/Options.td
>
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=366146=366145=366146=diff
> ==
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Mon Jul 15 15:50:04 2019
> @@ -1270,7 +1270,7 @@ def flto_jobs_EQ : Joined<["-"], "flto-j
> "of 0 means the number of threads will be derived from "
> "the number of CPUs detected)">;
>  def fthinlto_index_EQ : Joined<["-"], "fthinlto-index=">,
> -  Flags<[CC1Option]>, Group,
> +  Flags<[CoreOption, CC1Option]>, Group,
>HelpText<"Perform ThinLTO importing using provided function summary 
> index">;
>  def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
>  Group, Flags<[DriverOption, 
> CoreOption]>;
>
> Added: cfe/trunk/test/Driver/cl-thinlto-backend.c
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-thinlto-backend.c?rev=366146=auto
> ==
> --- cfe/trunk/test/Driver/cl-thinlto-backend.c (added)
> +++ cfe/trunk/test/Driver/cl-thinlto-backend.c Mon Jul 15 15:50:04 2019
> @@ -0,0 +1,9 @@
> +// RUN: %clang_cl -c -flto=thin -Fo%t.obj %s
> +// RUN: llvm-lto2 run -thinlto-distributed-indexes -o %t.exe %t.obj
> +
> +// -fthinlto_index should be passed to cc1
> +// RUN: %clang_cl -### -c -fthinlto-index=%t.thinlto.bc -Fo%t1.obj \
> +// RUN: %t.obj 2>&1 | FileCheck %s
> +
> +// CHECK: -fthinlto-index=
> +// CHECK: "-x" "ir"
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r366157 - Temporarily revert "add -fthinlto-index= option to clang-cl"

2019-07-15 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Jul 15 17:02:40 2019
New Revision: 366157

URL: http://llvm.org/viewvc/llvm-project?rev=366157=rev
Log:
Temporarily revert "add -fthinlto-index= option to clang-cl"

This is causing testsuite failures on (at least) darwin release+asserts.

This reverts commit r366146.

Removed:
cfe/trunk/test/Driver/cl-thinlto-backend.c
Modified:
cfe/trunk/include/clang/Driver/Options.td

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=366157=366156=366157=diff
==
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Jul 15 17:02:40 2019
@@ -1270,7 +1270,7 @@ def flto_jobs_EQ : Joined<["-"], "flto-j
"of 0 means the number of threads will be derived from "
"the number of CPUs detected)">;
 def fthinlto_index_EQ : Joined<["-"], "fthinlto-index=">,
-  Flags<[CoreOption, CC1Option]>, Group,
+  Flags<[CC1Option]>, Group,
   HelpText<"Perform ThinLTO importing using provided function summary index">;
 def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
 Group, Flags<[DriverOption, 
CoreOption]>;

Removed: cfe/trunk/test/Driver/cl-thinlto-backend.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-thinlto-backend.c?rev=366156=auto
==
--- cfe/trunk/test/Driver/cl-thinlto-backend.c (original)
+++ cfe/trunk/test/Driver/cl-thinlto-backend.c (removed)
@@ -1,9 +0,0 @@
-// RUN: %clang_cl -c -flto=thin -Fo%t.obj %s
-// RUN: llvm-lto2 run -thinlto-distributed-indexes -o %t.exe %t.obj
-
-// -fthinlto_index should be passed to cc1
-// RUN: %clang_cl -### -c -fthinlto-index=%t.thinlto.bc -Fo%t1.obj \
-// RUN: %t.obj 2>&1 | FileCheck %s
-
-// CHECK: -fthinlto-index=
-// CHECK: "-x" "ir"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r366076 - fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic

2019-07-15 Thread Eric Christopher via cfe-commits
Just wanted to let you know I've temporarily reverted this here:

echristo@jhereg ~/s/llvm-project> git llvm push
Pushing 1 commit:
  ba7decf8c91 Temporarily Revert "fix unnamed fiefield issue and add
tests for __builtin_preserve_access_index intrinsic"
Sendingcfe/trunk/lib/CodeGen/CGExpr.cpp
Sendingcfe/trunk/lib/CodeGen/CodeGenFunction.h
Deleting   cfe/trunk/test/CodeGen/builtin-preserve-access-index.c
Deleting   cfe/trunk/test/Sema/builtin-preserve-access-index.c
Transmitting file data ..done
Committing transaction...
Committed revision 366155.
Committed ba7decf8c91 to svn.

Since the testcase was causing problems in non-assert builds. Feel
free to recommit when you fix that :)

Thanks!

-eric

On Mon, Jul 15, 2019 at 8:42 AM Yonghong Song via cfe-commits
 wrote:
>
> Author: yhs
> Date: Mon Jul 15 08:42:41 2019
> New Revision: 366076
>
> URL: http://llvm.org/viewvc/llvm-project?rev=366076=rev
> Log:
> fix unnamed fiefield issue and add tests for __builtin_preserve_access_index 
> intrinsic
>
> This is a followup patch for https://reviews.llvm.org/D61809.
> Handle unnamed bitfield properly and add more test cases.
>
> Fixed the unnamed bitfield issue. The unnamed bitfield is ignored
> by debug info, so we need to ignore such a struct/union member
> when we try to get the member index in the debug info.
>
> D61809 contains two test cases but not enough as it does
> not checking generated IRs in the fine grain level, and also
> it does not have semantics checking tests.
> This patch added unit tests for both code gen and semantics checking for
> the new intrinsic.
>
> Signed-off-by: Yonghong Song 
>
> Added:
> cfe/trunk/test/CodeGen/builtin-preserve-access-index.c
> cfe/trunk/test/Sema/builtin-preserve-access-index.c
> Modified:
> cfe/trunk/lib/CodeGen/CGExpr.cpp
> cfe/trunk/lib/CodeGen/CodeGenFunction.h
>
> Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=366076=366075=366076=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Jul 15 08:42:41 2019
> @@ -3892,6 +3892,23 @@ LValue CodeGenFunction::EmitLValueForLam
>return EmitLValueForField(LambdaLV, Field);
>  }
>
> +/// Get the field index in the debug info. The debug info structure/union
> +/// will ignore the unnamed bitfields.
> +unsigned CodeGenFunction::getDebugInfoFIndex(const RecordDecl *Rec,
> + unsigned FieldIndex) {
> +  unsigned I = 0, Skipped = 0;
> +
> +  for (auto F : Rec->getDefinition()->fields()) {
> +if (I == FieldIndex)
> +  break;
> +if (F->isUnnamedBitfield())
> +  Skipped++;
> +I++;
> +  }
> +
> +  return FieldIndex - Skipped;
> +}
> +
>  /// Get the address of a zero-sized field within a record. The resulting
>  /// address doesn't necessarily have the right type.
>  static Address emitAddrOfZeroSizeField(CodeGenFunction , Address Base,
> @@ -3931,7 +3948,7 @@ static Address emitPreserveStructAccess(
>CGF.CGM.getTypes().getCGRecordLayout(rec).getLLVMFieldNo(field);
>
>return CGF.Builder.CreatePreserveStructAccessIndex(
> -  base, idx, field->getFieldIndex(), DbgInfo);
> +  base, idx, CGF.getDebugInfoFIndex(rec, field->getFieldIndex()), 
> DbgInfo);
>  }
>
>  static bool hasAnyVptr(const QualType Type, const ASTContext ) {
> @@ -4048,7 +4065,7 @@ LValue CodeGenFunction::EmitLValueForFie
>getContext().getRecordType(rec), rec->getLocation());
>addr = Address(
>Builder.CreatePreserveUnionAccessIndex(
> -  addr.getPointer(), field->getFieldIndex(), DbgInfo),
> +  addr.getPointer(), getDebugInfoFIndex(rec, 
> field->getFieldIndex()), DbgInfo),
>addr.getAlignment());
>  }
>} else {
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=366076=366075=366076=diff
> ==
> --- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Mon Jul 15 08:42:41 2019
> @@ -2652,6 +2652,9 @@ public:
>/// Converts Location to a DebugLoc, if debug information is enabled.
>llvm::DebugLoc SourceLocToDebugLoc(SourceLocation Location);
>
> +  /// Get the record field index as represented in debug info.
> +  unsigned getDebugInfoFIndex(const RecordDecl *Rec, unsigned FieldIndex);
> +
>
>
> //======//
>//Declaration Emission
>
> Added: cfe/trunk/test/CodeGen/builtin-preserve-access-index.c
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-preserve-access-index.c?rev=366076=auto
> 

r366155 - Temporarily Revert "fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic"

2019-07-15 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Jul 15 16:49:31 2019
New Revision: 366155

URL: http://llvm.org/viewvc/llvm-project?rev=366155=rev
Log:
Temporarily Revert "fix unnamed fiefield issue and add tests for 
__builtin_preserve_access_index intrinsic"

The commit had tests that would only work with names in the IR.

This reverts commit r366076.

Removed:
cfe/trunk/test/CodeGen/builtin-preserve-access-index.c
cfe/trunk/test/Sema/builtin-preserve-access-index.c
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=366155=366154=366155=diff
==
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Jul 15 16:49:31 2019
@@ -3892,23 +3892,6 @@ LValue CodeGenFunction::EmitLValueForLam
   return EmitLValueForField(LambdaLV, Field);
 }
 
-/// Get the field index in the debug info. The debug info structure/union
-/// will ignore the unnamed bitfields.
-unsigned CodeGenFunction::getDebugInfoFIndex(const RecordDecl *Rec,
- unsigned FieldIndex) {
-  unsigned I = 0, Skipped = 0;
-
-  for (auto F : Rec->getDefinition()->fields()) {
-if (I == FieldIndex)
-  break;
-if (F->isUnnamedBitfield())
-  Skipped++;
-I++;
-  }
-
-  return FieldIndex - Skipped;
-}
-
 /// Get the address of a zero-sized field within a record. The resulting
 /// address doesn't necessarily have the right type.
 static Address emitAddrOfZeroSizeField(CodeGenFunction , Address Base,
@@ -3948,7 +3931,7 @@ static Address emitPreserveStructAccess(
   CGF.CGM.getTypes().getCGRecordLayout(rec).getLLVMFieldNo(field);
 
   return CGF.Builder.CreatePreserveStructAccessIndex(
-  base, idx, CGF.getDebugInfoFIndex(rec, field->getFieldIndex()), DbgInfo);
+  base, idx, field->getFieldIndex(), DbgInfo);
 }
 
 static bool hasAnyVptr(const QualType Type, const ASTContext ) {
@@ -4065,7 +4048,7 @@ LValue CodeGenFunction::EmitLValueForFie
   getContext().getRecordType(rec), rec->getLocation());
   addr = Address(
   Builder.CreatePreserveUnionAccessIndex(
-  addr.getPointer(), getDebugInfoFIndex(rec, 
field->getFieldIndex()), DbgInfo),
+  addr.getPointer(), field->getFieldIndex(), DbgInfo),
   addr.getAlignment());
 }
   } else {

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=366155=366154=366155=diff
==
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Mon Jul 15 16:49:31 2019
@@ -2652,9 +2652,6 @@ public:
   /// Converts Location to a DebugLoc, if debug information is enabled.
   llvm::DebugLoc SourceLocToDebugLoc(SourceLocation Location);
 
-  /// Get the record field index as represented in debug info.
-  unsigned getDebugInfoFIndex(const RecordDecl *Rec, unsigned FieldIndex);
-
 
   
//======//
   //Declaration Emission

Removed: cfe/trunk/test/CodeGen/builtin-preserve-access-index.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-preserve-access-index.c?rev=366154=auto
==
--- cfe/trunk/test/CodeGen/builtin-preserve-access-index.c (original)
+++ cfe/trunk/test/CodeGen/builtin-preserve-access-index.c (removed)
@@ -1,177 +0,0 @@
-// RUN: %clang -target x86_64 -emit-llvm -S -g %s -o - | FileCheck %s
-
-#define _(x) (__builtin_preserve_access_index(x))
-
-const void *unit1(const void *arg) {
-  return _(arg);
-}
-// CHECK: define dso_local i8* @unit1(i8* %arg)
-// CHECK-NOT: llvm.preserve.array.access.index
-// CHECK-NOT: llvm.preserve.struct.access.index
-// CHECK-NOT: llvm.preserve.union.access.index
-
-const void *unit2(void) {
-  return _((const void *)0xULL);
-}
-// CHECK: define dso_local i8* @unit2()
-// CHECK-NOT: llvm.preserve.array.access.index
-// CHECK-NOT: llvm.preserve.struct.access.index
-// CHECK-NOT: llvm.preserve.union.access.index
-
-const void *unit3(const int *arg) {
-  return _(arg + 1);
-}
-// CHECK: define dso_local i8* @unit3(i32* %arg)
-// CHECK-NOT: llvm.preserve.array.access.index
-// CHECK-NOT: llvm.preserve.struct.access.index
-// CHECK-NOT: llvm.preserve.union.access.index
-
-const void *unit4(const int *arg) {
-  return _([1]);
-}
-// CHECK: define dso_local i8* @unit4(i32* %arg)
-// CHECK-NOT: getelementptr
-// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %0, i32 
0, i32 1)
-
-const void *unit5(const int *arg[5]) {
-  return _([1][2]);
-}
-// CHECK: define dso_local i8* @unit5(i32** %arg)
-// CHECK-NOT: 

r362462 - Remove test/CodeGen/builtin-stackaddress.c as it duplicates

2019-06-03 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Jun  3 16:16:06 2019
New Revision: 362462

URL: http://llvm.org/viewvc/llvm-project?rev=362462=rev
Log:
Remove test/CodeGen/builtin-stackaddress.c as it duplicates
test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c.

Differential Revision: https://reviews.llvm.org/D62133

Removed:
cfe/trunk/test/CodeGen/builtin-stackaddress.c

Removed: cfe/trunk/test/CodeGen/builtin-stackaddress.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-stackaddress.c?rev=362461=auto
==
--- cfe/trunk/test/CodeGen/builtin-stackaddress.c (original)
+++ cfe/trunk/test/CodeGen/builtin-stackaddress.c (removed)
@@ -1,9 +0,0 @@
-// RUN: %clang_cc1 -emit-llvm < %s | grep "llvm.returnaddress"
-// RUN: %clang_cc1 -emit-llvm < %s | grep "llvm.frameaddress"
-void* a(unsigned x) {
-return __builtin_return_address(0);
-}
-
-void* c(unsigned x) {
-return __builtin_frame_address(0);
-}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D62133: test/CodeGen/builtin-stackaddress.c duplicates test/CodeGen/2004-02-13-BuiltinFrameReturnAddress.c

2019-06-03 Thread Eric Christopher via cfe-commits
Will do.

On Sun, Jun 2, 2019 at 5:43 AM A. Skrobov via Phabricator
 wrote:
>
> t.yomitch added a comment.
>
> Thanks Eric!
> I don't have commit access; could someone please commit this for me?
>
>
> Repository:
>   rC Clang
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D62133/new/
>
> https://reviews.llvm.org/D62133
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r360403 - Change -gz and -Wa, --compress-debug-sections to use gABI compression (SHF_COMPRESSED)

2019-05-14 Thread Eric Christopher via cfe-commits
Hi Ray,

I've temporarily reverted this here:

echristo@jhereg ~/s/llvm-project> git llvm push
Pushing 1 commit:
  fda79815a33 Temporarily revert "Change -gz and
-Wa,--compress-debug-sections to use gABI compression
(SHF_COMPRESSED)"
Sendingcfe/trunk/docs/ReleaseNotes.rst
Sendingcfe/trunk/lib/Frontend/CompilerInvocation.cpp
Sendingcfe/trunk/tools/driver/cc1as_main.cpp
Transmitting file data ...done
Committing transaction...
Committed revision 360703.
Committed fda79815a33 to svn.

From my message:

This affects users of older (pre 2.26) binutils in such a way that
they can't necessarily
work around it as it doesn't support the compress option on the
command line. Reverting
to unblock them and we can revisit whether to make this change now
or fix how we want
to express the option.

I'm not sure what we want to do here, but wanted to unblock people in
the meantime. What do you think?

Thanks!

-eric


On Thu, May 9, 2019 at 7:05 PM Fangrui Song via cfe-commits
 wrote:
>
> Author: maskray
> Date: Thu May  9 19:08:21 2019
> New Revision: 360403
>
> URL: http://llvm.org/viewvc/llvm-project?rev=360403=rev
> Log:
> Change -gz and -Wa,--compress-debug-sections to use gABI compression 
> (SHF_COMPRESSED)
>
> Since July 15, 2015 (binutils-gdb commit
> 19a7fe52ae3d0971e67a134bcb1648899e21ae1c, included in 2.26), gas
> --compress-debug-sections=zlib (gcc -gz) means zlib-gabi:
> SHF_COMPRESSED. Before that it meant zlib-gnu (.zdebug).
>
> clang's -gz was introduced in rC306115 (Jun 2017) to indicate zlib-gnu. It
> is 2019 now and it is not unreasonable to assume users of the new
> feature to have new linkers (ld.bfd/gold >= 2.26, lld >= rLLD273661).
>
> Change clang's default accordingly to improve standard conformance.
> zlib-gnu becomes out of fashion and gets poorer toolchain support.
> Its mangled names confuse tools and are more likely to cause problems.
>
> Reviewed By: compnerd
>
> Differential Revision: https://reviews.llvm.org/D61689
>
> Modified:
> cfe/trunk/docs/ReleaseNotes.rst
> cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> cfe/trunk/tools/driver/cc1as_main.cpp
>
> Modified: cfe/trunk/docs/ReleaseNotes.rst
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=360403=360402=360403=diff
> ==
> --- cfe/trunk/docs/ReleaseNotes.rst (original)
> +++ cfe/trunk/docs/ReleaseNotes.rst Thu May  9 19:08:21 2019
> @@ -77,7 +77,10 @@ Modified Compiler Flags
>
>  - `clang -dumpversion` now returns the version of Clang itself.
>
> -- ...
> +- On ELF, ``-gz`` now defaults to ``-gz=zlib``. It produces 
> ``SHF_COMPRESSED``
> +  style compression of debug information. GNU binutils 2.26 or newer, or lld 
> is
> +  required to link produced object files. Use ``-gz=zlib-gnu`` to get the old
> +  behavior.
>
>  New Pragmas in Clang
>  
>
> Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=360403=360402=360403=diff
> ==
> --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
> +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu May  9 19:08:21 2019
> @@ -1052,8 +1052,7 @@ static bool ParseCodeGenArgs(CodeGenOpti
>if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,
>   OPT_compress_debug_sections_EQ)) {
>  if (A->getOption().getID() == OPT_compress_debug_sections) {
> -  // TODO: be more clever about the compression type auto-detection
> -  Opts.setCompressDebugSections(llvm::DebugCompressionType::GNU);
> +  Opts.setCompressDebugSections(llvm::DebugCompressionType::Z);
>  } else {
>auto DCT = 
> llvm::StringSwitch(A->getValue())
>   .Case("none", llvm::DebugCompressionType::None)
>
> Modified: cfe/trunk/tools/driver/cc1as_main.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=360403=360402=360403=diff
> ==
> --- cfe/trunk/tools/driver/cc1as_main.cpp (original)
> +++ cfe/trunk/tools/driver/cc1as_main.cpp Thu May  9 19:08:21 2019
> @@ -221,8 +221,7 @@ bool AssemblerInvocation::CreateFromArgs
>if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,
>   OPT_compress_debug_sections_EQ)) {
>  if (A->getOption().getID() == OPT_compress_debug_sections) {
> -  // TODO: be more clever about the compression type auto-detection
> -  Opts.CompressDebugSections = llvm::DebugCompressionType::GNU;
> +  Opts.CompressDebugSections = llvm::DebugCompressionType::Z;
>  } else {
>Opts.CompressDebugSections =
>llvm::StringSwitch(A->getValue())
>
>
> 

r360703 - Temporarily revert "Change -gz and -Wa, --compress-debug-sections to use gABI compression (SHF_COMPRESSED)"

2019-05-14 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Tue May 14 12:40:42 2019
New Revision: 360703

URL: http://llvm.org/viewvc/llvm-project?rev=360703=rev
Log:
Temporarily revert "Change -gz and -Wa,--compress-debug-sections to use gABI 
compression (SHF_COMPRESSED)"

This affects users of older (pre 2.26) binutils in such a way that they can't 
necessarily
work around it as it doesn't support the compress option on the command line. 
Reverting
to unblock them and we can revisit whether to make this change now or fix how 
we want
to express the option.

This reverts commit bdb21337e6e1732c9895966449c33c408336d295/r360403.

Modified:
cfe/trunk/docs/ReleaseNotes.rst
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/tools/driver/cc1as_main.cpp

Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=360703=360702=360703=diff
==
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Tue May 14 12:40:42 2019
@@ -77,10 +77,7 @@ Modified Compiler Flags
 
 - `clang -dumpversion` now returns the version of Clang itself.
 
-- On ELF, ``-gz`` now defaults to ``-gz=zlib``. It produces ``SHF_COMPRESSED``
-  style compression of debug information. GNU binutils 2.26 or newer, or lld is
-  required to link produced object files. Use ``-gz=zlib-gnu`` to get the old
-  behavior.
+- ...
 
 New Pragmas in Clang
 

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=360703=360702=360703=diff
==
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue May 14 12:40:42 2019
@@ -1052,7 +1052,8 @@ static bool ParseCodeGenArgs(CodeGenOpti
   if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,
  OPT_compress_debug_sections_EQ)) {
 if (A->getOption().getID() == OPT_compress_debug_sections) {
-  Opts.setCompressDebugSections(llvm::DebugCompressionType::Z);
+  // TODO: be more clever about the compression type auto-detection
+  Opts.setCompressDebugSections(llvm::DebugCompressionType::GNU);
 } else {
   auto DCT = llvm::StringSwitch(A->getValue())
  .Case("none", llvm::DebugCompressionType::None)

Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=360703=360702=360703=diff
==
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Tue May 14 12:40:42 2019
@@ -221,7 +221,8 @@ bool AssemblerInvocation::CreateFromArgs
   if (const Arg *A = Args.getLastArg(OPT_compress_debug_sections,
  OPT_compress_debug_sections_EQ)) {
 if (A->getOption().getID() == OPT_compress_debug_sections) {
-  Opts.CompressDebugSections = llvm::DebugCompressionType::Z;
+  // TODO: be more clever about the compression type auto-detection
+  Opts.CompressDebugSections = llvm::DebugCompressionType::GNU;
 } else {
   Opts.CompressDebugSections =
   llvm::StringSwitch(A->getValue())


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r360104 - Fix typo in risc-v register aliases.

2019-05-06 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon May  6 17:45:47 2019
New Revision: 360104

URL: http://llvm.org/viewvc/llvm-project?rev=360104=rev
Log:
Fix typo in risc-v register aliases.

Patch by John.

Differential Revision: https://reviews.llvm.org/D61464

Modified:
cfe/trunk/lib/Basic/Targets/RISCV.cpp

Modified: cfe/trunk/lib/Basic/Targets/RISCV.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/RISCV.cpp?rev=360104=360103=360104=diff
==
--- cfe/trunk/lib/Basic/Targets/RISCV.cpp (original)
+++ cfe/trunk/lib/Basic/Targets/RISCV.cpp Mon May  6 17:45:47 2019
@@ -31,7 +31,7 @@ ArrayRef RISCVT
   {{"zero"}, "x0"}, {{"ra"}, "x1"},  {{"sp"}, "x2"},   {{"gp"}, "x3"},
   {{"tp"}, "x4"},   {{"t0"}, "x5"},  {{"t1"}, "x6"},   {{"t2"}, "x7"},
   {{"s0"}, "x8"},   {{"s1"}, "x9"},  {{"a0"}, "x10"},  {{"a1"}, "x11"},
-  {{"a2"}, "x12"},  {{"a3"}, "x13"}, {{"a4"}, "x15"},  {{"a5"}, "x15"},
+  {{"a2"}, "x12"},  {{"a3"}, "x13"}, {{"a4"}, "x14"},  {{"a5"}, "x15"},
   {{"a6"}, "x16"},  {{"a7"}, "x17"}, {{"s2"}, "x18"},  {{"s3"}, "x19"},
   {{"s4"}, "x20"},  {{"s5"}, "x21"}, {{"s6"}, "x22"},  {{"s7"}, "x23"},
   {{"s8"}, "x24"},  {{"s9"}, "x25"}, {{"s10"}, "x26"}, {{"s11"}, "x27"},


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D61464: [RiscV] Typo in register aliases

2019-05-06 Thread Eric Christopher via cfe-commits
I'll get it.

On Sat, May 4, 2019 at 3:47 AM John LLVM via Phabricator
 wrote:
>
> JohnLLVM added a comment.
>
> What should I do now? I do not have rights to commit.
>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D61464/new/
>
> https://reviews.llvm.org/D61464
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D58326: [Driver][Gnu] Support -nolibc flag

2019-02-16 Thread Eric Christopher via cfe-commits
Weird. Ok.

On Sat, Feb 16, 2019, 5:20 PM Petr Hosek via Phabricator <
revi...@reviews.llvm.org> wrote:

> phosek created this revision.
> phosek added reviewers: echristo, mcgrathr.
> Herald added a project: clang.
> Herald added a subscriber: cfe-commits.
>
> This can be used to disable libc linking. This flag is supported by
> GCC since version 9 as well as some Clang target toolchains.
>
>
> Repository:
>   rC Clang
>
> https://reviews.llvm.org/D58326
>
> Files:
>   clang/lib/Driver/ToolChains/Gnu.cpp
>   clang/test/Driver/nodefaultlib.c
>   clang/test/Driver/nolibc.c
>
>
> Index: clang/test/Driver/nolibc.c
> ===
> --- /dev/null
> +++ clang/test/Driver/nolibc.c
> @@ -0,0 +1,5 @@
> +// RUN: %clang -target i686-pc-linux-gnu -### -rtlib=libgcc -nolibc %s
> 2>&1 | FileCheck %s
> +// CHECK: crtbegin
> +// CHECK: "-lgcc"
> +// CHECK-NOT: "-lc"
> +// CHECK: crtend
> Index: clang/test/Driver/nodefaultlib.c
> ===
> --- clang/test/Driver/nodefaultlib.c
> +++ clang/test/Driver/nodefaultlib.c
> @@ -1,4 +1,4 @@
> -// RUN: %clang -target i686-pc-linux-gnu -### -nodefaultlibs %s 2>&1 |
> FileCheck -check-prefix=TEST1 %s
> +// RUN: %clang -target i686-pc-linux-gnu -### -rtlib=libgcc
> -nodefaultlibs %s 2>&1 | FileCheck -check-prefix=TEST1 %s
>  // TEST1-NOT: start-group
>  // TEST1-NOT: "-lgcc"
>  // TEST1-NOT: "-lc"
> Index: clang/lib/Driver/ToolChains/Gnu.cpp
> ===
> --- clang/lib/Driver/ToolChains/Gnu.cpp
> +++ clang/lib/Driver/ToolChains/Gnu.cpp
> @@ -518,7 +518,8 @@
>if (Args.hasArg(options::OPT_fsplit_stack))
>  CmdArgs.push_back("--wrap=pthread_create");
>
> -  CmdArgs.push_back("-lc");
> +  if (!Args.hasArg(options::OPT_nolibc))
> +CmdArgs.push_back("-lc");
>
>// Add IAMCU specific libs, if needed.
>if (IsIAMCU)
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r352690 - [Sanitizers] UBSan unreachable incompatible with ASan in the presence of `noreturn` calls

2019-01-31 Thread Eric Christopher via cfe-commits
Looks like this broke optimized asan builds via an assert in SCCP. I'll see
what I can do about a testcase (or Eric will), however, would you mind
reverting in the meantime?

Thanks!

-eric

On Wed, Jan 30, 2019 at 4:41 PM Julian Lettner via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: yln
> Date: Wed Jan 30 15:42:13 2019
> New Revision: 352690
>
> URL: http://llvm.org/viewvc/llvm-project?rev=352690=rev
> Log:
> [Sanitizers] UBSan unreachable incompatible with ASan in the presence of
> `noreturn` calls
>
> Summary:
> UBSan wants to detect when unreachable code is actually reached, so it
> adds instrumentation before every unreachable instruction. However, the
> optimizer will remove code after calls to functions marked with
> noreturn. To avoid this UBSan removes noreturn from both the call
> instruction as well as from the function itself. Unfortunately, ASan
> relies on this annotation to unpoison the stack by inserting calls to
> _asan_handle_no_return before noreturn functions. This is important for
> functions that do not return but access the the stack memory, e.g.,
> unwinder functions *like* longjmp (longjmp itself is actually
> "double-proofed" via its interceptor). The result is that when ASan and
> UBSan are combined, the noreturn attributes are missing and ASan cannot
> unpoison the stack, so it has false positives when stack unwinding is
> used.
>
> Changes:
> Clang-CodeGen now directly insert calls to `__asan_handle_no_return`
> when a call to a noreturn function is encountered and both
> UBsan-unreachable and ASan are enabled. This allows UBSan to continue
> removing the noreturn attribute from functions without any changes to
> the ASan pass.
>
> Previously generated code:
> ```
>   call void @longjmp
>   call void @__asan_handle_no_return
>   call void @__ubsan_handle_builtin_unreachable
> ```
>
> Generated code (for now):
> ```
>   call void @__asan_handle_no_return
>   call void @longjmp
>   call void @__asan_handle_no_return
>   call void @__ubsan_handle_builtin_unreachable
> ```
>
> rdar://problem/40723397
>
> Reviewers: delcypher, eugenis, vsk
>
> Differential Revision: https://reviews.llvm.org/D57278
>
> Added:
> cfe/trunk/test/CodeGen/ubsan-asan-noreturn.c
> Modified:
> cfe/trunk/lib/CodeGen/CGCall.cpp
> cfe/trunk/lib/CodeGen/CodeGenFunction.h
> cfe/trunk/test/CodeGenCXX/ubsan-unreachable.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=352690=352689=352690=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Wed Jan 30 15:42:13 2019
> @@ -4398,10 +4398,23 @@ RValue CodeGenFunction::EmitCall(const C
>
>  // Strip away the noreturn attribute to better diagnose unreachable
> UB.
>  if (SanOpts.has(SanitizerKind::Unreachable)) {
> +  // Also remove from function since CI->hasFnAttr(..) also checks
> attributes
> +  // of the called function.
>if (auto *F = CI->getCalledFunction())
>  F->removeFnAttr(llvm::Attribute::NoReturn);
>CI->removeAttribute(llvm::AttributeList::FunctionIndex,
>llvm::Attribute::NoReturn);
> +
> +  // Avoid incompatibility with ASan which relies on the `noreturn`
> +  // attribute to insert handler calls.
> +  if (SanOpts.has(SanitizerKind::Address)) {
> +SanitizerScope SanScope(this);
> +Builder.SetInsertPoint(CI);
> +auto *FnType = llvm::FunctionType::get(CGM.VoidTy,
> /*isVarArg=*/false);
> +auto *Fn = CGM.CreateRuntimeFunction(FnType,
> "__asan_handle_no_return");
> +EmitNounwindRuntimeCall(Fn);
> +Builder.SetInsertPoint(CI->getParent());
> +  }
>  }
>
>  EmitUnreachable(Loc);
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=352690=352689=352690=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Wed Jan 30 15:42:13 2019
> @@ -4084,8 +4084,8 @@ public:
>/// passing to a runtime sanitizer handler.
>llvm::Constant *EmitCheckSourceLocation(SourceLocation Loc);
>
> -  /// Create a basic block that will call a handler function in a
> -  /// sanitizer runtime with the provided arguments, and create a
> conditional
> +  /// Create a basic block that will either trap or call a handler
> function in
> +  /// the UBSan runtime with the provided arguments, and create a
> conditional
>/// branch to it.
>void EmitCheck(ArrayRef>
> Checked,
>   SanitizerHandler Check, ArrayRef
> StaticArgs,
>
> Added: cfe/trunk/test/CodeGen/ubsan-asan-noreturn.c
> URL:
> 

Re: [PATCH] D53919: [X86] Don't allow illegal vector types to return by direct value on x86-64.

2018-11-05 Thread Eric Christopher via cfe-commits
On Mon, Nov 5, 2018 at 9:45 AM H.J Lu via Phabricator <
revi...@reviews.llvm.org> wrote:

> hjl.tools added a comment.
>
> In https://reviews.llvm.org/D53919#1287510, @echristo wrote:
>
> > In https://reviews.llvm.org/D53919#1282994, @hjl.tools wrote:
> >
> > > In https://reviews.llvm.org/D53919#1282952, @efriedma wrote:
> > >
> > > > With both 3.3 and trunk (I don't have a 7.0 handy; I can build it if
> it would be helpful):
> > >
> > >
> > > Please try clang 2.6 on both testcases.
> >
> >
> > From the releases:
> >
> > 23 Oct 2009   2.6
> >
> > ... why would you care about a 9 year old version of clang?
>
>
> It is about ABI consistency.  When AVX isn't enabled, the old and
> compilers should
> use the same calling convention.
>

Seems like 3.3 to present should be sufficient.

-eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D52703: Allow ifunc resolvers to accept arguments

2018-10-09 Thread Eric Christopher via cfe-commits
SGTM.

On Tue, Oct 9, 2018, 7:57 AM James Y Knight via Phabricator <
revi...@reviews.llvm.org> wrote:

> jyknight accepted this revision.
> jyknight added a comment.
> This revision is now accepted and ready to land.
>
> Given that there's no technical reason for the compiler to prohibit this
> (it was just clang trying to diagnose a probable user-error, which turns
> out to not be as probable as ), this seems like the right solution to me.
>
>
> https://reviews.llvm.org/D52703
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r342668 - Add testcases for r342667.

2018-09-20 Thread Eric Christopher via cfe-commits
Thank you!

On Thu, Sep 20, 2018, 3:34 PM Zachary Turner  wrote:

> Test removed in r342693.
>
> On Thu, Sep 20, 2018 at 3:30 PM Jorge Gorbe Moya 
> wrote:
>
>> Zach and I were able to find the cause.
>>
>> Clang on Windows manages to find "file.h" when you #include "/file.h" and
>> that makes the expected diagnostic not appear. MSVC inteprets an #include
>> with a leading slash as an absolute path so I think we have accidentally
>> hit a different bug in Clang :)
>>
>> One option to fix the test would be replacing the slash with another
>> random non-alphanumeric character that can't be interpreted as a directory
>> separator, but at that point I think we can just delete the failing test
>> and rely on the existing include-likely-typo.c that tests with both leading
>> and trailing non-alphanumeric characters.
>>
>> The other test in r342668 works because it includes a file that doesn't
>> exist even if you interpret the path as relative so it should be OK to keep
>> while the bug is found.
>>
>> I'll go find a bug about the behavior on windows. Thanks!
>>
>> Jorge
>>
>> On Thu, Sep 20, 2018 at 2:51 PM Eric Christopher 
>> wrote:
>>
>>> FWIW we're trying to reproduce here real fast and then will revert or
>>> fix real fast.
>>>
>>> Thanks!
>>>
>>> -eric
>>>
>>> On Thu, Sep 20, 2018 at 2:46 PM Eric Christopher 
>>> wrote:
>>>
>>>> Adding Jorge...
>>>>
>>>> On Thu, Sep 20, 2018 at 2:36 PM  wrote:
>>>>
>>>>> Hi Eric,
>>>>>
>>>>> The test that you added in this commit is failing on the PS4 Windows
>>>>> bot. Can you please take a look?
>>>>>
>>>>>
>>>>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20052
>>>>>
>>>>> FAIL: Clang :: Preprocessor/include-leading-nonalpha-suggest.c (10765
>>>>> of 43992)
>>>>>  TEST 'Clang ::
>>>>> Preprocessor/include-leading-nonalpha-suggest.c' FAILED 
>>>>> 
>>>>> Script:
>>>>> --
>>>>> : 'RUN: at line 1';
>>>>>  
>>>>> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE
>>>>> -cc1 -internal-isystem
>>>>> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include
>>>>> -nostdsysteminc
>>>>> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
>>>>> -verify
>>>>> --
>>>>> Exit Code: 1
>>>>>
>>>>> Command Output (stdout):
>>>>> --
>>>>> $ ":" "RUN: at line 1"
>>>>> $
>>>>> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE"
>>>>> "-cc1" "-internal-isystem"
>>>>> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include"
>>>>> "-nostdsysteminc"
>>>>> "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c"
>>>>> "-verify"
>>>>> # command stderr:
>>>>> error: 'error' diagnostics expected but not seen:
>>>>>
>>>>>   File
>>>>> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
>>>>> Line 3: '/empty_file_to_include.h' file not found, did you mean
>>>>> 'empty_file_to_include.h'?
>>>>>
>>>>> 1 error generated.
>>>>>
>>>>>
>>>>> error: command failed with exit status: 1
>>>>>
>>>>>
>>>> Oof. Thanks. If I don't have something in 10 minutes I'll just revert.
>>>>
>>>> Thanks!
>>>>
>>>> -eric
>>>>
>>>>
>>>>
>>>>> Douglas Yung
>>>>>
>>>>> > -Original Message-
>>>>> > From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On
>>>>> Behalf
>

Re: r342668 - Add testcases for r342667.

2018-09-20 Thread Eric Christopher via cfe-commits
FWIW we're trying to reproduce here real fast and then will revert or fix
real fast.

Thanks!

-eric

On Thu, Sep 20, 2018 at 2:46 PM Eric Christopher  wrote:

> Adding Jorge...
>
> On Thu, Sep 20, 2018 at 2:36 PM  wrote:
>
>> Hi Eric,
>>
>> The test that you added in this commit is failing on the PS4 Windows bot.
>> Can you please take a look?
>>
>>
>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20052
>>
>> FAIL: Clang :: Preprocessor/include-leading-nonalpha-suggest.c (10765 of
>> 43992)
>>  TEST 'Clang ::
>> Preprocessor/include-leading-nonalpha-suggest.c' FAILED 
>> Script:
>> --
>> : 'RUN: at line 1';
>>  
>> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE
>> -cc1 -internal-isystem
>> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include
>> -nostdsysteminc
>> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
>> -verify
>> --
>> Exit Code: 1
>>
>> Command Output (stdout):
>> --
>> $ ":" "RUN: at line 1"
>> $
>> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE"
>> "-cc1" "-internal-isystem"
>> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include"
>> "-nostdsysteminc"
>> "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c"
>> "-verify"
>> # command stderr:
>> error: 'error' diagnostics expected but not seen:
>>
>>   File
>> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
>> Line 3: '/empty_file_to_include.h' file not found, did you mean
>> 'empty_file_to_include.h'?
>>
>> 1 error generated.
>>
>>
>> error: command failed with exit status: 1
>>
>>
> Oof. Thanks. If I don't have something in 10 minutes I'll just revert.
>
> Thanks!
>
> -eric
>
>
>
>> Douglas Yung
>>
>> > -Original Message-
>> > From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
>> > Of Eric Christopher via cfe-commits
>> > Sent: Thursday, September 20, 2018 10:23
>> > To: cfe-commits@lists.llvm.org
>> > Subject: r342668 - Add testcases for r342667.
>> >
>> > Author: echristo
>> > Date: Thu Sep 20 10:22:43 2018
>> > New Revision: 342668
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=342668=rev
>> > Log:
>> > Add testcases for r342667.
>> >
>> > Added:
>> > cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
>> > cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
>> >
>> > Added: cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-
>> > suggest.c
>> > URL: http://llvm.org/viewvc/llvm-
>> > project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-
>> > suggest.c?rev=342668=auto
>> > ===
>> > ===
>> > --- cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
>> > (added)
>> > +++ cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
>> > Thu Sep 20 10:22:43 2018
>> > @@ -0,0 +1,3 @@
>> > +// RUN: %clang_cc1 %s -verify
>> > +
>> > +#include "/non_existing_file_to_include.h" // expected-error
>> > {{'/non_existing_file_to_include.h' file not found}}
>> >
>> > Added: cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
>> > URL: http://llvm.org/viewvc/llvm-
>> > project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-
>> > suggest.c?rev=342668=auto
>> > ===
>> > ===
>> > --- cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
>> > (added)
>> > +++ cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c Thu
>> > Sep 20 10:22:43 2018
>> > @@ -0,0 +1,3 @@
>> > +// RUN: %clang_cc1 %s -verify
>> > +
>> > +#include "/empty_file_to_include.h" // expected-error
>> > {{'/empty_file_to_include.h' file not found, did you mean
>> > 'empty_file_to_include.h'?}}
>> >
>> >
>> > ___
>> > cfe-commits mailing list
>> > cfe-commits@lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r342668 - Add testcases for r342667.

2018-09-20 Thread Eric Christopher via cfe-commits
Adding Jorge...

On Thu, Sep 20, 2018 at 2:36 PM  wrote:

> Hi Eric,
>
> The test that you added in this commit is failing on the PS4 Windows bot.
> Can you please take a look?
>
>
> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20052
>
> FAIL: Clang :: Preprocessor/include-leading-nonalpha-suggest.c (10765 of
> 43992)
>  TEST 'Clang ::
> Preprocessor/include-leading-nonalpha-suggest.c' FAILED 
> Script:
> --
> : 'RUN: at line 1';
>  
> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE
> -cc1 -internal-isystem
> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include
> -nostdsysteminc
> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
> -verify
> --
> Exit Code: 1
>
> Command Output (stdout):
> --
> $ ":" "RUN: at line 1"
> $
> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE"
> "-cc1" "-internal-isystem"
> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include"
> "-nostdsysteminc"
> "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c"
> "-verify"
> # command stderr:
> error: 'error' diagnostics expected but not seen:
>
>   File
> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
> Line 3: '/empty_file_to_include.h' file not found, did you mean
> 'empty_file_to_include.h'?
>
> 1 error generated.
>
>
> error: command failed with exit status: 1
>
>
Oof. Thanks. If I don't have something in 10 minutes I'll just revert.

Thanks!

-eric



> Douglas Yung
>
> > -Original Message-
> > From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> > Of Eric Christopher via cfe-commits
> > Sent: Thursday, September 20, 2018 10:23
> > To: cfe-commits@lists.llvm.org
> > Subject: r342668 - Add testcases for r342667.
> >
> > Author: echristo
> > Date: Thu Sep 20 10:22:43 2018
> > New Revision: 342668
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=342668=rev
> > Log:
> > Add testcases for r342667.
> >
> > Added:
> > cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
> > cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
> >
> > Added: cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-
> > suggest.c
> > URL: http://llvm.org/viewvc/llvm-
> > project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-
> > suggest.c?rev=342668=auto
> > ===
> > ===
> > --- cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
> > (added)
> > +++ cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
> > Thu Sep 20 10:22:43 2018
> > @@ -0,0 +1,3 @@
> > +// RUN: %clang_cc1 %s -verify
> > +
> > +#include "/non_existing_file_to_include.h" // expected-error
> > {{'/non_existing_file_to_include.h' file not found}}
> >
> > Added: cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
> > URL: http://llvm.org/viewvc/llvm-
> > project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-
> > suggest.c?rev=342668=auto
> > ===
> > ===
> > --- cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
> > (added)
> > +++ cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c Thu
> > Sep 20 10:22:43 2018
> > @@ -0,0 +1,3 @@
> > +// RUN: %clang_cc1 %s -verify
> > +
> > +#include "/empty_file_to_include.h" // expected-error
> > {{'/empty_file_to_include.h' file not found, did you mean
> > 'empty_file_to_include.h'?}}
> >
> >
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r342668 - Add testcases for r342667.

2018-09-20 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Thu Sep 20 10:22:43 2018
New Revision: 342668

URL: http://llvm.org/viewvc/llvm-project?rev=342668=rev
Log:
Add testcases for r342667.

Added:
cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c

Added: cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c?rev=342668=auto
==
--- cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c (added)
+++ cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c Thu Sep 
20 10:22:43 2018
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -verify
+
+#include "/non_existing_file_to_include.h" // expected-error 
{{'/non_existing_file_to_include.h' file not found}}

Added: cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c?rev=342668=auto
==
--- cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c (added)
+++ cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c Thu Sep 20 
10:22:43 2018
@@ -0,0 +1,3 @@
+// RUN: %clang_cc1 %s -verify
+
+#include "/empty_file_to_include.h" // expected-error 
{{'/empty_file_to_include.h' file not found, did you mean 
'empty_file_to_include.h'?}}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r342667 - r342177 introduced a hint in cases where an #included file is not found. It tries to find a suggestion by removing leading or trailing non-alphanumeric characters and checking if a matching

2018-09-20 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Thu Sep 20 10:21:56 2018
New Revision: 342667

URL: http://llvm.org/viewvc/llvm-project?rev=342667=rev
Log:
r342177 introduced a hint in cases where an #included file is not found. It 
tries to find a suggestion by removing leading or trailing non-alphanumeric 
characters and checking if a matching file exists, then it reports an error 
like:

include-likely-typo.c:3:10: error: '' file not found, 
did you mean 'empty_file_to_include.h'?
 ^~~
 "empty_file_to_include.h"
1 error generated.
However, if a hint is not found, the error message will show only the trimmed 
name we use to look for a hint, so:

will result in:

include-leading-nonalpha-no-suggest.c:3:10: fatal error: 
'non_existing_file_to_include.h' file not found
 ^~~~
1 error generated.
where the name reported after "fatal error:" doesn't match what the user wrote.

Patch by Jorge Gorbe!

Differential Revision: https://reviews.llvm.org/D52280

This change reports the original file name instead of the trimmed one when a 
suggestion is not found.

Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=342667=342666=342667=diff
==
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Thu Sep 20 10:21:56 2018
@@ -1887,8 +1887,8 @@ void Preprocessor::HandleIncludeDirectiv
 
   // Check for likely typos due to leading or trailing non-isAlphanumeric
   // characters
+  StringRef OriginalFilename = Filename;
   if (!File) {
-StringRef OriginalFilename = Filename;
 while (!isAlphanumeric(Filename.front())) {
   Filename = Filename.drop_front();
 }
@@ -1915,7 +1915,7 @@ void Preprocessor::HandleIncludeDirectiv
 
   // If the file is still not found, just go with the vanilla diagnostic
   if (!File)
-Diag(FilenameTok, diag::err_pp_file_not_found) << Filename
+Diag(FilenameTok, diag::err_pp_file_not_found) << OriginalFilename
<< FilenameRange;
 }
   }


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r342053 - [CodeGen] Align rtti and vtable data

2018-09-17 Thread Eric Christopher via cfe-commits
Thanks for looking Jordan!

On Mon, Sep 17, 2018, 11:16 AM Jordan Rupprecht 
wrote:

> > Interesting, what kind of failures?
> >
> > If they are causing you problems, of course feel free to revert.
> >
> > Dave
>
> Turns out they are all real issues which running the test under asan
> mode flags as global-buffer-overflow. I'm guessing the over-alignment
> was hiding the bug as reads there would be zero initialized, but now
> they are reading other non-zero data and crashing on that.
>
> So, this patch just exposes some buggy code. Let's not revert it.
> Sorry for the false alarm!
>
> -- Jordan
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r342053 - [CodeGen] Align rtti and vtable data

2018-09-17 Thread Eric Christopher via cfe-commits
Hi David,

I'm seeing test failures after this patch. I'm trying to get a test case
reduced, but can we revert until we figure it out?

Thanks!

-eric

On Wed, Sep 12, 2018 at 7:10 AM David Green via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: dmgreen
> Date: Wed Sep 12 07:09:06 2018
> New Revision: 342053
>
> URL: http://llvm.org/viewvc/llvm-project?rev=342053=rev
> Log:
> [CodeGen] Align rtti and vtable data
>
> Previously the alignment on the newly created rtti/typeinfo data was
> largely
> not set, meaning that DataLayout::getPreferredAlignment was free to
> overalign
> it to 16 bytes. This causes unnecessary code bloat.
>
> Differential Revision: https://reviews.llvm.org/D51416
>
> Modified:
> cfe/trunk/lib/CodeGen/CGVTT.cpp
> cfe/trunk/lib/CodeGen/CGVTables.cpp
> cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> cfe/trunk/lib/CodeGen/CodeGenModule.h
> cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
> cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
> cfe/trunk/test/CodeGenCXX/microsoft-abi-vbtables.cpp
> cfe/trunk/test/CodeGenCXX/vtable-align.cpp
> cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGVTT.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTT.cpp?rev=342053=342052=342053=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CGVTT.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGVTT.cpp Wed Sep 12 07:09:06 2018
> @@ -119,10 +119,10 @@ llvm::GlobalVariable *CodeGenVTables::Ge
>
>llvm::ArrayType *ArrayType =
>  llvm::ArrayType::get(CGM.Int8PtrTy,
> Builder.getVTTComponents().size());
> +  unsigned Align = CGM.getDataLayout().getABITypeAlignment(CGM.Int8PtrTy);
>
> -  llvm::GlobalVariable *GV =
> -CGM.CreateOrReplaceCXXRuntimeVariable(Name, ArrayType,
> -
> llvm::GlobalValue::ExternalLinkage);
> +  llvm::GlobalVariable *GV = CGM.CreateOrReplaceCXXRuntimeVariable(
> +  Name, ArrayType, llvm::GlobalValue::ExternalLinkage, Align);
>GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
>return GV;
>  }
>
> Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=342053=342052=342053=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGVTables.cpp Wed Sep 12 07:09:06 2018
> @@ -756,9 +756,11 @@ CodeGenVTables::GenerateConstructionVTab
>if (Linkage == llvm::GlobalVariable::AvailableExternallyLinkage)
>  Linkage = llvm::GlobalVariable::InternalLinkage;
>
> +  unsigned Align = CGM.getDataLayout().getABITypeAlignment(VTType);
> +
>// Create the variable that will hold the construction vtable.
>llvm::GlobalVariable *VTable =
> -CGM.CreateOrReplaceCXXRuntimeVariable(Name, VTType, Linkage);
> +  CGM.CreateOrReplaceCXXRuntimeVariable(Name, VTType, Linkage, Align);
>CGM.setGVProperties(VTable, RD);
>
>// V-tables are always unnamed_addr.
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=342053=342052=342053=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Wed Sep 12 07:09:06 2018
> @@ -3099,10 +3099,9 @@ CodeGenModule::GetAddrOfGlobal(GlobalDec
>IsForDefinition);
>  }
>
> -llvm::GlobalVariable *
> -CodeGenModule::CreateOrReplaceCXXRuntimeVariable(StringRef Name,
> -  llvm::Type *Ty,
> -  llvm::GlobalValue::LinkageTypes
> Linkage) {
> +llvm::GlobalVariable *CodeGenModule::CreateOrReplaceCXXRuntimeVariable(
> +StringRef Name, llvm::Type *Ty, llvm::GlobalValue::LinkageTypes
> Linkage,
> +unsigned Alignment) {
>llvm::GlobalVariable *GV = getModule().getNamedGlobal(Name);
>llvm::GlobalVariable *OldGV = nullptr;
>
> @@ -3138,6 +3137,8 @@ CodeGenModule::CreateOrReplaceCXXRuntime
>!GV->hasAvailableExternallyLinkage())
>  GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
>
> +  GV->setAlignment(Alignment);
> +
>return GV;
>  }
>
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=342053=342052=342053=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenModule.h Wed Sep 12 07:09:06 2018
> @@ -764,7 +764,8 @@ public:
>/// bitcast to the new variable.
>llvm::GlobalVariable *
>CreateOrReplaceCXXRuntimeVariable(StringRef Name, llvm::Type *Ty,
> -llvm::GlobalValue::LinkageTypes
> Linkage);
> +   

Re: [PATCH] D51358: [driver] Do not pass "-flavor old-gnu" option to LLD linker

2018-08-28 Thread Eric Christopher via cfe-commits
LGTM

On Tue, Aug 28, 2018, 7:49 AM Simon Atanasyan via Phabricator <
revi...@reviews.llvm.org> wrote:

> atanasyan created this revision.
> atanasyan added reviewers: echristo, ruiu.
>
> The "-flavor old-gnu" option were introduced to enable old version of LLD
> ELF linker implementation. This option has been removed from the linker
> since LLD 3.9. I do not think that there is a real case when the latest
> version of Clang is used in combination with so obsoleted version of LLD
> linker. Now we can remove support of this option from the driver.
>
>
> Repository:
>   rC Clang
>
> https://reviews.llvm.org/D51358
>
> Files:
>   lib/Driver/ToolChains/Gnu.cpp
>
>
> Index: lib/Driver/ToolChains/Gnu.cpp
> ===
> --- lib/Driver/ToolChains/Gnu.cpp
> +++ lib/Driver/ToolChains/Gnu.cpp
> @@ -323,14 +323,6 @@
>// handled somewhere else.
>Args.ClaimAllArgs(options::OPT_w);
>
> -  const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
> -  if (llvm::sys::path::stem(Exec) == "lld") {
> -CmdArgs.push_back("-flavor");
> -CmdArgs.push_back("old-gnu");
> -CmdArgs.push_back("-target");
> -
> CmdArgs.push_back(Args.MakeArgString(getToolChain().getTripleString()));
> -  }
> -
>if (!D.SysRoot.empty())
>  CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
>
> @@ -539,6 +531,7 @@
>AddHIPLinkerScript(getToolChain(), C, Output, Inputs, Args, CmdArgs, JA,
>   *this);
>
> +  const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
>C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs,
> Inputs));
>  }
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-31 Thread Eric Christopher via cfe-commits
On Tue, Jul 31, 2018 at 3:59 PM  wrote:

> What might be missing is the impl of CreateMemberType:
>
> llvm::DIType *CGDebugInfo::CreateMemberType(llvm::DIFile *Unit, QualType
> FType,
>  StringRef Name, uint64_t
> *Offset) {
>llvm::DIType *FieldTy = CGDebugInfo::getOrCreateType(FType, Unit);
>uint64_t FieldSize = CGM.getContext().getTypeSize(FType);
>auto FieldAlign = getTypeAlignIfRequired(FType, CGM.getContext());
>llvm::DIType *Ty =
>DBuilder.createMemberType(Unit, Name, Unit, 0, FieldSize,
> FieldAlign,
>  *Offset, llvm::DINode::FlagZero,
> FieldTy);
>*Offset += FieldSize;
>return Ty;
> }
>
> The FieldOffset is advanced twice in the OpenCL case, each time by
> getTypeSize(IntTy). I'm not certain why CreateMemberType is not used
> for __descriptor in the non-OpenCL case; it looks like it is
> because it needs to handle FieldTy in a special way?
>
>
I'd either forgotten or blocked that the code does that. Also, why on earth.
And probably.

Anyhow, if you don't mind commenting the OpenCL part of the code when you
get a chance to do the rest of the cleanup I'd appreciate it.

-eric


> Scott
>
> On 2018-07-31 18:03, Eric Christopher wrote:
> > I'm probably missing something, from looking here:
> >
> >   FieldOffset = 0;
> >   if (CGM.getLangOpts().OpenCL) {
> > FType = CGM.getContext().IntTy;
> > EltTys.push_back(CreateMemberType(Unit, FType, "__size",
> > ));
> > EltTys.push_back(CreateMemberType(Unit, FType, "__align",
> > ));
> >   } else {
> > FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);
> > EltTys.push_back(CreateMemberType(Unit, FType, "__isa",
> > ));
> > FType = CGM.getContext().IntTy;
> > EltTys.push_back(CreateMemberType(Unit, FType, "__flags",
> > ));
> > EltTys.push_back(CreateMemberType(Unit, FType, "__reserved",
> > ));
> > FType = CGM.getContext().getPointerType(Ty->getPointeeType());
> > EltTys.push_back(CreateMemberType(Unit, FType, "__FuncPtr",
> > ));
> > FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);
> > FieldSize = CGM.getContext().getTypeSize(Ty);
> > FieldAlign = CGM.getContext().getTypeAlign(Ty);
> > EltTys.push_back(DBuilder.createMemberType(
> > Unit, "__descriptor", nullptr, LineNo, FieldSize, FieldAlign,
> > FieldOffset,
> > llvm::DINode::FlagZero, DescTy));
> > FieldOffset += FieldSize;
> >   }
> >
> > FieldOffset is only advanced for non opencl blocks. And then just used
> > in the type.
> >
> > I'll be honest none of that makes any particular sense, but in
> > particular these two definitely don't match for the type.
> >
> > Thoughts? At any rate if you could document what the intended code is
> > here I'd appreciate it.
> >
> > -eric
> >
> > On Tue, Jul 31, 2018 at 9:18 AM  wrote:
> >
> >> I think this version is right; the FieldOffset for OpenCL here will
> >> be 2
> >> * getTypeSize(IntTy). The final `FieldOffset += FieldSize` that was
> >> moved only applies to the non-OpenCL "__descriptor" field.
> >>
> >> Scott
> >>
> >> On 2018-07-30 19:22, Eric Christopher wrote:
> >>> Is 0 right for FieldOffset for OpenCL here? Seems a little odd.
> >>>
> >>> -eric
> >>>
> >>> On Mon, Jul 30, 2018 at 3:56 PM Scott Linder via cfe-commits
> >>>  wrote:
> >>>
>  Author: scott.linder
>  Date: Mon Jul 30 15:52:07 2018
>  New Revision: 338321
> 
>  URL: http://llvm.org/viewvc/llvm-project?rev=338321=rev [1]
> >> [1]
>  Log:
>  Fix use of uninitialized variable in r338299
> 
>  Modified:
>  cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> 
>  Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>  URL:
> 
> >>>
> >>
> >
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=338321=338320=338321=diff
> >> [2]
>  [2]
> 
> >>>
> >>
> >
> ==
>  --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
>  +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 30 15:52:07
> >> 2018
>  @@ -989,9 +989,9 @@ llvm::DIType *CGDebugInfo::CreateType(co
>  EltTys.push_back(DBuilder.createMemberType(
>  Unit, "__descriptor", nullptr, LineNo, FieldSize,
>  FieldAlign, FieldOffset,
>  llvm::DINode::FlagZero, DescTy));
>  + FieldOffset += FieldSize;
>  }
> 
>  - FieldOffset += FieldSize;
>  Elements = DBuilder.getOrCreateArray(EltTys);
> 
>  // The __block_literal_generic structs are marked with a special
> 
>  ___
>  cfe-commits mailing list
>  cfe-commits@lists.llvm.org
>  http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits [3]
> >> [3]
> >>>
> >>>
> >>> Links:
> >>> --
> >>> [1] http://llvm.org/viewvc/llvm-project?rev=338321view=rev
> >> [4]
> >>> [2]
> >>>
> >>
> >
> 

Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-31 Thread Eric Christopher via cfe-commits
I'm probably missing something, from looking here:

  FieldOffset = 0;
  if (CGM.getLangOpts().OpenCL) {
FType = CGM.getContext().IntTy;
EltTys.push_back(CreateMemberType(Unit, FType, "__size", ));
EltTys.push_back(CreateMemberType(Unit, FType, "__align",
));
  } else {
FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);
EltTys.push_back(CreateMemberType(Unit, FType, "__isa", ));
FType = CGM.getContext().IntTy;
EltTys.push_back(CreateMemberType(Unit, FType, "__flags",
));
EltTys.push_back(CreateMemberType(Unit, FType, "__reserved",
));
FType = CGM.getContext().getPointerType(Ty->getPointeeType());
EltTys.push_back(CreateMemberType(Unit, FType, "__FuncPtr",
));
FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);
FieldSize = CGM.getContext().getTypeSize(Ty);
FieldAlign = CGM.getContext().getTypeAlign(Ty);
EltTys.push_back(DBuilder.createMemberType(
Unit, "__descriptor", nullptr, LineNo, FieldSize, FieldAlign,
FieldOffset,
llvm::DINode::FlagZero, DescTy));
FieldOffset += FieldSize;
  }

FieldOffset is only advanced for non opencl blocks. And then just used in
the type.

I'll be honest none of that makes any particular sense, but in particular
these two definitely don't match for the type.

Thoughts? At any rate if you could document what the intended code is here
I'd appreciate it.

-eric

On Tue, Jul 31, 2018 at 9:18 AM  wrote:

> I think this version is right; the FieldOffset for OpenCL here will be 2
> * getTypeSize(IntTy). The final `FieldOffset += FieldSize` that was
> moved only applies to the non-OpenCL "__descriptor" field.
>
> Scott
>
> On 2018-07-30 19:22, Eric Christopher wrote:
> > Is 0 right for FieldOffset for OpenCL here? Seems a little odd.
> >
> > -eric
> >
> > On Mon, Jul 30, 2018 at 3:56 PM Scott Linder via cfe-commits
> >  wrote:
> >
> >> Author: scott.linder
> >> Date: Mon Jul 30 15:52:07 2018
> >> New Revision: 338321
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=338321=rev [1]
> >> Log:
> >> Fix use of uninitialized variable in r338299
> >>
> >> Modified:
> >> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> >>
> >> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> >> URL:
> >>
> >
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=338321=338320=338321=diff
> >> [2]
> >>
> >
> ==
> >> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> >> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 30 15:52:07 2018
> >> @@ -989,9 +989,9 @@ llvm::DIType *CGDebugInfo::CreateType(co
> >> EltTys.push_back(DBuilder.createMemberType(
> >> Unit, "__descriptor", nullptr, LineNo, FieldSize,
> >> FieldAlign, FieldOffset,
> >> llvm::DINode::FlagZero, DescTy));
> >> + FieldOffset += FieldSize;
> >> }
> >>
> >> - FieldOffset += FieldSize;
> >> Elements = DBuilder.getOrCreateArray(EltTys);
> >>
> >> // The __block_literal_generic structs are marked with a special
> >>
> >> ___
> >> cfe-commits mailing list
> >> cfe-commits@lists.llvm.org
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits [3]
> >
> >
> > Links:
> > --
> > [1] http://llvm.org/viewvc/llvm-project?rev=338321view=rev
> > [2]
> >
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=338321r1=338320r2=338321view=diff
> > [3] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r338321 - Fix use of uninitialized variable in r338299

2018-07-30 Thread Eric Christopher via cfe-commits
Is 0 right for FieldOffset for OpenCL here? Seems a little odd.

-eric

On Mon, Jul 30, 2018 at 3:56 PM Scott Linder via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: scott.linder
> Date: Mon Jul 30 15:52:07 2018
> New Revision: 338321
>
> URL: http://llvm.org/viewvc/llvm-project?rev=338321=rev
> Log:
> Fix use of uninitialized variable in r338299
>
> Modified:
> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=338321=338320=338321=diff
>
> ==
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 30 15:52:07 2018
> @@ -989,9 +989,9 @@ llvm::DIType *CGDebugInfo::CreateType(co
>  EltTys.push_back(DBuilder.createMemberType(
>  Unit, "__descriptor", nullptr, LineNo, FieldSize, FieldAlign,
> FieldOffset,
>  llvm::DINode::FlagZero, DescTy));
> +FieldOffset += FieldSize;
>}
>
> -  FieldOffset += FieldSize;
>Elements = DBuilder.getOrCreateArray(EltTys);
>
>// The __block_literal_generic structs are marked with a special
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r338328 - Revert "Add a definition for FieldSize that seems to make sense here."

2018-07-30 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Jul 30 16:21:51 2018
New Revision: 338328

URL: http://llvm.org/viewvc/llvm-project?rev=338328=rev
Log:
Revert "Add a definition for FieldSize that seems to make sense here."

This reverts commit r338327, the problem was previously fixed in r338321.

Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=338328=338327=338328=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 30 16:21:51 2018
@@ -974,7 +974,6 @@ llvm::DIType *CGDebugInfo::CreateType(co
   if (CGM.getLangOpts().OpenCL) {
 FType = CGM.getContext().IntTy;
 EltTys.push_back(CreateMemberType(Unit, FType, "__size", ));
-FieldSize = CGM.getContext().getTypeSize(Ty);
 EltTys.push_back(CreateMemberType(Unit, FType, "__align", ));
   } else {
 FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r338327 - Add a definition for FieldSize that seems to make sense here.

2018-07-30 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Mon Jul 30 16:17:27 2018
New Revision: 338327

URL: http://llvm.org/viewvc/llvm-project?rev=338327=rev
Log:
Add a definition for FieldSize that seems to make sense here.
This could be sunk out of the if statements, but fix the warning for now.

Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=338327=338326=338327=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 30 16:17:27 2018
@@ -974,6 +974,7 @@ llvm::DIType *CGDebugInfo::CreateType(co
   if (CGM.getLangOpts().OpenCL) {
 FType = CGM.getContext().IntTy;
 EltTys.push_back(CreateMemberType(Unit, FType, "__size", ));
+FieldSize = CGM.getContext().getTypeSize(Ty);
 EltTys.push_back(CreateMemberType(Unit, FType, "__align", ));
   } else {
 FType = CGM.getContext().getPointerType(CGM.getContext().VoidTy);


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r337321 - Remove unnecessary trailing ; in macro intrinsic definition.

2018-07-17 Thread Eric Christopher via cfe-commits
Author: echristo
Date: Tue Jul 17 13:22:17 2018
New Revision: 337321

URL: http://llvm.org/viewvc/llvm-project?rev=337321=rev
Log:
Remove unnecessary trailing ; in macro intrinsic definition.

Modified:
cfe/trunk/lib/Headers/avx512dqintrin.h

Modified: cfe/trunk/lib/Headers/avx512dqintrin.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512dqintrin.h?rev=337321=337320=337321=diff
==
--- cfe/trunk/lib/Headers/avx512dqintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512dqintrin.h Tue Jul 17 13:22:17 2018
@@ -1105,7 +1105,7 @@ _mm512_maskz_broadcast_i64x2(__mmask8 __
 #define _mm512_extractf32x8_ps(A, imm) \
   (__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \
(__v8sf)_mm256_undefined_ps(), \
-   (__mmask8)-1);
+   (__mmask8)-1)
 
 #define _mm512_mask_extractf32x8_ps(W, U, A, imm) \
   (__m256)__builtin_ia32_extractf32x8_mask((__v16sf)(__m512)(A), (int)(imm), \


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


  1   2   3   4   5   >