Skip to content

Commit c9c2bc7

Browse files
Revert the presumed location change from the
preprocess-before-conversion branch. It's no longer needed with the current expand-macros approach and would need a new regression test, which I don't want to deal with now. Plus, in its current form, it seems to have a semantic conflict with #488, which might fix the icecast file path issue.
1 parent 8dba3e1 commit c9c2bc7

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed

clang/lib/3C/PersistentSourceLoc.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ PersistentSourceLoc PersistentSourceLoc::mkPSL(clang::SourceRange SR,
6161
}
6262
}
6363
std::string Fn = PL.getFilename();
64-
std::string Tmp;
65-
getCanonicalFilePath(Fn, Tmp);
66-
Fn = Tmp;
6764

68-
#if 0
6965
// Get the absolute filename of the file.
7066
FullSourceLoc TFSL(SR.getBegin(), SM);
7167
if (TFSL.isValid()) {
@@ -81,8 +77,7 @@ PersistentSourceLoc PersistentSourceLoc::mkPSL(clang::SourceRange SR,
8177
}
8278
Fn = std::string(sys::path::remove_leading_dotslash(FeAbsS));
8379
}
84-
#endif
85-
PersistentSourceLoc PSL(Fn, PL.getLine() /*FESL.getExpansionLineNumber()*/,
80+
PersistentSourceLoc PSL(Fn, FESL.getExpansionLineNumber(),
8681
FESL.getExpansionColumnNumber(), EndCol);
8782

8883
return PSL;

clang/test/3C/base_subdir/canwrite_constraints_symlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
// expected-note@*:* {{-dump-unwritable-changes}}
3131
// expected-note@*:* {{-allow-unwritable-changes}}
3232

33-
void foo()
33+
void
3434
#include "base_subdir_partial_defn.h"

clang/test/3C/base_subdir/canwrite_constraints_unimplemented.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@
3030
// the latter in order to keep all the "weird" stuff in this test file and leave
3131
// canwrite_constraints.c sane.
3232

33-
// Since the declaration of foo begins in this (writable) file, -addcr currently
34-
// assumes the whole body is writable and tries to insert an _Unchecked
35-
// annotation on the inner block in ../base_subdir_partial_defn.h.
33+
// Since the declaration of foo begins with the "void" in this (writable) file,
34+
// 3C currently assumes the whole declaration is writable. Then 3C rewrites the
35+
// declaration of the parameter "x", which is wholly within
36+
// ../base_subdir_partial_defn.h; the rewriter seems to handle this with no
37+
// trouble. But then the proposed change to an unwritable file trips the error
38+
// we are testing.
3639
//
3740
// Changing 3C to handle such contrived preprocessor nonsense correctly is a low
3841
// priority, so this test hopefully won't have to be changed for a while, if
3942
// ever.
4043

41-
void foo()
44+
void
4245
#include "../base_subdir_partial_defn.h"

clang/test/3C/base_subdir_partial_defn.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
// base_subdir (see
88
// https://github.com/correctcomputation/checkedc-clang/issues/327).
99

10-
// This incomplete function definition is intentional. The rest is in the file
10+
// The lack of a return type here is intentional. The return type is in the file
1111
// that includes base_subdir_partial_defn.h.
12-
13-
{
14-
{
15-
int *x = (int *)1;
16-
}
17-
}
12+
foo(int *x) {}

clang/test/3C/stdout_mode_write_other.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
// expected-note@*:* {{-dump-unwritable-changes}}
2121
// expected-note@*:* {{-allow-unwritable-changes}}
2222

23-
void foo()
23+
void
2424
#include "base_subdir_partial_defn.h"

0 commit comments

Comments
 (0)