https://github.com/ziqingluo-90 closed
https://github.com/llvm/llvm-project/pull/92031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/haoNoQ approved this pull request.
Ok LGTM!! Thanks again for figuring this all out!
https://github.com/llvm/llvm-project/pull/92031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
https://github.com/ziqingluo-90 updated
https://github.com/llvm/llvm-project/pull/92031
>From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001
From: ziqingluo-90
Date: Mon, 13 May 2024 13:31:21 -0700
Subject: [PATCH 1/7] fix safe buffer opt-out region serialization
---
clang/
@@ -1911,18 +1911,22 @@ SourceManager::getDecomposedIncludedLoc(FileID FID)
const {
return DecompLoc;
}
-FileID SourceManager::getFirstFIDOfLoadedAST(SourceLocation Loc) const {
+unsigned SourceManager::getUniqueLoadedASTID(SourceLocation Loc) const {
assert(isLoadedSour
https://github.com/ziqingluo-90 updated
https://github.com/llvm/llvm-project/pull/92031
>From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001
From: ziqingluo-90
Date: Mon, 13 May 2024 13:31:21 -0700
Subject: [PATCH 1/6] fix safe buffer opt-out region serialization
---
clang/
haoNoQ wrote:
Ok I think I'm completely happy with the patch now. It makes perfect sense to
me and appears to be doing the right thing. Thank you @ziqingluo-90 for
figuring this out! Let's add that comment and land.
https://github.com/llvm/llvm-project/pull/92031
__
@@ -1911,6 +1911,20 @@ SourceManager::getDecomposedIncludedLoc(FileID FID)
const {
return DecompLoc;
}
+FileID SourceManager::getFirstFIDOfLoadedAST(SourceLocation Loc) const {
+ assert(isLoadedSourceLocation(Loc) &&
+ "Must be a source location in a loaded PCH/Mod
@@ -1483,26 +1484,40 @@ void Preprocessor::emitFinalMacroWarning(const Token
&Identifier,
}
bool Preprocessor::isSafeBufferOptOut(const SourceManager &SourceMgr,
- const SourceLocation &Loc) const {
- // Try to find a region in `Safe
@@ -0,0 +1,41 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module
-fmodule-name=safe_buffers_test_base -x c++
%S/Inputs/SafeBuffers/safe_buffers_test.modulemap -std=c++20\
+// RUN: -o %t/safe_buffers_test_base.pcm -Wunsafe-buffer-usage
+//
https://github.com/ziqingluo-90 updated
https://github.com/llvm/llvm-project/pull/92031
>From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001
From: ziqingluo-90
Date: Mon, 13 May 2024 13:31:21 -0700
Subject: [PATCH 1/5] fix safe buffer opt-out region serialization
---
clang/
@@ -2439,6 +2440,12 @@ void ASTWriter::WritePreprocessor(const Preprocessor
&PP, bool IsModule) {
Record.clear();
}
+ // Write the safe buffer opt-out region map in PP
+ for (SourceLocation &S : PP.serializeSafeBufferOptOutMap())
+AddSourceLocation(std::move(S), R
https://github.com/ChuanqiXu9 commented:
Serialization changes look good to me. I'll leave the formal approve chance to
others.
https://github.com/llvm/llvm-project/pull/92031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.
https://github.com/ChuanqiXu9 edited
https://github.com/llvm/llvm-project/pull/92031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,41 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module
-fmodule-name=safe_buffers_test_base -x c++
%S/Inputs/SafeBuffers/safe_buffers_test.modulemap -std=c++20\
+// RUN: -o %t/safe_buffers_test_base.pcm -Wunsafe-buffer-usage
+//
https://github.com/ziqingluo-90 edited
https://github.com/llvm/llvm-project/pull/92031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1551,6 +1567,58 @@ bool
Preprocessor::isPPInSafeBufferOptOutRegion(SourceLocation &StartLoc) {
return InSafeBufferOptOutRegion;
}
+SmallVector
+Preprocessor::serializeSafeBufferOptOutMap() const {
+ assert(!InSafeBufferOptOutRegion &&
+ "Attempt to serialize sa
https://github.com/ziqingluo-90 updated
https://github.com/llvm/llvm-project/pull/92031
>From ac5aeb5c3a134d085320fc7fc5cf3f2c8c41a1f1 Mon Sep 17 00:00:00 2001
From: ziqingluo-90
Date: Mon, 13 May 2024 13:31:21 -0700
Subject: [PATCH 1/3] fix safe buffer opt-out region serialization
---
clang/
@@ -1551,6 +1567,58 @@ bool
Preprocessor::isPPInSafeBufferOptOutRegion(SourceLocation &StartLoc) {
return InSafeBufferOptOutRegion;
}
+SmallVector
+Preprocessor::serializeSafeBufferOptOutMap() const {
+ assert(!InSafeBufferOptOutRegion &&
ziqingluo-90 wrot
danakj wrote:
Thanks for the explanation :)
https://github.com/llvm/llvm-project/pull/92031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
19 matches
Mail list logo