Skip to content

Commit 25b4073

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:ac42b083f104 into origin/amd-gfx:160270860d83
Local branch origin/amd-gfx 1602708 Merged main:707367621679 into origin/amd-gfx:4cab0b6fa1ab Remote branch main ac42b08 [clang][modules] Guard against bad -fmodule-file mappings (llvm#132059) (llvm#133462)
2 parents 1602708 + ac42b08 commit 25b4073

File tree

67 files changed

+1465
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1465
-156
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "clang/AST/ASTContext.h"
2323
#include "clang/AST/ASTDiagnostic.h"
2424
#include "clang/AST/Attr.h"
25+
#include "clang/AST/Expr.h"
2526
#include "clang/Basic/CharInfo.h"
2627
#include "clang/Basic/Diagnostic.h"
2728
#include "clang/Basic/DiagnosticOptions.h"
@@ -166,8 +167,8 @@ ClangTidyContext::ClangTidyContext(
166167
AllowEnablingAnalyzerAlphaCheckers(AllowEnablingAnalyzerAlphaCheckers),
167168
EnableModuleHeadersParsing(EnableModuleHeadersParsing) {
168169
// Before the first translation unit we can get errors related to command-line
169-
// parsing, use empty string for the file name in this case.
170-
setCurrentFile("");
170+
// parsing, use dummy string for the file name in this case.
171+
setCurrentFile("dummy");
171172
}
172173

173174
ClangTidyContext::~ClangTidyContext() = default;
@@ -528,6 +529,8 @@ void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
528529
case clang::DiagnosticsEngine::ak_addrspace:
529530
Builder << static_cast<LangAS>(Info.getRawArg(Index));
530531
break;
532+
case clang::DiagnosticsEngine::ak_expr:
533+
Builder << reinterpret_cast<const Expr *>(Info.getRawArg(Index));
531534
}
532535
}
533536
}

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ Improvements to Clang's diagnostics
280280
- Clang now better preserves the sugared types of pointers to member.
281281
- Clang now better preserves the presence of the template keyword with dependent
282282
prefixes.
283+
- Clang now respects the current language mode when printing expressions in
284+
diagnostics. This fixes a bunch of `bool` being printed as `_Bool`, and also
285+
a bunch of HLSL types being printed as their C++ equivalents.
283286
- When printing types for diagnostics, clang now doesn't suppress the scopes of
284287
template arguments contained within nested names.
285288
- The ``-Wshift-bool`` warning has been added to warn about shifting a boolean. (#GH28334)

clang/include/clang/AST/Expr.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7379,6 +7379,14 @@ class RecoveryExpr final : public Expr,
73797379
friend class ASTStmtWriter;
73807380
};
73817381

7382+
/// Insertion operator for diagnostics. This allows sending
7383+
/// Expr into a diagnostic with <<.
7384+
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
7385+
const Expr *E) {
7386+
DB.AddTaggedVal(reinterpret_cast<uint64_t>(E), DiagnosticsEngine::ak_expr);
7387+
return DB;
7388+
}
7389+
73827390
} // end namespace clang
73837391

73847392
#endif // LLVM_CLANG_AST_EXPR_H

clang/include/clang/AST/TemplateBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class TemplateArgument {
262262
/// This form of template argument only occurs in template argument
263263
/// lists used for dependent types and for expression; it will not
264264
/// occur in a non-dependent, canonical template argument list.
265-
TemplateArgument(Expr *E, bool IsDefaulted = false) {
265+
explicit TemplateArgument(Expr *E, bool IsDefaulted = false) {
266266
TypeOrValue.Kind = Expression;
267267
TypeOrValue.IsDefaulted = IsDefaulted;
268268
TypeOrValue.V = reinterpret_cast<uintptr_t>(E);

clang/include/clang/Basic/Diagnostic.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,10 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
284284
ak_qualtype_pair,
285285

286286
/// Attr *
287-
ak_attr
287+
ak_attr,
288+
289+
/// Expr *
290+
ak_expr,
288291
};
289292

290293
/// Represents on argument value, which is a union discriminated

clang/lib/AST/ASTDiagnostic.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,14 @@ void clang::FormatASTNodeDiagnosticArgument(
508508
NeedQuotes = false;
509509
break;
510510
}
511+
case DiagnosticsEngine::ak_expr: {
512+
const Expr *E = reinterpret_cast<Expr *>(Val);
513+
assert(E && "Received null Expr!");
514+
E->printPretty(OS, /*Helper=*/nullptr, Context.getPrintingPolicy());
515+
// FIXME: Include quotes when printing expressions.
516+
NeedQuotes = false;
517+
break;
518+
}
511519
}
512520

513521
if (NeedQuotes) {

clang/lib/AST/TemplateBase.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ TemplateArgument TemplateArgument::getPackExpansionPattern() const {
478478
return getAsType()->castAs<PackExpansionType>()->getPattern();
479479

480480
case Expression:
481-
return cast<PackExpansionExpr>(getAsExpr())->getPattern();
481+
return TemplateArgument(cast<PackExpansionExpr>(getAsExpr())->getPattern());
482482

483483
case TemplateExpansion:
484484
return TemplateArgument(getAsTemplateOrTemplatePattern());
@@ -654,18 +654,8 @@ static const T &DiagTemplateArg(const T &DB, const TemplateArgument &Arg) {
654654
case TemplateArgument::TemplateExpansion:
655655
return DB << Arg.getAsTemplateOrTemplatePattern() << "...";
656656

657-
case TemplateArgument::Expression: {
658-
// This shouldn't actually ever happen, so it's okay that we're
659-
// regurgitating an expression here.
660-
// FIXME: We're guessing at LangOptions!
661-
SmallString<32> Str;
662-
llvm::raw_svector_ostream OS(Str);
663-
LangOptions LangOpts;
664-
LangOpts.CPlusPlus = true;
665-
PrintingPolicy Policy(LangOpts);
666-
Arg.getAsExpr()->printPretty(OS, nullptr, Policy);
667-
return DB << OS.str();
668-
}
657+
case TemplateArgument::Expression:
658+
return DB << Arg.getAsExpr();
669659

670660
case TemplateArgument::Pack: {
671661
// FIXME: We're guessing at LangOptions!

clang/lib/Basic/Diagnostic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
12471247
case DiagnosticsEngine::ak_nestednamespec:
12481248
case DiagnosticsEngine::ak_declcontext:
12491249
case DiagnosticsEngine::ak_attr:
1250+
case DiagnosticsEngine::ak_expr:
12501251
getDiags()->ConvertArgToString(Kind, getRawArg(ArgNo),
12511252
StringRef(Modifier, ModifierLen),
12521253
StringRef(Argument, ArgumentLen),

clang/lib/Sema/SemaTemplateDeduction.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ DeduceNullPtrTemplateArgument(Sema &S, TemplateParameterList *TemplateParams,
493493
: CK_NullToPointer)
494494
.get();
495495
return DeduceNonTypeTemplateArgument(
496-
S, TemplateParams, NTTP, DeducedTemplateArgument(Value), Value->getType(),
497-
Info, PartialOrdering, Deduced, HasDeducedAnyParam);
496+
S, TemplateParams, NTTP, TemplateArgument(Value), Value->getType(), Info,
497+
PartialOrdering, Deduced, HasDeducedAnyParam);
498498
}
499499

500500
/// Deduce the value of the given non-type template parameter
@@ -508,8 +508,8 @@ DeduceNonTypeTemplateArgument(Sema &S, TemplateParameterList *TemplateParams,
508508
SmallVectorImpl<DeducedTemplateArgument> &Deduced,
509509
bool *HasDeducedAnyParam) {
510510
return DeduceNonTypeTemplateArgument(
511-
S, TemplateParams, NTTP, DeducedTemplateArgument(Value), Value->getType(),
512-
Info, PartialOrdering, Deduced, HasDeducedAnyParam);
511+
S, TemplateParams, NTTP, TemplateArgument(Value), Value->getType(), Info,
512+
PartialOrdering, Deduced, HasDeducedAnyParam);
513513
}
514514

515515
/// Deduce the value of the given non-type template parameter

clang/lib/Sema/SemaTemplateVariadic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ TemplateArgumentLoc Sema::getTemplateArgumentPackExpansionPattern(
12861286
Expr *Pattern = Expansion->getPattern();
12871287
Ellipsis = Expansion->getEllipsisLoc();
12881288
NumExpansions = Expansion->getNumExpansions();
1289-
return TemplateArgumentLoc(Pattern, Pattern);
1289+
return TemplateArgumentLoc(TemplateArgument(Pattern), Pattern);
12901290
}
12911291

12921292
case TemplateArgument::TemplateExpansion:

clang/lib/Sema/TreeTransform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,7 +3981,7 @@ class TreeTransform {
39813981
if (Result.isInvalid())
39823982
return TemplateArgumentLoc();
39833983

3984-
return TemplateArgumentLoc(Result.get(), Result.get());
3984+
return TemplateArgumentLoc(TemplateArgument(Result.get()), Result.get());
39853985
}
39863986

39873987
case TemplateArgument::Template:
@@ -16131,8 +16131,8 @@ TreeTransform<Derived>::TransformSizeOfPackExpr(SizeOfPackExpr *E) {
1613116131
E->getPackLoc());
1613216132
if (DRE.isInvalid())
1613316133
return ExprError();
16134-
ArgStorage = new (getSema().Context)
16135-
PackExpansionExpr(DRE.get(), E->getPackLoc(), std::nullopt);
16134+
ArgStorage = TemplateArgument(new (getSema().Context) PackExpansionExpr(
16135+
DRE.get(), E->getPackLoc(), std::nullopt));
1613616136
}
1613716137
PackArgs = ArgStorage;
1613816138
}

clang/lib/Serialization/ASTReader.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3318,6 +3318,18 @@ ASTReader::ReadControlBlock(ModuleFile &F,
33183318
Loaded, StoredSize, StoredModTime,
33193319
StoredSignature, Capabilities);
33203320

3321+
// Check the AST we just read from ImportedFile contains a different
3322+
// module than we expected (ImportedName). This can occur for C++20
3323+
// Modules when given a mismatch via -fmodule-file=<name>=<file>
3324+
if (IsImportingStdCXXModule) {
3325+
if (const auto *Imported =
3326+
getModuleManager().lookupByFileName(ImportedFile);
3327+
Imported != nullptr && Imported->ModuleName != ImportedName) {
3328+
Diag(diag::err_failed_to_find_module_file) << ImportedName;
3329+
Result = Missing;
3330+
}
3331+
}
3332+
33213333
// If we diagnosed a problem, produce a backtrace.
33223334
bool recompilingFinalized = Result == OutOfDate &&
33233335
(Capabilities & ARR_OutOfDate) &&
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// RUN: rm -rf %t
2+
// RUN: split-file %s %t
3+
// RUN: cd %t
4+
5+
// Related to issue #132059
6+
7+
// Precompile the module dependencies correctly
8+
// RUN: %clang_cc1 -std=c++20 -emit-module-interface a.cppm -o a.pcm
9+
// RUN: %clang_cc1 -std=c++20 -emit-module-interface b.cppm -o b.pcm \
10+
// RUN: -fmodule-file=A=a.pcm
11+
12+
// Verify that providing incorrect mappings via
13+
// `-fmodule-file=<name>=<path/to/bmi>` does not crash the compiler when loading
14+
// a module that imports the incorrectly mapped module.
15+
// RUN: not %clang_cc1 -std=c++20 main1.cpp -fmodule-file=A=b.pcm
16+
17+
//--- a.cppm
18+
export module A;
19+
20+
export int a() {
21+
return 41;
22+
}
23+
24+
//--- b.cppm
25+
export module B;
26+
import A;
27+
28+
export int b() {
29+
return a() + 1;
30+
}
31+
32+
//--- main1.cpp
33+
import A;
34+
35+
int main() {
36+
return a();
37+
}
38+
39+
// Test again for the case where the BMI is first loaded correctly
40+
// RUN: not %clang_cc1 -std=c++20 main2.cpp-fmodule-file=B=b.pcm \
41+
// RUN: -fmodule-file=A=b.pcm
42+
43+
//--- main2.cpp
44+
import B;
45+
46+
int main() {
47+
return b();
48+
}

clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,26 @@ RWBuffer<TemplatedVector<int> > r9;
6060
// arrays not allowed
6161
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
6262
// expected-note@*:* {{because 'half[4]' does not satisfy '__is_typed_resource_element_compatible'}}
63-
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(__fp16[4])' evaluated to false}}
63+
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(half[4])' evaluated to false}}
6464
RWBuffer<half[4]> r10;
6565

6666
typedef vector<int, 8> int8;
6767
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
6868
// expected-note@*:* {{because 'vector<int, 8>' (vector of 8 'int' values) does not satisfy '__is_typed_resource_element_compatible'}}
69-
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(int __attribute__((ext_vector_type(8))))' evaluated to false}}
69+
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(vector<int, 8>)' evaluated to false}}
7070
RWBuffer<int8> r11;
7171

7272
typedef int MyInt;
7373
RWBuffer<MyInt> r12;
7474

7575
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
7676
// expected-note@*:* {{because 'bool' does not satisfy '__is_typed_resource_element_compatible'}}
77-
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(_Bool)' evaluated to false}}
77+
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(bool)' evaluated to false}}
7878
RWBuffer<bool> r13;
7979

8080
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
8181
// expected-note@*:* {{because 'vector<bool, 2>' (vector of 2 'bool' values) does not satisfy '__is_typed_resource_element_compatible'}}
82-
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(_Bool __attribute__((ext_vector_type(2))))' evaluated to false}}
82+
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(vector<bool, 2>)' evaluated to false}}
8383
RWBuffer<vector<bool, 2>> r14;
8484

8585
enum numbers { one, two, three };
@@ -91,7 +91,7 @@ RWBuffer<numbers> r15;
9191

9292
// expected-error@+3 {{constraints not satisfied for class template 'RWBuffer'}}
9393
// expected-note@*:* {{because 'vector<double, 3>' (vector of 3 'double' values) does not satisfy '__is_typed_resource_element_compatible'}}
94-
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(double __attribute__((ext_vector_type(3))))' evaluated to false}}
94+
// expected-note@*:* {{because '__builtin_hlsl_is_typed_resource_element_compatible(vector<double, 3>)' evaluated to false}}
9595
RWBuffer<double3> r16;
9696

9797

clang/test/SemaTemplate/instantiate-expanded-type-constraint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ constexpr bool is_same_v<T, T> = true;
88

99
template<typename T, typename U>
1010
concept same_as = is_same_v<T, U>;
11-
// expected-note@-1{{because 'is_same_v<int, _Bool>' evaluated to false}}
11+
// expected-note@-1{{because 'is_same_v<int, bool>' evaluated to false}}
1212

1313
template<typename T, typename... Us>
1414
concept either = (is_same_v<T, Us> || ...);
1515

1616
template<typename... Ts>
1717
struct T {
1818
template<same_as<Ts>... Us>
19-
// expected-note@-1{{because 'same_as<int, _Bool>' evaluated to false}}
19+
// expected-note@-1{{because 'same_as<int, bool>' evaluated to false}}
2020
static void foo(Us... u, int x) { };
2121
// expected-note@-1{{candidate template ignored: deduced too few arguments}}
2222
// expected-note@-2{{candidate template ignored: constraints not satisfied}}

clang/test/SemaTemplate/instantiate-requires-expr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ namespace type_requirement {
7272

7373
template<typename T> requires
7474
false_v<requires { typename T::template temp<T>; }>
75-
// expected-note@-1 {{because 'false_v<requires { typename contains_template<int>::template temp<type_requirement::contains_template<int> >; }>' evaluated to false}}
76-
// expected-note@-2 {{because 'false_v<requires { typename contains_template<short>::template temp<type_requirement::contains_template<short> >; }>' evaluated to false}}
75+
// expected-note@-1 {{because 'false_v<requires { typename contains_template<int>::template temp<type_requirement::contains_template<int>>; }>' evaluated to false}}
76+
// expected-note@-2 {{because 'false_v<requires { typename contains_template<short>::template temp<type_requirement::contains_template<short>>; }>' evaluated to false}}
7777
struct r2 {};
7878

7979
using r2i1 = r2<contains_template<int>>; // expected-error{{constraints not satisfied for class template 'r2' [with T = type_requirement::contains_template<int>]}}

clang/test/SemaTemplate/trailing-return-short-circuit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ void usage() {
3939
Foo(true);
4040
// expected-error@-1{{no matching function for call to 'Foo'}}
4141
// expected-note@#FOO{{candidate template ignored: constraints not satisfied [with T = bool]}}
42-
// expected-note@#FOO_REQ{{because 'sizeof(_Bool) > 2' (1 > 2) evaluated to false}}
42+
// expected-note@#FOO_REQ{{because 'sizeof(bool) > 2' (1 > 2) evaluated to false}}
4343
// expected-note@#FOO_REQ{{because substituted constraint expression is ill-formed: type 'bool' cannot be used prior to '::' because it has no members}}
4444

4545
TrailingReturn(true);
4646
// expected-error@-1{{no matching function for call to 'TrailingReturn'}}
4747
// expected-note@#TRAILING{{candidate template ignored: constraints not satisfied [with T = bool]}}
48-
// expected-note@#TRAILING_REQ{{because 'sizeof(_Bool) > 2' (1 > 2) evaluated to false}}
48+
// expected-note@#TRAILING_REQ{{because 'sizeof(bool) > 2' (1 > 2) evaluated to false}}
4949
// expected-note@#TRAILING_REQ_VAL{{because substituted constraint expression is ill-formed: type 'bool' cannot be used prior to '::' because it has no members}}
5050

5151
// Fails the 1st check, fails 2nd because ::value is false.

flang/module/cudadevice.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,4 +1609,9 @@ attributes(device) integer function ballot_sync(mask, pred)
16091609
end subroutine
16101610
end interface
16111611

1612+
interface
1613+
attributes(device,host) logical function on_device() bind(c)
1614+
end function
1615+
end interface
1616+
16121617
end module

libcxx/test/libcxx/algorithms/cpp17_iterator_concepts.verify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void check_bidirectional_iterator_requirements() {
173173
_LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(missing_postdecrement, ""); // expected-error {{static assertion failed}}
174174
// expected-note@*:* {{cannot decrement value of type 'missing_postdecrement'}}
175175
_LIBCPP_REQUIRE_CPP17_BIDIRECTIONAL_ITERATOR(not_returning_iter_reference, ""); // expected-error {{static assertion failed}}
176-
// expected-note@*:* {{because type constraint 'same_as<int, __iter_reference<not_returning_iter_reference> >' was not satisfied}}
176+
// expected-note-re@*:* {{because type constraint 'same_as<int, __iter_reference<not_returning_iter_reference>{{ ?}}>' was not satisfied}}
177177
// clang-format on
178178
}
179179

llvm/include/llvm/Analysis/CtxProfAnalysis.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class PGOContextualProfile {
3333
FunctionInfo(StringRef Name) : Name(Name) {}
3434
};
3535
PGOCtxProfile Profiles;
36+
37+
// True if this module is a post-thinlto module containing just functions
38+
// participating in one or more contextual profiles.
39+
bool IsInSpecializedModule = false;
40+
3641
// For the GUIDs in this module, associate metadata about each function which
3742
// we'll need when we maintain the profiles during IPO transformations.
3843
std::map<GlobalValue::GUID, FunctionInfo> FuncInfo;
@@ -56,6 +61,8 @@ class PGOContextualProfile {
5661

5762
const PGOCtxProfile &profiles() const { return Profiles; }
5863

64+
bool isInSpecializedModule() const { return IsInSpecializedModule; }
65+
5966
bool isFunctionKnown(const Function &F) const {
6067
return getDefinedFunctionGUID(F) != 0;
6168
}

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 533299
19+
#define LLVM_MAIN_REVISION 533315
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/include/llvm/PassSupport.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace llvm {
3636
class Pass;
3737

3838
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis) \
39-
static void *initialize##passName##PassOnce(PassRegistry &Registry) {
39+
static void initialize##passName##PassOnce(PassRegistry &Registry) {
4040

4141
#define INITIALIZE_PASS_DEPENDENCY(depName) initialize##depName##Pass(Registry);
4242

@@ -45,7 +45,6 @@ class Pass;
4545
name, arg, &passName::ID, \
4646
PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \
4747
Registry.registerPass(*PI, true); \
48-
return PI; \
4948
} \
5049
static llvm::once_flag Initialize##passName##PassFlag; \
5150
void llvm::initialize##passName##Pass(PassRegistry &Registry) { \

0 commit comments

Comments
 (0)